diff --git a/deployments/helm-chart/README.md b/deployments/helm-chart/README.md index 1a7e3cb6b2..927e6074c5 100644 --- a/deployments/helm-chart/README.md +++ b/deployments/helm-chart/README.md @@ -13,20 +13,9 @@ This chart deploys the NGINX Ingress controller in your Kubernetes cluster. - Build an Ingress controller image with NGINX Plus and push it to your private registry by following the instructions from [here](../../build/README.md). - Update the `controller.image.repository` field of the `values-plus.yaml` accordingly. -## Installing the Chart - -### Adding the Helm Repository +## Getting the Chart Sources -This step is required if you're installing the chart via the helm repository. - -```console -$ helm repo add nginx-edge https://helm.nginx.com/edge -$ helm repo update -``` - -### Getting the Chart Sources - -This step is required you're installing the chart using its sources, upgrading or deleting the chart. +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: upgrading/deleting the CRDs, or installing the CRDs for Helm 2.x. 1. Clone the Ingress controller repo: ```console @@ -37,23 +26,26 @@ This step is required you're installing the chart using its sources, upgrading o $ cd kubernetes-ingress/deployments/helm-chart ``` -### Installing the CRDs - -By default, Helm installs a number of custom resource definitions (CRDs). Those CRDs are required for the VirtualServer, VirtualServerRoute, TransportServer and GlobalConfiguration custom resources. +## Adding the Helm Repository -If you do not use those resources (which corresponds to `controller.enableCustomResources` set to `false`), you can skip the installation of the CRDs: +This step is required if you're installing the chart via the helm repository. -* Using Helm 3.x client: +```console +$ helm repo add nginx-edge https://helm.nginx.com/edge +$ helm repo update +``` - Specify `--skip-crds` for the helm install command. +## Installing the Chart - > **Note**: The following warning is expected and can be ignored: `skipping unknown hook: "crd-install"`. +### Installing the CRDs -* Using a Helm 2.x client: +By default, the Ingress Controller requires a number of custom resource definitions (CRDs) installed in the cluster. Helm 3.x client will install those CRDs. If you're using a Helm 2.x client, you need to install the CRDs via `kubectl`: - Set `controller.enableCustomResources` to `false`. +```console +$ kubectl create -f crds/ +``` -> **Note**: If the CRDs are already installed in the cluster, Helm will skip the CRDs installation. +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`), you can skip the installation of the CRDs. For Helm 2.x, no action is needed, as it does not install the CRDs. For Helm 3.x, specify `--skip-crds` for the helm install command. ### Installing via Helm Repository @@ -124,7 +116,7 @@ To install the chart with the release name my-release (my-release is the name th Helm does not upgrade the CRDs during a release upgrade. Before you upgrade a release, run the following command to upgrade the CRDs: ```console -$ kubectl apply -f deployments/helm-chart/crds/ +$ kubectl apply -f crds/ ``` > **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`. @@ -164,14 +156,14 @@ To uninstall/delete the release `my-release`: $ helm delete --purge my-release ``` -The command removes all the Kubernetes components associated with the chart and deletes the release. +The command removes all the Kubernetes components associated with the release and deletes the release. ### Uninstalling the CRDs Uninstalling the release does not remove the CRDs. To remove the CRDs, run: ```console -$ kubectl delete -f deployments/helm-chart/crds/ +$ kubectl delete -f crds/ ``` > **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. diff --git a/deployments/helm-chart/crds/ap-logconf.yaml b/deployments/helm-chart/crds/ap-logconf.yaml index 70c825c1e6..6184a260d8 100644 --- a/deployments/helm-chart/crds/ap-logconf.yaml +++ b/deployments/helm-chart/crds/ap-logconf.yaml @@ -3,7 +3,6 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.2.5 - "helm.sh/hook": crd-install creationTimestamp: null name: aplogconfs.appprotect.f5.com labels: diff --git a/deployments/helm-chart/crds/ap-policy.yaml b/deployments/helm-chart/crds/ap-policy.yaml index 12f58477a9..cad7c04574 100644 --- a/deployments/helm-chart/crds/ap-policy.yaml +++ b/deployments/helm-chart/crds/ap-policy.yaml @@ -3,7 +3,6 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.2.5 - "helm.sh/hook": crd-install creationTimestamp: null name: appolicies.appprotect.f5.com labels: diff --git a/deployments/helm-chart/crds/globalconfiguration.yaml b/deployments/helm-chart/crds/globalconfiguration.yaml index 784ad6a289..71dabafb9e 100644 --- a/deployments/helm-chart/crds/globalconfiguration.yaml +++ b/deployments/helm-chart/crds/globalconfiguration.yaml @@ -4,8 +4,6 @@ metadata: name: globalconfigurations.k8s.nginx.org labels: app.kubernetes.io/name: "nginx-ingress" - annotations: - "helm.sh/hook": crd-install spec: group: k8s.nginx.org versions: diff --git a/deployments/helm-chart/crds/policy.yaml b/deployments/helm-chart/crds/policy.yaml index f1300f487e..0e5b9b9e4a 100644 --- a/deployments/helm-chart/crds/policy.yaml +++ b/deployments/helm-chart/crds/policy.yaml @@ -4,8 +4,6 @@ metadata: name: policies.k8s.nginx.org labels: app.kubernetes.io/name: "nginx-ingress" - annotations: - "helm.sh/hook": crd-install spec: group: k8s.nginx.org versions: diff --git a/deployments/helm-chart/crds/transportserver.yaml b/deployments/helm-chart/crds/transportserver.yaml index 689eb32613..d6fefb22ab 100644 --- a/deployments/helm-chart/crds/transportserver.yaml +++ b/deployments/helm-chart/crds/transportserver.yaml @@ -4,8 +4,6 @@ metadata: name: transportservers.k8s.nginx.org labels: app.kubernetes.io/name: "nginx-ingress" - annotations: - "helm.sh/hook": crd-install spec: group: k8s.nginx.org versions: diff --git a/deployments/helm-chart/crds/virtualserver.yaml b/deployments/helm-chart/crds/virtualserver.yaml index c01dde97b9..8672499cda 100644 --- a/deployments/helm-chart/crds/virtualserver.yaml +++ b/deployments/helm-chart/crds/virtualserver.yaml @@ -4,8 +4,6 @@ metadata: name: virtualservers.k8s.nginx.org labels: app.kubernetes.io/name: "nginx-ingress" - annotations: - "helm.sh/hook": crd-install spec: group: k8s.nginx.org versions: diff --git a/deployments/helm-chart/crds/virtualserverroute.yaml b/deployments/helm-chart/crds/virtualserverroute.yaml index 47d237a819..9da9559f13 100644 --- a/deployments/helm-chart/crds/virtualserverroute.yaml +++ b/deployments/helm-chart/crds/virtualserverroute.yaml @@ -4,8 +4,6 @@ metadata: name: virtualserverroutes.k8s.nginx.org labels: app.kubernetes.io/name: "nginx-ingress" - annotations: - "helm.sh/hook": crd-install spec: group: k8s.nginx.org versions: diff --git a/deployments/helm-chart/templates/crds.yaml b/deployments/helm-chart/templates/crds.yaml deleted file mode 100644 index 0557f404e2..0000000000 --- a/deployments/helm-chart/templates/crds.yaml +++ /dev/null @@ -1,7 +0,0 @@ -{{- if .Values.controller.enableCustomResources }} -{{- range $path, $bytes := .Files.Glob "crds/*.yaml" }} -{{ $.Files.Get $path }} ---- -{{- end }} -{{- end }} - diff --git a/docs-web/installation/installation-with-helm.md b/docs-web/installation/installation-with-helm.md index 3531a7b28c..e4c8c59d74 100644 --- a/docs-web/installation/installation-with-helm.md +++ b/docs-web/installation/installation-with-helm.md @@ -11,20 +11,9 @@ This document describes how to install the NGINX Ingress Controller in your Kube - 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). - Update the `controller.image.repository` field of the `values-plus.yaml` accordingly. -## Installing the Chart - -### Adding the Helm Repository +## Getting the Chart Sources -This step is required if you're installing the chart via the helm repository. - -```console -$ helm repo add nginx-edge https://helm.nginx.com/edge -$ helm repo update -``` - -### Getting the Chart Sources - -This step is required you're installing the chart using its sources, upgrading or deleting the chart. +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: upgrading/deleting the CRDs, or installing the CRDs for Helm 2.x. 1. Clone the Ingress controller repo: ```console @@ -35,23 +24,26 @@ This step is required you're installing the chart using its sources, upgrading o $ cd kubernetes-ingress/deployments/helm-chart ``` -### Installing the CRDs - -By default, Helm installs a number of custom resource definitions (CRDs). Those CRDs are required for the VirtualServer, VirtualServerRoute, TransportServer and GlobalConfiguration custom resources. +## Adding the Helm Repository -If you do not use those resources (which corresponds to `controller.enableCustomResources` set to `false`), you can skip the installation of the CRDs: +This step is required if you're installing the chart via the helm repository. -* Using Helm 3.x client: +```console +$ helm repo add nginx-edge https://helm.nginx.com/edge +$ helm repo update +``` - Specify `--skip-crds` for the helm install command. +## Installing the Chart - > **Note**: The following warning is expected and can be ignored: `skipping unknown hook: "crd-install"`. +### Installing the CRDs -* Using a Helm 2.x client: +By default, the Ingress Controller requires a number of custom resource definitions (CRDs) installed in the cluster. Helm 3.x client will install those CRDs. If you're using a Helm 2.x client, you need to install the CRDs via `kubectl`: - Set `controller.enableCustomResources` to `false`. +```console +$ kubectl create -f crds/ +``` -> **Note**: If the CRDs are already installed in the cluster, Helm will skip the CRDs installation. +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`), you can skip the installation of the CRDs. For Helm 2.x, no action is needed, as it does not install the CRDs. For Helm 3.x, specify `--skip-crds` for the helm install command. ### Installing via Helm Repository @@ -122,7 +114,7 @@ To install the chart with the release name my-release (my-release is the name th Helm does not upgrade the CRDs during a release upgrade. Before you upgrade a release, run the following command to upgrade the CRDs: ```console -$ kubectl apply -f deployments/helm-chart/crds/ +$ kubectl apply -f crds/ ``` > **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`. @@ -169,7 +161,7 @@ The command removes all the Kubernetes components associated with the chart and Uninstalling the release does not remove the CRDs. To remove the CRDs, run: ```console -$ kubectl delete -f deployments/helm-chart/crds/ +$ kubectl delete -f crds/ ``` > **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.