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

Add Helm Chart to install NKG #840

Merged
merged 13 commits into from
Jul 24, 2023
Prev Previous commit
Next Next commit
Remove CRDs folder
ciarams87 committed Jul 24, 2023
commit e578de67c570d69447c1a9037f89a7abceeeae9e
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -99,10 +99,6 @@ njs-unit-test: ## Run unit tests for the njs httpmatches module
generate-njs-yaml: ## Generate the njs-modules ConfigMap
kubectl create configmap njs-modules --from-file=$(NJS_DIR)/httpmatches.js --dry-run=client --output=yaml > $(strip $(MANIFEST_DIR))/njs-modules.yaml

.PHONY: fetch-crds-yaml
fetch-crds-yaml: ## Fetch the Gateway API resources yaml and output it to the Helm chart crds folder
curl -s -L https://github.com/kubernetes-sigs/gateway-api/releases/download/v$(strip $(GW_API_VERSION))/standard-install.yaml -o $(CHART_DIR)/crds/gateway-crds.yaml

.PHONY: lint-helm
lint-helm: ## Run the helm chart linter
helm lint $(CHART_DIR)
96 changes: 44 additions & 52 deletions deploy/helm-chart/README.md
Original file line number Diff line number Diff line change
@@ -12,104 +12,96 @@ This chart deploys the NGINX Kubernetes Gateway in your Kubernetes cluster.
> Note: NGINX Kubernetes Gateway can only run in the `nginx-gateway` namespace. This limitation will be addressed in
the future releases.

## Installing the Chart
### Installing the Gateway API resources

