github.com/nginxinc/kubernetes-ingress@v1.12.5/docs-web/installation/installation-with-helm.md (about)

     1  # Installation with Helm
     2  
     3  This document describes how to install the NGINX Ingress Controller in your Kubernetes cluster using [Helm](https://helm.sh/).
     4  
     5  ## Prerequisites
     6  
     7    - A [Kubernetes Version Supported by the Ingress Controller](/nginx-ingress-controller/technical-specifications/#supported-kubernetes-versions)
     8    - Helm 3.0+.
     9    - Git.
    10    - If you’d like to use NGINX Plus:
    11      - Build an Ingress controller image with NGINX Plus and push it to your private registry by following the instructions from [here](/nginx-ingress-controller/installation/building-ingress-controller-image).
    12      - Update the `controller.image.repository` field of the `values-plus.yaml` accordingly.
    13  
    14  ## Getting the Chart Sources
    15  
    16  This step is required if you're installing the chart using its sources. Additionally, the step is also required for managing the custom resource definitions (CRDs), which the Ingress Controller requires by default, or for upgrading/deleting the CRDs.
    17  
    18  1. Clone the Ingress controller repo:
    19      ```console
    20      $ git clone https://github.com/nginxinc/kubernetes-ingress/
    21      ```
    22  2. Change your working directory to /deployments/helm-chart:
    23      ```console
    24      $ cd kubernetes-ingress/deployments/helm-chart
    25      $ git checkout v1.12.5
    26      ```
    27  
    28  ## Adding the Helm Repository
    29  
    30  This step is required if you're installing the chart via the helm repository.
    31  
    32  ```console
    33  $ helm repo add nginx-stable https://helm.nginx.com/stable
    34  $ helm repo update
    35  ```
    36  
    37  ## Installing the Chart
    38  
    39  ### Installing the CRDs
    40  
    41  By default, the Ingress Controller requires a number of custom resource definitions (CRDs) installed in the cluster. The Helm client will install those CRDs. If the CRDs are not installed, the Ingress Controller pods will not become `Ready`.
    42  
    43  If you do not use the custom resources that require those CRDs (which corresponds to `controller.enableCustomResources` set to `false` and `controller.appprotect.enable` set to `false`), the installation of the CRDs can be skipped by specifying `--skip-crds` for the helm install command.
    44  
    45  ### Installing via Helm Repository
    46  
    47  To install the chart with the release name my-release (my-release is the name that you choose):
    48  
    49  For NGINX:
    50  ```console
    51  $ helm install my-release nginx-stable/nginx-ingress
    52  ```
    53  
    54  For NGINX Plus: (assuming you have pushed the Ingress controller image `nginx-plus-ingress` to your private registry `myregistry.example.com`)
    55  ```console
    56  $ helm install my-release nginx-stable/nginx-ingress --set controller.image.repository=myregistry.example.com/nginx-plus-ingress --set controller.nginxplus=true
    57  ```
    58  ### Installing Using Chart Sources
    59  
    60  To install the chart with the release name my-release (my-release is the name that you choose):
    61  
    62  For NGINX:
    63  ```console
    64  $ helm install my-release .
    65  ```
    66  
    67  For NGINX Plus:
    68  ```console
    69  $ helm install my-release -f values-plus.yaml .
    70  ```
    71  
    72  The command deploys the Ingress controller in your Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.
    73  
    74  When deploying the Ingress controller, make sure to use your own TLS certificate and key for the default server rather than the default pre-generated ones. Read the [Configuration](#configuration) section below to see how to configure a TLS certificate and key for the default server. Note that the default server returns the Not Found page with the 404 status code for all requests for domains for which there are no Ingress rules defined.
    75  
    76  ## Upgrading the Chart
    77  
    78  ### Upgrading the CRDs
    79  
    80  Helm does not upgrade the CRDs during a release upgrade. Before you upgrade a release, run the following command to upgrade the CRDs:
    81  
    82  ```console
    83  $ kubectl apply -f crds/
    84  ```
    85  > **Note**: The following warning is expected and can be ignored: `Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply`.
    86  
    87  > **Note**: Make sure to check the [release notes](https://www.github.com/nginxinc/kubernetes-ingress/releases) for a new release for any special upgrade procedures.
    88  
    89  ### Upgrading the Release
    90  
    91  To upgrade the release `my-release`:
    92  
    93  #### Upgrade Using Chart Sources:
    94  
    95  ```console
    96  $ helm upgrade my-release .
    97  ```
    98  
    99  #### Upgrade via Helm Repository:
   100  
   101  ```console
   102  $ helm upgrade my-release nginx-stable/nginx-ingress
   103  ```
   104  
   105  ## Uninstalling the Chart
   106  
   107  ### Uninstalling the Release
   108  
   109  To uninstall/delete the release `my-release`:
   110  
   111  ```console
   112  $ helm uninstall my-release
   113  ```
   114  
   115  The command removes all the Kubernetes components associated with the release.
   116  
   117  ### Uninstalling the CRDs
   118  
   119  Uninstalling the release does not remove the CRDs. To remove the CRDs, run:
   120  
   121  ```console
   122  $ kubectl delete -f crds/
   123  ```
   124  > **Note**: This command will delete all the corresponding custom resources in your cluster across all namespaces. Please ensure there are no custom resources that you want to keep and there are no other Ingress Controller releases running in the cluster.
   125  
   126  ## Running Multiple Ingress Controllers
   127  
   128  If you are running multiple Ingress Controller releases in your cluster with enabled custom resources, the releases will share a single version of the CRDs. As a result, make sure that the Ingress Controller versions match the version of the CRDs. Additionally, when uninstalling a release, ensure that you don’t remove the CRDs until there are no other Ingress Controller releases running in the cluster.
   129  
   130  See [running multiple ingress controllers](/nginx-ingress-controller/installation/running-multiple-ingress-controllers/) for more details.
   131  
   132  ## Configuration
   133  
   134  The following tables lists the configurable parameters of the NGINX Ingress controller chart and their default values.
   135  
   136  ```eval_rst
   137  .. list-table::
   138     :header-rows: 1
   139  
   140     * - Parameter
   141       - Description
   142       - Default
   143     * - ``controller.name``
   144       - The name of the Ingress controller daemonset or deployment.
   145       - Autogenerated
   146     * - ``controller.kind``
   147       - The kind of the Ingress controller installation - deployment or daemonset.
   148       - deployment
   149     * - ``controller.nginxplus``
   150       - Deploys the Ingress controller for NGINX Plus.
   151       - false
   152     * - ``controller.nginxReloadTimeout``
   153       - The timeout in milliseconds which the Ingress Controller will wait for a successful NGINX reload after a change or at the initial start. The default is 4000 (or 20000 if `controller.appprotect.enable` is true). If set to 0, the default value will be used.
   154       - 0
   155     * - ``controller.appprotect.enable``
   156       - Enables the App Protect module in the Ingress Controller.
   157       - false
   158     * - ``controller.hostNetwork``
   159       - Enables the Ingress controller pods to use the host's network namespace.
   160       - false
   161     * - ``controller.nginxDebug``
   162       - Enables debugging for NGINX. Uses the ``nginx-debug`` binary. Requires ``error-log-level: debug`` in the ConfigMap via ``controller.config.entries``.
   163       - false
   164     * - ``controller.logLevel``
   165       - The log level of the Ingress Controller.
   166       - 1
   167     * - ``controller.image.repository``
   168       - The image repository of the Ingress controller.
   169       - nginx/nginx-ingress
   170     * - ``controller.image.tag``
   171       - The tag of the Ingress controller image.
   172       - 1.12.5
   173     * - ``controller.image.pullPolicy``
   174       - The pull policy for the Ingress controller image.
   175       - IfNotPresent
   176     * - ``controller.config.name``
   177       - The name of the ConfigMap used by the Ingress controller.
   178       - Autogenerated
   179     * - ``controller.config.entries``
   180       - The entries of the ConfigMap for customizing NGINX configuration. See `ConfigMap resource docs </nginx-ingress-controller/configuration/global-configuration/configmap-resource/>`_ for the list of supported ConfigMap keys.
   181       - {}
   182     * - ``controller.customPorts``
   183       - A list of custom ports to expose on the NGINX ingress controller pod. Follows the conventional Kubernetes yaml syntax for container ports.
   184       - []
   185     * - ``controller.defaultTLS.cert``
   186       - The base64-encoded TLS certificate for the default HTTPS server. If not specified, a pre-generated self-signed certificate is used. **Note:** It is recommended that you specify your own certificate.
   187       - A pre-generated self-signed certificate.
   188     * - ``controller.defaultTLS.key``
   189       - The base64-encoded TLS key for the default HTTPS server. **Note:** If not specified, a pre-generated key is used. It is recommended that you specify your own key.
   190       - A pre-generated key.
   191     * - ``controller.defaultTLS.secret``
   192       - The secret with a TLS certificate and key for the default HTTPS server. The value must follow the following format: ``<namespace>/<name>``. Used as an alternative to specifying a certificate and key using ``controller.defaultTLS.cert`` and ``controller.defaultTLS.key`` parameters.
   193       - None
   194     * - ``controller.wildcardTLS.cert``
   195       - The base64-encoded TLS certificate for every Ingress host that has TLS enabled but no secret specified. If the parameter is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection.
   196       - None
   197     * - ``controller.wildcardTLS.key``
   198       - The base64-encoded TLS key for every Ingress host that has TLS enabled but no secret specified. If the parameter is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection.
   199       - None
   200     * - ``controller.wildcardTLS.secret``
   201       - The secret with a TLS certificate and key for every Ingress host that has TLS enabled but no secret specified. The value must follow the following format: ``<namespace>/<name>``. Used as an alternative to specifying a certificate and key using ``controller.wildcardTLS.cert`` and ``controller.wildcardTLS.key`` parameters.
   202       - None
   203     * - ``controller.nodeSelector``
   204       - The node selector for pod assignment for the Ingress controller pods.
   205       - {}
   206     * - ``controller.terminationGracePeriodSeconds``
   207       - The termination grace period of the Ingress controller pod.
   208       - 30
   209     * - ``controller.tolerations``
   210       - The tolerations of the Ingress controller pods.
   211       - []
   212     * - ``controller.affinity``
   213       - The affinity of the Ingress controller pods.
   214       - {}
   215     * - ``controller.volumes``
   216       - The volumes of the Ingress controller pods.
   217       - []
   218     * - ``controller.volumeMounts``
   219       - The volumeMounts of the Ingress controller pods.
   220       - []
   221     * - ``controller.resources``
   222       - The resources of the Ingress controller pods.
   223       - {}
   224     * - ``controller.replicaCount``
   225       - The number of replicas of the Ingress controller deployment.
   226       - 1
   227     * - ``controller.ingressClass``
   228       - A class of the Ingress controller. For Kubernetes >= 1.18, a corresponding IngressClass resource with the name equal to the class must be deployed. Otherwise, the Ingress Controller will fail to start. The Ingress controller only processes resources that belong to its class - i.e. have the ``"ingressClassName"`` field resource equal to the class. For Kubernetes < 1.18, the Ingress Controller only processes resources that belong to its class - i.e have the annotation ``"kubernetes.io/ingress.class"`` (for Ingress resources) or field ``"ingressClassName"`` (for VirtualServer/VirtualServerRoute/TransportServer resources) equal to the class. Additionally, the Ingress Controller processes resources that do not have the class set, which can be disabled by setting the ``controller.useIngressClassOnly`` parameter to ``true``. The Ingress Controller processes all the VirtualServer/VirtualServerRoute/TransportServer resources that do not have the ``"ingressClassName"`` field for all versions of kubernetes.
   229       - nginx
   230     * - ``controller.useIngressClassOnly``
   231       - Ignore Ingress resources without the ``"kubernetes.io/ingress.class"`` annotation. For kubernetes versions >= 1.18 this flag will be IGNORED.
   232       - false
   233     * - ``controller.setAsDefaultIngress``
   234       - New Ingresses without an ingressClassName field specified will be assigned the class specified in `controller.ingressClass`.
   235       - false
   236     * - ``controller.watchNamespace``
   237       - Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces.
   238       - ""
   239     * - ``controller.enableCustomResources``
   240       - Enable the custom resources.
   241       - true
   242     * - ``controller.enablePreviewPolicies``
   243       - Enable preview policies.
   244       - false
   245     * - ``controller.enableTLSPassthrough``
   246       - Enable TLS Passthrough on port 443. Requires ``controller.enableCustomResources``.
   247       - false
   248     * - ``controller.globalConfiguration.create``
   249       - Creates the GlobalConfiguration custom resource. Requires ``controller.enableCustomResources``.
   250       - false
   251     * - ``controller.globalConfiguration.spec``
   252       - The spec of the GlobalConfiguration for defining the global configuration parameters of the Ingress Controller.
   253       - {}
   254     * - ``controller.enableSnippets``
   255       - Enable custom NGINX configuration snippets in Ingress, VirtualServer, VirtualServerRoute and TransportServer resources.
   256       - false
   257     * - ``controller.healthStatus``
   258       - Add a location "/nginx-health" to the default server. The location responds with the 200 status code for any request. Useful for external health-checking of the Ingress controller.
   259       - false
   260     * - ``controller.healthStatusURI``
   261       - Sets the URI of health status location in the default server. Requires ``controller.healthStatus``.
   262       - "/nginx-health"
   263     * - ``controller.nginxStatus.enable``
   264       - Enable the NGINX stub_status, or the NGINX Plus API.
   265       - true
   266     * - ``controller.nginxStatus.port``
   267       - Set the port where the NGINX stub_status or the NGINX Plus API is exposed.
   268       - 8080
   269     * - ``controller.nginxStatus.allowCidrs``
   270       - Add IPv4 IP/CIDR blocks to the allow list for NGINX stub_status or the NGINX Plus API. Separate multiple IP/CIDR by commas.
   271       - 127.0.0.1
   272     * - ``controller.service.create``
   273       - Creates a service to expose the Ingress controller pods.
   274       - true
   275     * - ``controller.service.type``
   276       - The type of service to create for the Ingress controller.
   277       - LoadBalancer
   278     * - ``controller.service.externalTrafficPolicy``
   279       - The externalTrafficPolicy of the service. The value Local preserves the client source IP.
   280       - Local
   281     * - ``controller.service.annotations``
   282       - The annotations of the Ingress controller service.
   283       - {}
   284     * - ``controller.service.extraLabels``
   285       - The extra labels of the service.
   286       - {}
   287     * - ``controller.service.loadBalancerIP``
   288       - The static IP address for the load balancer. Requires ``controller.service.type`` set to ``LoadBalancer``. The cloud provider must support this feature.
   289       - ""
   290     * - ``controller.service.externalIPs``
   291       - The list of external IPs for the Ingress controller service.
   292       - []
   293     * - ``controller.service.loadBalancerSourceRanges``
   294       - The IP ranges (CIDR) that are allowed to access the load balancer. Requires ``controller.service.type`` set to ``LoadBalancer``. The cloud provider must support this feature.
   295       - []
   296     * - ``controller.service.name``
   297       - The name of the service.
   298       - Autogenerated
   299     * - ``controller.service.customPorts``
   300       - A list of custom ports to expose through the Ingress controller service. Follows the conventional Kubernetes yaml syntax for service ports.
   301       - []
   302     * - ``controller.service.httpPort.enable``
   303       - Enables the HTTP port for the Ingress controller service.
   304       - true
   305     * - ``controller.service.httpPort.port``
   306       - The HTTP port of the Ingress controller service.
   307       - 80
   308     * - ``controller.service.httpPort.nodePort``
   309       - The custom NodePort for the HTTP port. Requires ``controller.service.type`` set to ``NodePort``.
   310       - ""
   311     * - ``controller.service.httpPort.targetPort``
   312       - The target port of the HTTP port of the Ingress controller service.
   313       - 80
   314     * - ``controller.service.httpsPort.enable``
   315       - Enables the HTTPS port for the Ingress controller service.
   316       - true
   317     * - ``controller.service.httpsPort.port``
   318       - The HTTPS port of the Ingress controller service.
   319       - 443
   320     * - ``controller.service.httpsPort.nodePort``
   321       - The custom NodePort for the HTTPS port. Requires ``controller.service.type`` set to ``NodePort``.
   322       - ""
   323     * - ``controller.service.httpsPort.targetPort``
   324       - The target port of the HTTPS port of the Ingress controller service.
   325       - 443
   326     * - ``controller.serviceAccount.name``
   327       - The name of the service account of the Ingress controller pods. Used for RBAC.
   328       - Autogenerated
   329     * - ``controller.serviceAccount.imagePullSecretName``
   330       - The name of the secret containing docker registry credentials. Secret must exist in the same namespace as the helm release.
   331       - ""
   332     * - ``controller.reportIngressStatus.enable``
   333       - Updates the address field in the status of Ingress resources with an external address of the Ingress controller. You must also specify the source of the external address either through an external service via ``controller.reportIngressStatus.externalService``, ``controller.reportIngressStatus.ingressLink`` or the ``external-status-address`` entry in the ConfigMap via ``controller.config.entries``. **Note:** ``controller.config.entries.external-status-address`` takes precedence over the others.
   334       - true
   335     * - ``controller.reportIngressStatus.externalService``
   336       - Specifies the name of the service with the type LoadBalancer through which the Ingress controller is exposed externally. The external address of the service is used when reporting the status of Ingress, VirtualServer and VirtualServerRoute resources. ``controller.reportIngressStatus.enable`` must be set to ``true``. The default is autogenerated and enabled when ``controller.service.create`` is set to ``true`` and ``controller.service.type`` is set to ``LoadBalancer``.
   337       - Autogenerated
   338     * - ``controller.reportIngressStatus.ingressLink``
   339       - Specifies the name of the IngressLink resource, which exposes the Ingress Controller pods via a BIG-IP system. The IP of the BIG-IP system is used when reporting the status of Ingress, VirtualServer and VirtualServerRoute resources. ``controller.reportIngressStatus.enable`` must be set to ``true``.
   340       - ""
   341     * - ``controller.reportIngressStatus.enableLeaderElection``
   342       - Enable Leader election to avoid multiple replicas of the controller reporting the status of Ingress resources. ``controller.reportIngressStatus.enable`` must be set to ``true``.
   343       - true
   344     * - ``controller.reportIngressStatus.leaderElectionLockName``
   345       - Specifies the name of the ConfigMap, within the same namespace as the controller, used as the lock for leader election. controller.reportIngressStatus.enableLeaderElection must be set to true.
   346       - Autogenerated
   347     * - ``controller.pod.annotations``
   348       - The annotations of the Ingress Controller pod.
   349       - {}
   350     * - ``controller.readyStatus.enable``
   351       - Enables the readiness endpoint `"/nginx-ready"`. The endpoint returns a success code when NGINX has loaded all the config after the startup. This also configures a readiness probe for the Ingress Controller pods that uses the readiness endpoint.
   352       - true
   353     * - ``controller.readyStatus.port``
   354       - The HTTP port for the readiness endpoint.
   355       - 8081
   356     * - ``controller.enableLatencyMetrics``
   357       - Enable collection of latency metrics for upstreams. Requires ``prometheus.create``.
   358       - false
   359     * - ``rbac.create``
   360       - Configures RBAC.
   361       - true
   362     * - ``prometheus.create``
   363       - Expose NGINX or NGINX Plus metrics in the Prometheus format.
   364       - false
   365     * - ``prometheus.port``
   366       - Configures the port to scrape the metrics.
   367       - 9113
   368     * - ``prometheus.scheme``
   369       - Configures the HTTP scheme that requests must use to connect to the Prometheus endpoint.
   370       - http
   371     * - ``prometheus.secret``
   372       - Specifies the namespace/name of a Kubernetes TLS secret which can be used to establish a secure HTTPS connection with the Prometheus endpoint.
   373       - ""
   374  ```
   375  
   376  ## Notes
   377  * The values-icp.yaml file is used for deploying the Ingress controller on IBM Cloud Private. See the [blog post](https://www.nginx.com/blog/nginx-ingress-controller-ibm-cloud-private/) for more details.