Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make installing CRDs via kubectl a prerequisite for helm2 clients #1047

Merged
merged 2 commits into from
Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 18 additions & 26 deletions deployments/helm-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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`.

Expand Down Expand Up @@ -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.

Expand Down
1 change: 0 additions & 1 deletion deployments/helm-chart/crds/ap-logconf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion deployments/helm-chart/crds/ap-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions deployments/helm-chart/crds/globalconfiguration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions deployments/helm-chart/crds/policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions deployments/helm-chart/crds/transportserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions deployments/helm-chart/crds/virtualserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions deployments/helm-chart/crds/virtualserverroute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 0 additions & 7 deletions deployments/helm-chart/templates/crds.yaml

This file was deleted.

42 changes: 17 additions & 25 deletions docs-web/installation/installation-with-helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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`.

Expand Down Expand Up @@ -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.

Expand Down