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

Fix multiple KIC releases in helm #1009

Merged
merged 6 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from 4 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
64 changes: 63 additions & 1 deletion deployments/helm-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,26 @@ This chart deploys the NGINX Ingress controller in your Kubernetes cluster.

## Installing the Chart

### Installing the CRDs

By default, Helm installs a number of custom resource definitions (CRDs). Those CRDs are required for the VirtualServer, VirtualServerRoute and TransportServer custom resources.

If you do not use those resources (which corresponds to `controller.enableCustomResources` set to `false`), you can skip the installation of the CRDs:

* Using Helm 3.x client:

Specify `--skip-crds` for the helm install command.

* Using a Helm 2.x client:

Set `controller.enableCustomResources` to `false`.

> **Note**: If the CRDs are already installed in the cluster, Helm will skip the CRDs installation.

### Installing via Helm Repository

1. Add NGINX Helm repository:
```
```console
$ helm repo add nginx-edge https://helm.nginx.com/edge
$ helm repo update
```
Expand Down Expand Up @@ -92,8 +108,38 @@ This chart deploys the NGINX Ingress controller in your Kubernetes cluster.

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

## Upgrading the Chart

### Upgrading the CRDs

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 crds/
```

> **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.

### Upgrading the Release

To upgrade the release `my-release`

* Using Helm 3.x client:

```console
$ helm upgrade my-release
```

* Using Helm 2.x client:

```console
$ helm upgrade -n my-release
```

## Uninstalling the Chart

### Uninstalling the Release

To uninstall/delete the release `my-release`

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

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

### Uninstalling the CRDs

Uninstalling the release does not remove the CRDs. To remove the CRDs, run:

```console
$ kubectl delete crds transportservers.k8s.nginx.org virtualservers.k8s.nginx.org virtualserverroutes.k8s.nginx.org
```

> **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.

## Running Multiple Ingress Controllers

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.

See [running multiple ingress controllers](https://docs.nginx.com/nginx-ingress-controller/installation/running-multiple-ingress-controllers/) for more details.

## Configuration

The following tables lists the configurable parameters of the NGINX Ingress controller chart and their default values.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if .Values.controller.enableCustomResources }}
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: transportservers.k8s.nginx.org
labels:
{{- include "nginx-ingress.labels" . | nindent 4 }}
app.kubernetes.io/name: "nginx-ingress"
Dean-Coakley marked this conversation as resolved.
Show resolved Hide resolved
annotations:
"helm.sh/hook": crd-install
Dean-Coakley marked this conversation as resolved.
Show resolved Hide resolved
spec:
group: k8s.nginx.org
versions:
Expand Down Expand Up @@ -76,4 +77,3 @@ spec:
type: integer
service:
type: string
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if .Values.controller.enableCustomResources }}
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: virtualservers.k8s.nginx.org
labels:
{{- include "nginx-ingress.labels" . | nindent 4 }}
app.kubernetes.io/name: "nginx-ingress"
annotations:
"helm.sh/hook": crd-install
spec:
group: k8s.nginx.org
versions:
Expand Down Expand Up @@ -648,4 +649,3 @@ spec:
type: string
state:
type: string
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if .Values.controller.enableCustomResources }}
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: virtualserverroutes.k8s.nginx.org
labels:
{{- include "nginx-ingress.labels" . | nindent 4 }}
app.kubernetes.io/name: "nginx-ingress"
annotations:
"helm.sh/hook": crd-install
spec:
group: k8s.nginx.org
versions:
Expand Down Expand Up @@ -632,4 +633,3 @@ spec:
type: string
state:
type: string
{{- end }}
7 changes: 7 additions & 0 deletions deployments/helm-chart/templates/crds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{- if .Values.controller.enableCustomResources }}
{{- range $path, $bytes := .Files.Glob "crds/*.yaml" }}
{{ $.Files.Get $path }}
---
{{- end }}
{{- end }}