Kubernetes ingress with cert-manager

Cloud Platform (intermediate level) posted on 6th September 2018


This is a part of the series of posts on Getting an API running in Kubernetes. For this to make sense you should have worked through a few of the earlier examples. This is an update for HTTPS ingress for Kubernetes service using Managing ssl for ingress certificates with cert-manager rather than the kube-lego method described in Getting an ssl certificate for Kubernetes ingress.

I recommend that you save your commands in various scripts so you can repeat them or modify them later.  

In this article - we're doing this.



Ingress

This is the last step to getting your app out there. For my example, I'm using one of my existing domains, and services so I won't go into the app itself here. For an example app you can see Getting a simple app running on Kubernetes

make-ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: fidkp-ingress
  annotations:
    ingress.kubernetes.io/ssl-redirect: "true"
    kubernetes.io/tls-acme: "true"
    kubernetes.io/ingress.class: "nginx"
    certmanager.k8s.io/cluster-issuer: "letsencrypt-prod"

spec:
  tls:
  - hosts:
    - xxx.xxx.yourdomain.con
    secretName: api-fid-prod-crt
  rules:
  - host: xxx.xxx.yourdomain.com
    http:
      paths:
      - path: /
        backend:
          serviceName: fidkp-service
          servicePort: 80



and you can apply it

make-ingress.sh
kubectl apply -f make-ingress.yaml

Next step

We're done - thanks for sticking with me the whole way.  See Getting an API running in Kubernetes for a recap





Why not join our forum, follow the blog or follow me on twitter to ensure you get updates when they are available.
Comments