I'm trying to setup tls/https for my kubernetes-pod. I configured an ingress rule and I've a got service as loadbalancer. I obtained my certificate from my provider. Not sure, how important that is: It's wildcard certificate: *.my-domain.org
(Note: my-domain.org is a replacement ;) )
The browser returns "ERR_SSL_PROTOCOL_ERROR".
By the way: http is running successfully.
My steps in detail:
I've got a certificate and a key that I'm adding as secret:
kubectl create secret tls tls-secret -n default --cert=ssl_certificate.cer --key=private_key.key
This is the setup of my ingress rule:
apiVersion: networking.k8s.io/v1kind: Ingressmetadata: name: my-ingress namespace: defaultspec: tls: - hosts: - my-domain.org secretName: tls-secret rules: - host: my-domain.org http: paths: - path: / pathType: Prefix backend: service: name: my-service port: number: 80
This is my service:
apiVersion: v1kind: Servicemetadata: name: my-servicespec: selector: app: my-pod ports: - protocol: TCP targetPort: 3000 port: 80 name: http - protocol: TCP targetPort: 3000 port: 443 name: https type: LoadBalancer
And finally my pod created by the following deployment:
apiVersion: apps/v1kind: Deploymentmetadata: name: my-deploymentspec: replicas: 1 selector: matchLabels: app: my-pod minReadySeconds: 5 template: metadata: labels: app: my-pod spec: containers: - name: my-container image: registry.../nextapp:latest imagePullPolicy: Always stdin: true tty: true ports: - containerPort: 3000 name: http imagePullSecrets: - name: registry-credentials restartPolicy: Always