/demo-k8s-ingress

A simple project to illustrate how to expose a kubernetes service behind an ingress.

Primary LanguageHCL

k8s-ingress-demo

A simple project to illustrate how to expose a kubernetes service behind an ingress.

How a Digital Ocean Load Balancer is Created

(from the docs) Digital Ocean's cloud controller manager watches for Kubernetes services with of type LoadBalancer and creates corresponding DigitalOcean Load Balancers to match that Kubernetes service. The Load Balancer is configured by applying the appropriate annocations to the Kubernetes Service resource in the metadata field. In the ingress-nginx manifest, this looks as follows:

# ...
---
# Source: ingress-nginx/templates/controller-service.yaml
apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: 'true'
  # ...
spec:
  type: LoadBalancer
  # ...
---
# ...
  • Note that there is a workaround required to allow pods to communicate with other pods over external IP Addresses.

Supplementary Resources

How DNS Works

DigitalOcean Docs and Tutorial

Cert-Manager and Let's Encrypt

Past Sessions and Other Info