Issue with Ingress Behavior after Applying SSL Certificate

’m encountering an issue with the behavior of my Kubernetes ingress after applying an SSL certificate. Here’s the situation:

I have deployed an application and attached an SSL certificate to the ingress by creating a secret with the key and certificate. After applying the SSL certificate, the HTTP ingress is automatically redirecting to HTTPS. This behavior only occurs when the ingress is secured with the SSL certificate. When no certificate is attached, I do not face this redirection issue.

For context, I am accessing the ingress through the following domain names:

HTTP: node-manager.example.com HTTPS: node-manager-tls.example.com My question is, is this behavior expected when a certificate is applied and the ingress is accessed through a domain name? I would appreciate any insights if this is a known issue or if others have experienced the same behavior. How can I fix this if it’s not the desired outcome?

Here is the snippet of the Ingress configuration I’m using:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: node-manager-ing
  namespace: node-manager
spec:
  rules:
  - host: node-manager.example.com
    http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: node-manager-svc
            port:
              number: 80

---
{{- if .Values.ingress.tls }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: node-manager-tls-ing
  namespace: node-manager
spec:
  tls:
  - hosts:
    - node-manager-tls.example.com
    secretName: example-secret
  rules:
  - host: node-manager-tls.example.com
    http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: node-manager-svc
            port:
              number: 80
{{- end }}

Any help or suggestions would be greatly appreciated. Thanks in advance!

It’s my understanding that if you put TLS in the ingress it will automatically redirect for you as that’s what you desired. What would be your purpose for having it not redirect and redirect?

I did see something like this so there could be some annotations that help with this: Explicitly disable ssl-redirect on ingress · Issue #194 · cert-manager/cert-manager · GitHub

and this: kubernetes - How can I disable automatic https redirect for nginx ingress controller? - Stack Overflow

But I am curious about the use case for this still

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.