Skip to content

Commit 5b354eb

Browse files
authored
Fix multiple KIC deploys via helm
1 parent fdd7d98 commit 5b354eb

File tree

6 files changed

+144
-13
lines changed

6 files changed

+144
-13
lines changed

deployments/helm-chart/README.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,26 @@ This chart deploys the NGINX Ingress controller in your Kubernetes cluster.
1515

1616
## Installing the Chart
1717

18+
### Installing the CRDs
19+
20+
By default, Helm installs a number of custom resource definitions (CRDs). Those CRDs are required for the VirtualServer, VirtualServerRoute and TransportServer custom resources.
21+
22+
If you do not use those resources (which corresponds to `controller.enableCustomResources` set to `false`), you can skip the installation of the CRDs:
23+
24+
* Using Helm 3.x client:
25+
26+
Specify `--skip-crds` for the helm install command.
27+
28+
* Using a Helm 2.x client:
29+
30+
Set `controller.enableCustomResources` to `false`.
31+
32+
> **Note**: If the CRDs are already installed in the cluster, Helm will skip the CRDs installation.
33+
1834
### Installing via Helm Repository
1935

2036
1. Add NGINX Helm repository:
21-
```
37+
```console
2238
$ helm repo add nginx-edge https://helm.nginx.com/edge
2339
$ helm repo update
2440
```
@@ -92,8 +108,38 @@ This chart deploys the NGINX Ingress controller in your Kubernetes cluster.
92108

93109
> **Tip**: List all releases using `helm list`
94110

111+
## Upgrading the Chart
112+
113+
### Upgrading the CRDs
114+
115+
Helm does not upgrade the CRDs during a release upgrade. Before you upgrade a release, run the following command to upgrade the CRDs:
116+
117+
```console
118+
$ kubectl apply -f crds/
119+
```
120+
121+
> **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.
122+
123+
### Upgrading the Release
124+
125+
To upgrade the release `my-release`
126+
127+
* Using Helm 3.x client:
128+
129+
```console
130+
$ helm upgrade my-release
131+
```
132+
133+
* Using Helm 2.x client:
134+
135+
```console
136+
$ helm upgrade -n my-release
137+
```
138+
95139
## Uninstalling the Chart
96140

141+
### Uninstalling the Release
142+
97143
To uninstall/delete the release `my-release`
98144

99145
* Using Helm 3.x client:
@@ -110,6 +156,22 @@ To uninstall/delete the release `my-release`
110156

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

159+
### Uninstalling the CRDs
160+
161+
Uninstalling the release does not remove the CRDs. To remove the CRDs, run:
162+
163+
```console
164+
$ kubectl delete crds transportservers.k8s.nginx.org virtualservers.k8s.nginx.org virtualserverroutes.k8s.nginx.org
165+
```
166+
167+
> **Note**: The following 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.
168+
169+
## Running Multiple Ingress Controllers
170+
171+
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.
172+
173+
See [running multiple ingress controllers](https://docs.nginx.com/nginx-ingress-controller/installation/running-multiple-ingress-controllers/) for more details.
174+
113175
## Configuration
114176

115177
The following tables lists the configurable parameters of the NGINX Ingress controller chart and their default values.

deployments/helm-chart/templates/controller-ts-definition.yaml renamed to deployments/helm-chart/crds/transportserver.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
{{- if .Values.controller.enableCustomResources }}
21
apiVersion: apiextensions.k8s.io/v1beta1
32
kind: CustomResourceDefinition
43
metadata:
54
name: transportservers.k8s.nginx.org
65
labels:
7-
{{- include "nginx-ingress.labels" . | nindent 4 }}
6+
app.kubernetes.io/name: "nginx-ingress"
7+
annotations:
8+
"helm.sh/hook": crd-install
89
spec:
910
group: k8s.nginx.org
1011
versions:
@@ -76,4 +77,3 @@ spec:
7677
type: integer
7778
service:
7879
type: string
79-
{{- end }}

deployments/helm-chart/templates/controller-vs-definition.yaml renamed to deployments/helm-chart/crds/virtualserver.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
{{- if .Values.controller.enableCustomResources }}
21
apiVersion: apiextensions.k8s.io/v1beta1
32
kind: CustomResourceDefinition
43
metadata:
54
name: virtualservers.k8s.nginx.org
65
labels:
7-
{{- include "nginx-ingress.labels" . | nindent 4 }}
6+
app.kubernetes.io/name: "nginx-ingress"
7+
annotations:
8+
"helm.sh/hook": crd-install
89
spec:
910
group: k8s.nginx.org
1011
versions:
@@ -648,4 +649,3 @@ spec:
648649
type: string
649650
state:
650651
type: string
651-
{{- end }}

deployments/helm-chart/templates/controller-vsr-definition.yaml renamed to deployments/helm-chart/crds/virtualserverroute.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
{{- if .Values.controller.enableCustomResources }}
21
apiVersion: apiextensions.k8s.io/v1beta1
32
kind: CustomResourceDefinition
43
metadata:
54
name: virtualserverroutes.k8s.nginx.org
65
labels:
7-
{{- include "nginx-ingress.labels" . | nindent 4 }}
6+
app.kubernetes.io/name: "nginx-ingress"
7+
annotations:
8+
"helm.sh/hook": crd-install
89
spec:
910
group: k8s.nginx.org
1011
versions:
@@ -632,4 +633,3 @@ spec:
632633
type: string
633634
state:
634635
type: string
635-
{{- end }}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- if .Values.controller.enableCustomResources }}
2+
{{- range $path, $bytes := .Files.Glob "crds/*.yaml" }}
3+
{{ $.Files.Get $path }}
4+
---
5+
{{- end }}
6+
{{- end }}
7+

docs-web/installation/installation-with-helm.md

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,33 @@ This document describes how to install the NGINX Ingress Controller in your Kube
1313

1414
## Installing the Chart
1515

16+
### Installing the CRDs
17+
18+
By default, Helm installs a number of custom resource definitions (CRDs). Those CRDs are required for the VirtualServer, VirtualServerRoute and TransportServer custom resources.
19+
20+
If you do not use those resources (which corresponds to `controller.enableCustomResources` set to `false`), you can skip the installation of the CRDs:
21+
22+
* Using Helm 3.x client:
23+
24+
Specify `--skip-crds` for the helm install command.
25+
26+
* Using a Helm 2.x client:
27+
28+
Set `controller.enableCustomResources` to `false`.
29+
30+
> **Note**: If the CRDs are already installed in the cluster, Helm will skip the CRDs installation.
31+
1632
### Installing via Helm Repository
1733

1834
1. Add NGINX Helm repository:
19-
```
35+
```console
2036
$ helm repo add nginx-edge https://helm.nginx.com/edge
2137
$ helm repo update
2238
```
2339

