1. Home
  2. Docs
  3. Infrastructure
  4. Nginx Ingress

Nginx Ingress

To use Nginx Ingress Controller but NOT LoadBalancer, but controller.kind=DaemonSet with hostNetwork=true. First label the node for nginx:

kubectl label nodes NODE_NAME web-server=nginx

Set values.yaml for helm chart:

controller:
  hostNetwork: true
  kind: DaemonSet
  publishService:
    enabled: true
  service:
    type: ""
  resources:
    requests:
      memory: 100Mi
  # fix to one Kubernetes node
  nodeSelector:
    web-server: nginx
defaultBackend:
  resources:
    requests:
      memory: 100Mi

Deploy stable/nginx-ingress helm chart:

helm install nginx-ingress stable/nginx-ingress -f values.yaml --wait

That’s done from Kubernetes part. However, we still need DigitalOcean to allow firewall on these ports (firewall note), otherwise connections will just hang.

doctl compute firewall create --inbound-rules="protocol:tcp,address:0.0.0.0/0,ports:443" --name=https-server

WebSockets and SSL Issue

There is a potential issue with Secure WebSockets (wss://) and SSL together with nginx-ingress, and most likely if complicated with a Load Balancer, and a CDN: https://github.com/kubernetes/ingress-nginx/issues/3746.

Was this article helpful to you? Yes No

How can we help?

Leave a Reply

Your email address will not be published. Required fields are marked *