Hello everyone,
I’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
- pathType: Prefix
{{- 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:
- node-manager-tls.example.com
- host: node-manager-tls.example.com
http:
paths:- pathType: Prefix
path: /
backend:
service:
name: node-manager-svc
port:
number: 80
{{- end }}
- pathType: Prefix
Any help or suggestions would be greatly appreciated. Thanks in advance!