> Note: The Gateway API resources from the standard channel (the CRDs and the validating webhook) must be installed
before deploying NGINX Kubernetes Gateway. By default, they will be installed by the Chart if not already
present in the cluster. If they are already installed in your cluster, please ensure they are the correct version as
supported by the NGINX Kubernetes Gateway - [see the Technical Specifications](../../README.md#technical-specifications).
Helm will not upgrade CRDs - to do so manually, see
[Upgrading the Gateway API resources](#upgrading-the-gateway-resources).
before deploying NGINX Kubernetes Gateway. If they are already installed in your cluster, please ensure they are the
correct version as supported by the NGINX Kubernetes Gateway -
[see the Technical Specifications](../../README.md#technical-specifications).

To install the Gateway resources from [the Gateway API repo](https://github.com/kubernetes-sigs/gateway-api), run:

```shell
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v0.7.1/standard-install.yaml
```

## Installing the Chart

### Installing the Chart from the OCI Registry

To install the chart with the release name `my-release` (`my-release` is the name that you choose) into the
nginx-gateway namespace (with optional `--create-namespace` flag - you can omit if the namespace already exists), and
the Gateway API resources from the standard channel (if not already present):
nginx-gateway namespace (with optional `--create-namespace` flag - you can omit if the namespace already exists):

```
helm install my-release oci://ghcr.io/nginxinc/charts/nginx-kubernetes-gateway --version 0.0.0-edge --create-namespace --wait --wait-for-jobs -n nginx-gateway
```shell
helm install my-release oci://ghcr.io/nginxinc/charts/nginx-kubernetes-gateway --version 0.0.0-edge --create-namespace --wait -n nginx-gateway
```

### Installing the Chart via Sources

#### Pulling the Chart

```
```shell
helm pull oci://ghcr.io/nginxinc/charts/nginx-kubernetes-gateway --untar --version 0.0.0-edge
cd nginx-gateway
```

#### Installing the Chart

To install the chart with the release name `my-release` (`my-release` is the name that you choose) into the
nginx-gateway namespace (with optional `--create-namespace` flag - you can omit if the namespace already exists), and
the Gateway API resources from the standard channel (if not already present):
nginx-gateway namespace (with optional `--create-namespace` flag - you can omit if the namespace already exists):

```
helm install my-release . --create-namespace --wait --wait-for-jobs -n nginx-gateway
```shell
helm install my-release . --create-namespace --wait -n nginx-gateway
```

## Upgrading the Chart
### Upgrading the Gateway Resources
Helm does not upgrade CRDs during a release upgrade, or on an install if they are already present in the cluster.
Before you upgrade a release, ensure the Gateway API resources are up to date by doing one of the following:

1. To upgrade the Gateway resources from [the Gateway API repo](https://github.com/kubernetes-sigs/gateway-api), run:
```
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v0.7.1/standard-install.yaml
```
1. To upgrade the Gateway resources from the NGINX Kubernetes Gateway Chart sources, pull the chart sources as described
in [Pulling the Chart](#pulling-the-chart) and then run:
```
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`.
Before you upgrade a release, ensure the Gateway API resources are the correct version as supported by the NGINX
Kubernetes Gateway - [see the Technical Specifications](../../README.md#technical-specifications).:

To upgrade the Gateway resources from [the Gateway API repo](https://github.com/kubernetes-sigs/gateway-api), run:

```shell
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v0.7.1/standard-install.yaml
```

### Upgrading the Chart from the OCI Registry
To upgrade the release `my-release`, run:

```
```shell
helm upgrade my-release oci://ghcr.io/nginxinc/charts/nginx-kubernetes-gateway --version 0.0.0-edge -n nginx-gateway
```

### Upgrading the Chart from the Sources

Pull the chart sources as described in [Pulling the Chart](#pulling-the-chart), if not already present. Then, to upgrade
the release `my-release`, run:
```

```shell
helm upgrade my-release . -n nginx-gateway
```

## Uninstalling the Chart

To uninstall/delete the release `my-release`:

```
```shell
helm uninstall my-release -n nginx-gateway
```

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

### Uninstalling the Gateway Resources
Uninstalling the release does NOT uninstall the CRDs or validating webhook. To clean up these resources, do one of the
following:

>**Warning: These commands will delete all the corresponding custom resources in your cluster across all namespaces!
>**Warning: 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 Gateway API implementations
running in the cluster!**

1. To delete the Gateway resources using [the Gateway API repo](https://github.com/kubernetes-sigs/gateway-api), run:
```
kubectl delete -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v0.7.1/standard-install.yaml
```
1. To delete the Gateway resources using the NGINX Kubernetes Gateway Chart sources, pull the chart sources as described
in [Pulling the Chart](#pulling-the-chart) and then run:
```
kubectl delete -f crds/
```
To delete the Gateway resources using [the Gateway API repo](https://github.com/kubernetes-sigs/gateway-api), run:

```shell
kubectl delete -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v0.7.1/standard-install.yaml
```

## Configuration

@@ -119,18 +111,18 @@ The following tables lists the configurable parameters of the NGINX Kubernetes G
| --- | --- | --- |
|`nginxGateway.image.repository` | The repository for the NGINX Kubernetes Gateway image. | ghcr.io/nginxinc/nginx-kubernetes-gateway |
|`nginxGateway.image.tag` | The tag for the NGINX Kubernetes Gateway image. | edge |
|`nginxGateway.image.pullPolicy` | The imagePullPolicy for the NGINX Kubernetes Gateway image. | Always |
|`nginxGateway.image.pullPolicy` | The `imagePullPolicy` for the NGINX Kubernetes Gateway image. | Always |
|`nginxGateway.gatewayClassName` | The name of the GatewayClass for the NGINX Kubernetes Gateway deployment. | nginx |
|`nginxGateway.gatewayControllerName` | The name of the Gateway controller. The controller name must be of the form: DOMAIN/PATH. The controller's domain is k8s-gateway.nginx.org. | k8s-gateway.nginx.org/nginx-gateway-controller |
|`nginx.image.repository` | The repository for the NGINX image. | nginx |
|`nginx.image.tag` | The tag for the NGINX image. | 1.25 |
|`nginx.image.pullPolicy` | The imagePullPolicy for the NGINX image. | Always |
|`initContainer.image.repository` | The repository for the initContainer image. | busybox |
|`initContainer.image.tag` | The tag for the initContainer image. | 1.36 |
|`serviceAccount.annotations` | Annotations for the ServiceAccount used by the NGINX Kubernetes Gateway deployment. | {} |
|`nginx.image.pullPolicy` | The `imagePullPolicy` for the NGINX image. | Always |
|`initContainer.image.repository` | The repository for the `initContainer` image. | busybox |
|`initContainer.image.tag` | The tag for the `initContainer` image. | 1.36 |
|`serviceAccount.annotations` | The `annotations` for the ServiceAccount used by the NGINX Kubernetes Gateway deployment. | {} |
|`serviceAccount.name` | Name of the ServiceAccount used by the NGINX Kubernetes Gateway deployment. | Autogenerated |
|`service.create` | Creates a service to expose the NGINX Kubernetes Gateway pods. | true |
|`service.type` | The type of service to create for the NGINX Kubernetes Gateway. | Loadbalancer |
|`service.externalTrafficPolicy` | The externalTrafficPolicy of the service. The value Local preserves the client source IP. | Local |
|`service.annotations` | The annotations of the NGINX Kubernetes Gateway service. | {} |
|`service.externalTrafficPolicy` | The `externalTrafficPolicy` of the service. The value `Local` preserves the client source IP. | Local |
|`service.annotations` | The `annotations` of the NGINX Kubernetes Gateway service. | {} |
|`service.ports` | A list of ports to expose through the NGINX Kubernetes Gateway service. Update it to match the listener ports from your Gateway resource. Follows the conventional Kubernetes yaml syntax for service ports. | [ port: 80, targetPort: 80, protocol: TCP, name: http; port: 443, targetPort: 443, protocol: TCP, name: https ] |
Loading