Ingress-nginx: Difference between revisions
Jump to navigation
Jump to search
(15 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
* [[Kubernetes_Ingress_Concepts#Ingress_Controller|Kubernetes Ingress Concepts]] | * [[Kubernetes_Ingress_Concepts#Ingress_Controller|Kubernetes Ingress Concepts]] | ||
=Overview= | =Overview= | ||
The default nginx-based implementation of a Kubernetes [[Kubernetes_Ingress_Concepts#Ingress_Controller|ingress controller]]. It is build around the [[Kubernetes_Ingress_Concepts#Ingress_API_Resource|Ingress]] API resource and uses a ConfigMap to store the nginx configuration. The ingress-nginx ingress controller watches [[Kubernetes_Ingress_Concepts#Ingress_API_Resource|Ingress]] objects from all namespaces. It can be restricted to watch a specific namespace with --watch-namespace. | |||
=Installation= | =Installation= | ||
{{External|https://kubernetes.github.io/ingress-nginx/deploy/}} | |||
==Vendor-Specific== | |||
===Docker Desktop Kubernetes=== | |||
<syntaxhighlight lang='bash'> | |||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.35.0/deploy/static/provider/cloud/deploy.yaml | |||
</syntaxhighlight> | |||
This deploys ingress-nginx in an "ingress-nginx" namespace. It creates dedicated service accounts, configmap, roles, service, deployment, validating webhook, and jobs to create the SSL certificate used by the admission webhook. | |||
==Installation with Helm== | |||
{{External|https://kubernetes.github.io/ingress-nginx/deploy/#using-helm}} | |||
Note that by default, the ingress controller is installed in the default namespace. | |||
<syntaxhighlight lang='text'> | |||
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx | |||
helm install ingress-nginx ingress-nginx/ingress-nginx | |||
</syntaxhighlight> | |||
==Installation Validation== | |||
<syntaxhighlight lang='text'> | |||
kubectl -n ingress-nginx get pods | |||
NAME READY STATUS RESTARTS AGE | |||
ingress-nginx-controller-5947756d78-gnvft 1/1 Running 0 4m44s | |||
</syntaxhighlight> | |||
=Operations= | |||
==Controller Version== | |||
Exec into the pod and run: | |||
<syntaxhighlight lang='text'> | |||
POD_NAMESPACE=ingress-nginx | |||
POD_NAME=$(kubectl get pods -n $POD_NAMESPACE -l app.kubernetes.io/name=ingress-nginx --field-selector=status.phase=Running -o jsonpath='{.items[0].metadata.name}') | |||
kubectl exec -it $POD_NAME -n $POD_NAMESPACE -- /nginx-ingress-controller --version | |||
</syntaxhighlight> |
Latest revision as of 21:37, 25 September 2020
External
Internal
Overview
The default nginx-based implementation of a Kubernetes ingress controller. It is build around the Ingress API resource and uses a ConfigMap to store the nginx configuration. The ingress-nginx ingress controller watches Ingress objects from all namespaces. It can be restricted to watch a specific namespace with --watch-namespace.
Installation
Vendor-Specific
Docker Desktop Kubernetes
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.35.0/deploy/static/provider/cloud/deploy.yaml
This deploys ingress-nginx in an "ingress-nginx" namespace. It creates dedicated service accounts, configmap, roles, service, deployment, validating webhook, and jobs to create the SSL certificate used by the admission webhook.
Installation with Helm
Note that by default, the ingress controller is installed in the default namespace.
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install ingress-nginx ingress-nginx/ingress-nginx
Installation Validation
kubectl -n ingress-nginx get pods
NAME READY STATUS RESTARTS AGE
ingress-nginx-controller-5947756d78-gnvft 1/1 Running 0 4m44s
Operations
Controller Version
Exec into the pod and run:
POD_NAMESPACE=ingress-nginx
POD_NAME=$(kubectl get pods -n $POD_NAMESPACE -l app.kubernetes.io/name=ingress-nginx --field-selector=status.phase=Running -o jsonpath='{.items[0].metadata.name}')
kubectl exec -it $POD_NAME -n $POD_NAMESPACE -- /nginx-ingress-controller --version