HTTPS backend protocol in Ingress

My microservices use https to communicate and the ingress communicates via http to them.

I’ve already tried adding the Kong-ingress and it doesn’t work (yaml attached below)

I have 2 questions

  1. How do I make sure Kong uses https to communicate with my microservices? In the official K8s ingress, I just an annotation called : nginx.ingress.kubernetes.io/backend-protocol : "HTTPS"
  2. How do I enforce HTTP 1.1 instead of HTTP 2?
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
  name: kong-ingress-configuration
upstream:
  slots: 10
  hash_on: none
  hash_fallback: none
  healthchecks:
    threshold: 25
    active:
      concurrency: 10
      healthy:
        http_statuses:
        - 200
        - 302
        interval: 0
        successes: 0
      http_path: "/api"
      timeout: 1
      unhealthy:
        http_failures: 0
        http_statuses:
        - 429
        interval: 0
        tcp_failures: 0
        timeouts: 0
    passive:
      healthy:
        http_statuses:
        - 200
        successes: 0
      unhealthy:
        http_failures: 0
        http_statuses:
        - 429
        - 503
        tcp_failures: 0
        timeouts: 0
proxy:
  protocol: https

You should specify at your service

    annotations:
        konghq.com/protocol: "https"

Wait, this is supposed to be specified in the service of the application?

I’ve specified this in the ingress yaml already and its still accessing the application with http

I’m not so experienced with kong. But I’m using kong with apache nifi and nifi only accepts https connection if you want to use authentication. And to make this work I used this annotation on the nifi service.

so Nifi has a normal kubernetes service (by that I mean kind: Service)

You’ve just added the konghq.com/protocol: "https" annotation to the metadata of this service.

Am I right in understanding?

thats right. here how the service looks like:

apiVersion: v1
kind: Service
metadata:
  name: {{ include "nifi.fullname" . }}-node
  labels:
    {{- include "nifi.labels" . | nindent 4 }}
  annotations:
    konghq.com/protocol: "https"
spec:
  type: {{ .Values.nifi.service.type }}
  ports:
    - port: {{ .Values.nifi.service.port }}
      targetPort: https
      protocol: TCP
      name: https
  selector:
    {{- include "nifi.selectorLabels" . | nindent 4 }}

thats all I had to do

1 Like

Alright! I’ll give this a try. Thanks!

@SamuelTJackson This worked! Thank you so much!