2440
2. To install the chart with the release name my-release (my-release is the name that you choose):
2541

26-
* Using Helm 3.x client:
42+
* Using Helm 3.x client:
2743

2844
For NGINX:
2945
```console
@@ -47,7 +63,7 @@ This document describes how to install the NGINX Ingress Controller in your Kube
4763
$ helm install --name my-release nginx-edge/nginx-ingress --set controller.image.repository=myregistry.example.com/nginx-plus-ingress --set controller.nginxplus=true
4864
```
4965

50-
## Installing Using Chart Sources
66+
### Installing Using Chart Sources
5167

5268
1. Clone the Ingress controller repo:
5369
```console
@@ -89,8 +105,38 @@ This document describes how to install the NGINX Ingress Controller in your Kube
89105

90106
> **Tip**: List all releases using `helm list`
91107

108+
## Upgrading the Chart
109+
110+
### Upgrading the CRDs
111+
112+
Helm does not upgrade the CRDs during a release upgrade. Before you upgrade a release, run the following command to upgrade the CRDs:
113+
114+
```console
115+
$ kubectl apply -f crds/
116+
```
117+
118+
> **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.
119+
120+
### Upgrading the Release
121+
122+
To upgrade the release `my-release`
123+
124+
* Using Helm 3.x client:
125+
126+
```console
127+
$ helm upgrade my-release
128+
```
129+
130+
* Using Helm 2.x client:
131+
132+
```console
133+
$ helm upgrade -n my-release
134+
```
135+
92136
## Uninstalling the Chart
93137

138+
### Uninstalling the Release
139+
94140
To uninstall/delete the release `my-release`
95141

96142
* Using Helm 3.x client:
@@ -107,6 +153,22 @@ To uninstall/delete the release `my-release`
107153

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

156+
### Uninstalling the CRDs
157+
158+
Uninstalling the release does not remove the CRDs. To remove the CRDs, run:
159+
160+
```console
161+
$ kubectl delete crds transportservers.k8s.nginx.org virtualservers.k8s.nginx.org virtualserverroutes.k8s.nginx.org
162+
```
163+
164+
> **Note**: The following 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.
165+
166+
## Running Multiple Ingress Controllers
167+
168+
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.
169+
170+
See [running multiple ingress controllers](/nginx-ingress-controller/installation/running-multiple-ingress-controllers/) for more details.
171+
110172
## Configuration
111173

112174
The following tables lists the configurable parameters of the NGINX Ingress controller chart and their default values.

0 commit comments

Comments
 (0)