nginx-ingress-controller

by joaquinito2051

Helm chartv3.4.5App 0.24.1

Chart for the nginx Ingress controller

About this chart

Nginx Ingress Controller

nginx-ingress is an Ingress controller that uses NGINX to manage external access to HTTP services in a Kubernetes cluster.

TL;DR;

$ helm install <helm-repo>/nginx-ingress-controller

$ helm install bitnami/nginx-ingress-controller

Introduction

Bitnami charts for Helm are carefully engineered, actively maintained and are the quickest and easiest way to deploy containers on a Kubernetes cluster that are ready to handle production workloads.

This chart bootstraps a nginx-ingress deployment on a Kubernetes cluster using the Helm package manager.

Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of Bitnami Kubernetes Production Runtime (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.

Prerequisites

  • Kubernetes 1.6+

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release <helm-repo>/nginx-ingress-controller

$ helm install --name my-release bitnami/nginx-ingress-controller The command deploys nginx-ingress-controller on the Kubernetes cluster in the default configuration.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following tables lists the configurable parameters of the nginx-ingress-controller chart and their default values.

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registrynil
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)
namename of the controller componentcontroller
image.registryname of the container image registrydocker.io
image.repositorycontroller container image repositorybitnami/nginx-ingress-controller
image.tagcontroller container image tag{VERSION}
image.pullPolicycontroller container image pull policyIfNotPresent
confignginx ConfigMap entriesuse-geoip: "false", use-geoip2: "true"
hostNetworkIf the nginx deployment / daemonset should run on the host's network namespace. Do not set this when controller.service.externalIPs is set and kube-proxy is used as there will be a port-conflict for port 80false
defaultBackendServicedefault 404 backend service; required only if defaultBackend.enabled = false""
electionIDelection ID to use for the status updateingress-controller-leader
extraEnvsany additional environment variables to set in the pods{}
extraContainersSidecar containers to add to the controller pod. See LemonLDAP::NG controller as example{}
extraVolumeMountsAdditional volumeMounts to the controller main container{}
extraVolumesAdditional volumes to the controller pod{}
extraInitContainersContainers, which are run before the app containers are started[]
ingressClassname of the ingress class to route through this controllernginx
scope.enabledlimit the scope of the ingress controllerfalse (watch all namespaces)
scope.namespacenamespace to watch for ingress"" (use the release namespace)
extraArgsAdditional controller container arguments{}
kindinstall as Deployment or DaemonSetDeployment
daemonset.useHostPortIf controller.kind is DaemonSet, this will enable hostPort for TCP/80 and TCP/443false
daemonset.hostPorts.httpIf controller.daemonset.useHostPort is true and this is non-empty, it sets the hostPort"80"
daemonset.hostPorts.httpsIf controller.daemonset.useHostPort is true and this is non-empty, it sets the hostPort"443"
tolerationsnode taints to tolerate (requires Kubernetes >=1.6)[]
affinitynode/pod affinities (requires Kubernetes >=1.6){}
minReadySecondshow many seconds a pod needs to be ready before killing the next, during update0
nodeSelectornode labels for pod assignment{}
podAnnotationsannotations to be added to pods{}
podLabelslabels to add to the pod container metadata{}
replicaCountdesired number of controller pods1
minAvailableminimum number of available controller pods for PodDisruptionBudget1
resourcescontroller pod resource requests & limits{}
priorityClassNamecontroller priorityClassNamenil
lifecyclecontroller pod lifecycle hooks{}
service.annotationsannotations for controller service{}
service.labelslabels for controller service{}
publishService.enabledif true, the controller will set the endpoint records on the ingress objects to reflect those on the servicefalse
publishService.pathOverrideoverride of the default publish-service name""
service.clusterIPinternal controller cluster service IP""
service.externalIPscontroller service external IP addresses. Do not set this when controller.hostNetwork is set to true and kube-proxy is used as there will be a port-conflict for port 80[]
service.externalTrafficPolicyIf controller.service.type is NodePort or LoadBalancer, set this to Local to enable source IP preservation"Cluster"
service.healthCheckNodePortIf controller.service.type is NodePort or LoadBalancer and controller.service.externalTrafficPolicy is set to Local, set this to the managed health-check port the kube-proxy will expose. If blank, a random port in the NodePort range will be assigned""
service.loadBalancerIPIP address to assign to load balancer (if supported)""
service.loadBalancerSourceRangeslist of IP CIDRs allowed access to load balancer (if supported)[]
service.enableHttpif port 80 should be opened for servicetrue
service.enableHttpsif port 443 should be opened for servicetrue
service.targetPorts.httpSets the targetPort that maps to the Ingress' port 8080
service.targetPorts.httpsSets the targetPort that maps to the Ingress' port 443443
service.typetype of controller service to createLoadBalancer
service.nodePorts.httpIf controller.service.type is NodePort and this is non-empty, it sets the nodePort that maps to the Ingress' port 80""
service.nodePorts.httpsIf controller.service.type is NodePort and this is non-empty, it sets the nodePort that maps to the Ingress' port 443""
livenessProbe.initialDelaySecondsDelay before liveness probe is initiated10
livenessProbe.periodSecondsHow often to perform the probe10
livenessProbe.timeoutSecondsWhen the probe times out5
livenessProbe.successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.1
livenessProbe.failureThresholdMinimum consecutive failures for the probe to be considered failed after having succeeded.3
livenessProbe.portThe port number that the liveness probe will listen on.10254
readinessProbe.initialDelaySecondsDelay before readiness probe is initiated10
readinessProbe.periodSecondsHow often to perform the probe10
readinessProbe.timeoutSecondsWhen the probe times out1
readinessProbe.successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.1
readinessProbe.failureThresholdMinimum consecutive failures for the probe to be considered failed after having succeeded.3
readinessProbe.portThe port number that the readiness probe will listen on.10254
stats.enabledif true, enable "vts-status" pagefalse
stats.service.annotationsannotations for controller stats service{}
stats.service.clusterIPinternal controller stats cluster service IP""
stats.service.externalIPscontroller service stats external IP addresses[]
stats.service.loadBalancerIPIP address to assign to load balancer (if supported)""
stats.service.loadBalancerSourceRangeslist of IP CIDRs allowed access to load balancer (if supported)[]
stats.service.typetype of controller stats service to createClusterIP
metrics.enabledif true, enable Prometheus metrics (controller.stats.enabled must be true as well)false
metrics.service.annotationsannotations for Prometheus metrics service{}
metrics.service.clusterIPcluster IP address to assign to service""
metrics.service.externalIPsPrometheus metrics service external IP addresses[]
metrics.service.loadBalancerIPIP address to assign to load balancer (if supported)""
metrics.service.loadBalancerSourceRangeslist of IP CIDRs allowed access to load balancer (if supported)[]
metrics.service.portPrometheus metrics service port9913
metrics.service.typetype of Prometheus metrics service to createClusterIP
customTemplate.configMapNameconfigMap containing a custom nginx template""
customTemplate.configMapKeyconfigMap key containing the nginx template""
headersconfigMap key:value pairs containing the custom headers for Nginx{}
updateStrategyallows setting of RollingUpdate strategy{}
defaultBackend.enabledIf false, controller.defaultBackendService must be providedtrue
defaultBackend.namename of the default backend componentdefault-backend
defaultBackend.image.repositorydefault backend container image repositoryk8s.gcr.io/defaultbackend
defaultBackend.image.tagdefault backend container image tag1.4
defaultBackend.image.pullPolicydefault backend container image pull policyIfNotPresent
defaultBackend.extraArgsAdditional default backend container arguments{}
defaultBackend.portHttp port number8080
defaultBackend.tolerationsnode taints to tolerate (requires Kubernetes >=1.6)[]
defaultBackend.affinitynode/pod affinities (requires Kubernetes >=1.6){}
defaultBackend.nodeSelectornode labels for pod assignment{}
defaultBackend.podAnnotationsannotations to be added to pods{}
defaultBackend.podLabelslabels to add to the pod container metadata{}
defaultBackend.replicaCountdesired number of default backend pods1
defaultBackend.minAvailableminimum number of available default backend pods for PodDisruptionBudget1
defaultBackend.resourcesdefault backend pod resource requests & limits{}
defaultBackend.priorityClassNamedefault backend priorityClassNamenil
defaultBackend.service.annotationsannotations for default backend service{}
defaultBackend.service.clusterIPinternal default backend cluster service IP""
defaultBackend.service.externalIPsdefault backend service external IP addresses[]
defaultBackend.service.loadBalancerIPIP address to assign to load balancer (if supported)""
defaultBackend.service.loadBalancerSourceRangeslist of IP CIDRs allowed access to load balancer (if supported)[]
defaultBackend.service.typetype of default backend service to createClusterIP
imagePullSecretsname of Secret resource containing private registry credentialsnil
rbac.createif true, create & use RBAC resourcestrue
securityContext.fsGroupGroup ID for the container1001
securityContext.runAsUserUser ID for the container1001
podSecurityPolicy.enabledif true, create & use Pod Security Policy resourcesfalse
serviceAccount.createif true, create a service account``
serviceAccount.nameThe name of the service account to use. If not set and create is true, a name is generated using the fullname template.``
revisionHistoryLimitThe number of old history to retain to allow rollback.10
tcpTCP service key:value pairs{}
udpUDP service key:value pairs{}

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
$ helm install --name my-release \
  --set controller.image.pullPolicy=Always \
    <helm-repo>/nginx-ingress-controller
$ helm install --name my-release \

The above command sets the controller.image.pullPolicy to Always.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml <helm-repo>/nginx-ingress-controller

$ helm install --name my-release -f values.yaml bitnami/nginx-ingress-controller

Tip: You can use the default values.yaml

Upgrading

To 1.0.0

Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments. Use the workaround below to upgrade from versions previous to 1.0.0. The following example assumes that the release name is nginx-ingress-controller:

$ kubectl patch deployment nginx-ingress-controller-default-backend --type=json -

Deploy nginx-ingress-controller with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nginx-ingress-controller on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartnginx-ingress-controller is pinned at v3.4.5 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply