Install Let's Encrypt SSL Certificate on Kubernetes Cluster (Microk8s) Install Cert Manager sudo microk8s kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.15.1/cert-manager.yaml Create a Cluster Certiticate Issuer apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: letsencrypt spec: acme: server: https://acme-v02.api.letsencrypt.org/directory email: [email protected] privateKeySecretRef: name: letsencrypt-key-1 solvers: - http01: ingress: class: public Modify your Ingress annotation and tls specification apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-routes annotations: cert-manager.io/cluster-issuer: "letsencrypt" spec: tls: - hosts: #change to your domain - your.domain.com secretName: tls-secret rules: #change to your domain - host: your.domain.com http: paths: - path: / pathType: Prefix backend: service: name: webserver-svc port: number: 80
This will redirect http traffic to https. To Disable redirection, and support both mixed http and https add this to the service's annotation