Ingress uses http instead of https

10/20/2021

I am using Azure Kubernetes Service to deploy my applications. I deployed application access to it via Ingress. Application must request permissions from another service using https. But in the logs I see this error message

Invalid redirect_uri: "http://test-api.dev.net/signin-oidc"

As if my traffic for application is not using https

ingress.yml

{{- if .Values.ingress.enabled -}}
{{- $fullName := include "test-api.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
  name: {{ $fullName }}
  labels:
    {{- include "test-api.labels" . | nindent 4 }}
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/configuration-snippet: |
      more_clear_headers Server;
spec:
  {{- if .Values.ingress.tls }}
  tls:
    - hosts:
        - {{ .Values.ingress.tls.hosts }}
      secretName: {{ .Values.ingress.tls.secretName }}
  {{- end }}
  rules:
    {{- range $key, $value := .Values.ingress.hosts  }}
    - host: {{ $value | quote }}
      http:
        paths:
          - path: /
            pathType: ImplementationSpecific
            backend:
              service:
                name: {{ $fullName }}
                port: 
                  number: {{ $svcPort }}
    {{- end }}
  {{- end }}

service.yml

apiVersion: v1
kind: Secret
metadata:
  name: {{ include "test-api.fullname" . }}
  labels:
    app.kubernetes.io/name: {{ include "test-api.name" . }}
    helm.sh/chart: {{ include "test-api.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
  {{- toYaml .Values.secretVars | nindent 2 }}

Could you help me? Thanks.

-- Vitalii Fedorenko
azure-aks
kubernetes
kubernetes-helm
kubernetes-ingress

0 Answers