[Kubernetes (K8S)] Helm install Ingress Nginx within Kubernetes (K8S)
helm-ingress-nginx-example
ingress-nginx is an Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer.
You can modify it and use ingress-nginx. There is some examplesabout installing it with Helm in the article.
As of Nov 13, 2020, charts in this repo will no longer be updated. For more information, see the Helm Charts Deprecation and Archive Notice, and Update.
You can use Azure Helm mirror - http://mirror.azure.cn/kubernetes/charts/ to replace https://kubernetes-charts.storage.googleapis.com
Prerequisites
-
Kubernetes (K8S)
Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications. -
Helm
Helm is the best way to find, share, and use software built for Kubernetes.
How to Install
1 | git clone example. |
Custom Values.yaml
Edit values.yaml in helm-ingress-nginx-example directory, and replace content within < and >.
How to expose Ingress Nginx controller pod outside Kuberneters(K8S):
- use hostNetwork to expose Ingress Nginx controller pod.
- run Ingress Nginx controller as a DaemonSet.
- specify nodeSelector with Your Node Host Name or Label.
1 | cat values.yaml |
Install by Helm
Helm install ingress-nginx within ingress-nginx namespace. Please create ingress-nginx namespace first if not exist.
1 |
|
See Helm release about ingress-nginx.
1 | helm list --namespace ingress-nginx |
See pods about ingress-nginx.
1 | kubectl get pods -n ingress-nginx |
Common Annotations
You can add these Kubernetes annotations to specific Ingress objects to customize their behavior.
Custom max body size
For NGINX, an 413 error will be returned to the client when the size in a request exceeds the maximum allowed size of the client request body. This size can be configured by the parameter client_max_body_size.
To configure this setting globally for all Ingress rules, the proxy-body-size value may be set in the NGINX ConfigMap. To use custom values in an Ingress rule define these annotation:
1 | nginx.ingress.kubernetes.io/proxy-body-size: 8m |
FAQs
err services “ingress-nginx” not found
1 | W0530 05:54:54.909996 6 queue.go:130] requeuing &ObjectMeta{Name:sync status,GenerateName:,Namespace:,SelfLink:,UID:,ResourceVersion:,Generation:0,CreationTimestamp:0001-01-01 00:00:00 +0000 UTC,DeletionTimestamp:<nil>,DeletionGracePeriodSeconds:nil,Labels:map[string]string{},Annotations:map[string]string{},OwnerReferences:[],Finalizers:[],ClusterName:,Initializers:nil,ManagedFields:[],}, err services "ingress-nginx" not found |
Create a manifest file for ingress-nginx
Service:
1 | # Service-Nginx-Ingress.yaml |
Create Service resources:
1 | kubectl apply -f Service-Nginx-Ingress.yaml |
Check Service resources:
1 | kubectl get svc -n ingress-nginx |
See Flood of ingress-nginx service error in controller · Issue #3005 · kubernetes-sigs/kubespray - https://github.com/kubernetes-sigs/kubespray/issues/3005 to learn more.
References
[2] Welcome - NGINX Ingress Controller - https://kubernetes.github.io/ingress-nginx/