WARNING: There is a difference between "nginx-ingress" and "ingress-nginx". Long story short, one is maintained by the Kuberenetes Communinity, the other by NGINX/F5. For more information about the differences, read their documentation.
Note: This Gist works based on the assumption you deployed your K3S Cluster without Traefik.
Follow these six steps to deploy a simple NGINX Ingress Controller;
- Deploy
ns-and-sa.yaml(Namespace and Service Account) - Deploy
rbac.yaml(ClusterRoles and Bindings) - Deploy
default-server-secret.yaml(Default Self-Signed SSL) - Deploy
nginx-config.yaml(Additional Configs in ConfigMap) - Deploy
ingress-class.yaml(Define IngressClass for Kubernetes >= 1.18) - Deploy
nginx-ingress.yaml(Define Ingress Controller DaemonSet)
To validate the install of NGINX, if you navigate to the IP address of any Worker (Agent) node, on HTTP or HTTPS, you should be greeted with the default NGINX 404 page.
example.yaml contains a deployment for a default NGINX webserver built on an Alpine image.
Before deploying this manifest, you need to;
- Update line #45 of the file to reflect your environment
- Create a DNS record, or host file entry, pointing to all of the Worker (Agent) nodes IP addresses.
If this example deployed correctly, when you navigate to the url you specified you will be greeted with the "Welcome to NGINX" page.
For additional confirguration options, review NGINX documentation.