From 69ae359a62b23f8dbb36d3a12329eaaabf7b6916 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Thu, 18 Apr 2024 19:39:45 -0700 Subject: [PATCH] Move the helm chart to charts Problem: The helm chart is not in a known path and it's hard to find. Solution: Move the helm chart to the standard charts directory --- .github/labeler.yml | 2 +- .github/workflows/ci.yml | 6 +++--- .github/workflows/release-pr.yml | 8 ++++---- .pre-commit-config.yaml | 2 +- .yamllint.yaml | 2 +- Makefile | 6 +++--- .../nginx-gateway-fabric}/.helmignore | 0 .../nginx-gateway-fabric}/Chart.yaml | 4 ++-- .../nginx-gateway-fabric}/README.md | 0 .../nginx-gateway-fabric}/chart-icon.png | Bin .../helm-chart => charts/nginx-gateway-fabric}/crds | 0 .../nginx-gateway-fabric}/templates/_helpers.tpl | 0 .../nginx-gateway-fabric}/templates/deployment.yaml | 0 .../templates/gatewayclass.yaml | 0 .../templates/nginxgateway.yaml | 0 .../nginx-gateway-fabric}/templates/rbac.yaml | 0 .../nginx-gateway-fabric}/templates/service.yaml | 0 .../nginx-gateway-fabric}/values.yaml | 0 docs/developer/implementing-a-feature.md | 2 +- docs/developer/quickstart.md | 6 +++--- site/content/how-to/monitoring/prometheus.md | 2 +- site/content/installation/installing-ngf/helm.md | 2 +- site/content/overview/gateway-architecture.md | 2 +- tests/suite/system_suite_test.go | 2 +- 24 files changed, 23 insertions(+), 23 deletions(-) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/.helmignore (100%) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/Chart.yaml (71%) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/README.md (100%) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/chart-icon.png (100%) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/crds (100%) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/templates/_helpers.tpl (100%) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/templates/deployment.yaml (100%) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/templates/gatewayclass.yaml (100%) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/templates/nginxgateway.yaml (100%) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/templates/rbac.yaml (100%) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/templates/service.yaml (100%) rename {deploy/helm-chart => charts/nginx-gateway-fabric}/values.yaml (100%) diff --git a/.github/labeler.yml b/.github/labeler.yml index dbad905fb8..c480b6c3bf 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -29,4 +29,4 @@ tests: helm-chart: - head-branch: ['^helm/', '^helm-chart/'] - changed-files: - - any-glob-to-any-file: ['deploy/helm-chart/**/*'] + - any-glob-to-any-file: ['charts/**/*'] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c18c81506a..2c9ddd855b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -299,7 +299,7 @@ jobs: - name: Deploy Kubernetes id: k8s run: | - kube_config=${{ github.workspace }}/deploy/helm-chart/kube-${{ github.run_id }}-helm + kube_config=${{ github.workspace }}/kube-${{ github.run_id }}-helm make create-kind-cluster KIND_KUBE_CONFIG=${kube_config} echo "KUBECONFIG=${kube_config}" >> "$GITHUB_ENV" kind load docker-image ghcr.io/nginxinc/nginx-gateway-fabric:${{ steps.ngf-meta.outputs.version }} ghcr.io/nginxinc/nginx-gateway-fabric/nginx:${{ steps.nginx-meta.outputs.version }} @@ -321,7 +321,7 @@ jobs: --set nginx.image.pullPolicy=Never --set service.type=NodePort -n nginx-gateway - working-directory: ${{ github.workspace }}/deploy/helm-chart + working-directory: ${{ github.workspace }}/charts/nginx-gateway-fabric publish-helm: name: Package and Publish Helm Chart @@ -345,7 +345,7 @@ jobs: - name: Package id: package run: | - output=$(helm package ${{ github.ref_type != 'tag' && '--app-version edge --version 0.0.0-edge' || '' }} deploy/helm-chart) + output=$(helm package ${{ github.ref_type != 'tag' && '--app-version edge --version 0.0.0-edge' || '' }} charts/nginx-gateway-fabric) echo "path=$(basename -- $(echo $output | cut -d: -f2))" >> $GITHUB_OUTPUT - name: Push to GitHub Container Registry diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 3d1e2aeebe..8c44e6fc7d 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -35,7 +35,7 @@ jobs: id: vars run: | # TODO(lucacome): improve this and maybe use appVersion instead of version if we switch to tags - echo "current_version=$(yq '.version' > $GITHUB_OUTPUT + echo "current_version=$(yq '.version' > $GITHUB_OUTPUT - name: Find and Replace uses: jacobtomlinson/gha-find-replace@a51bbcd94d000df9ca0fcb54ec8be69aad8374b0 # v3.0.2 @@ -50,7 +50,7 @@ jobs: with: find: "edge" replace: ${{ inputs.version }} - include: "deploy/helm-chart/*.yaml" + include: "charts/nginx-gateway-fabric/*.yaml" regex: false - name: Find and Replace @@ -58,7 +58,7 @@ jobs: with: find: ${{ steps.vars.outputs.current_version }} replace: ${{ inputs.version }} - include: "deploy/helm-chart/*.yaml" + include: "charts/nginx-gateway-fabric/*.yaml" regex: false - name: Find and Replace @@ -66,7 +66,7 @@ jobs: with: find: "Always" replace: "IfNotPresent" - include: "deploy/helm-chart/*.yaml" + include: "charts/nginx-gateway-fabric/*.yaml" regex: false - name: Generate manifests and changelog diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7d06d6ebc8..e2c258a9d4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: end-of-file-fixer - id: check-yaml args: [--allow-multiple-documents] - exclude: (^deploy/helm-chart/templates) + exclude: (^charts/nginx-gateway-fabric/templates) - id: check-added-large-files - id: check-merge-conflict - id: check-case-conflict diff --git a/.yamllint.yaml b/.yamllint.yaml index 19798ddee4..e0d0da447c 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -4,7 +4,7 @@ yaml-files: - "*.yml" ignore: - - deploy/helm-chart/templates/ + - charts/nginx-gateway-fabric - config/crd/bases/ - .github/workflows/ diff --git a/Makefile b/Makefile index 4dd945bb05..1396373f6b 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ VERSION = edge GIT_COMMIT = $(shell git rev-parse HEAD || echo "unknown") DATE = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") MANIFEST_DIR = $(CURDIR)/deploy/manifests -CHART_DIR = $(CURDIR)/deploy/helm-chart +CHART_DIR = $(CURDIR)/charts/nginx-gateway-fabric NGINX_CONF_DIR = internal/mode/static/nginx/conf NJS_DIR = internal/mode/static/nginx/modules/src NGINX_DOCKER_BUILD_PLUS_ARGS = --secret id=nginx-repo.crt,src=nginx-repo.crt --secret id=nginx-repo.key,src=nginx-repo.key @@ -194,12 +194,12 @@ install-ngf-local-build-with-plus: build-images-with-plus load-images-with-plus .PHONY: helm-install-local helm-install-local: ## Helm install NGF on configured kind cluster with local images. To build, load, and install with helm run make install-ngf-local-build. ./conformance/scripts/install-gateway.sh $(GW_API_VERSION) $(INSTALL_WEBHOOK) - helm install dev ./deploy/helm-chart --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never -n nginx-gateway + helm install dev $(CHART_DIR) --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never -n nginx-gateway .PHONY: helm-install-local-with-plus helm-install-local-with-plus: ## Helm install NGF with NGINX Plus on configured kind cluster with local images. To build, load, and install with helm run make install-ngf-local-build-with-plus. ./conformance/scripts/install-gateway.sh $(GW_API_VERSION) $(INSTALL_WEBHOOK) - helm install dev ./deploy/helm-chart --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PLUS_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginx.plus=true -n nginx-gateway + helm install dev $(CHART_DIR) --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PLUS_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginx.plus=true -n nginx-gateway # Debug Targets .PHONY: debug-build diff --git a/deploy/helm-chart/.helmignore b/charts/nginx-gateway-fabric/.helmignore similarity index 100% rename from deploy/helm-chart/.helmignore rename to charts/nginx-gateway-fabric/.helmignore diff --git a/deploy/helm-chart/Chart.yaml b/charts/nginx-gateway-fabric/Chart.yaml similarity index 71% rename from deploy/helm-chart/Chart.yaml rename to charts/nginx-gateway-fabric/Chart.yaml index db7825847b..da65c10185 100644 --- a/deploy/helm-chart/Chart.yaml +++ b/charts/nginx-gateway-fabric/Chart.yaml @@ -5,9 +5,9 @@ type: application version: 1.2.0 appVersion: "edge" home: https://github.com/nginxinc/nginx-gateway-fabric -icon: https://raw.githubusercontent.com/nginxinc/nginx-gateway-fabric/main/deploy/helm-chart/chart-icon.png +icon: https://raw.githubusercontent.com/nginxinc/nginx-gateway-fabric/main/charts/nginx-gateway-fabric/chart-icon.png sources: - - https://github.com/nginxinc/nginx-gateway-fabric/tree/main/deploy/helm-chart + - https://github.com/nginxinc/nginx-gateway-fabric/tree/main/charts/nginx-gateway-fabric keywords: - kubernetes - gateway diff --git a/deploy/helm-chart/README.md b/charts/nginx-gateway-fabric/README.md similarity index 100% rename from deploy/helm-chart/README.md rename to charts/nginx-gateway-fabric/README.md diff --git a/deploy/helm-chart/chart-icon.png b/charts/nginx-gateway-fabric/chart-icon.png similarity index 100% rename from deploy/helm-chart/chart-icon.png rename to charts/nginx-gateway-fabric/chart-icon.png diff --git a/deploy/helm-chart/crds b/charts/nginx-gateway-fabric/crds similarity index 100% rename from deploy/helm-chart/crds rename to charts/nginx-gateway-fabric/crds diff --git a/deploy/helm-chart/templates/_helpers.tpl b/charts/nginx-gateway-fabric/templates/_helpers.tpl similarity index 100% rename from deploy/helm-chart/templates/_helpers.tpl rename to charts/nginx-gateway-fabric/templates/_helpers.tpl diff --git a/deploy/helm-chart/templates/deployment.yaml b/charts/nginx-gateway-fabric/templates/deployment.yaml similarity index 100% rename from deploy/helm-chart/templates/deployment.yaml rename to charts/nginx-gateway-fabric/templates/deployment.yaml diff --git a/deploy/helm-chart/templates/gatewayclass.yaml b/charts/nginx-gateway-fabric/templates/gatewayclass.yaml similarity index 100% rename from deploy/helm-chart/templates/gatewayclass.yaml rename to charts/nginx-gateway-fabric/templates/gatewayclass.yaml diff --git a/deploy/helm-chart/templates/nginxgateway.yaml b/charts/nginx-gateway-fabric/templates/nginxgateway.yaml similarity index 100% rename from deploy/helm-chart/templates/nginxgateway.yaml rename to charts/nginx-gateway-fabric/templates/nginxgateway.yaml diff --git a/deploy/helm-chart/templates/rbac.yaml b/charts/nginx-gateway-fabric/templates/rbac.yaml similarity index 100% rename from deploy/helm-chart/templates/rbac.yaml rename to charts/nginx-gateway-fabric/templates/rbac.yaml diff --git a/deploy/helm-chart/templates/service.yaml b/charts/nginx-gateway-fabric/templates/service.yaml similarity index 100% rename from deploy/helm-chart/templates/service.yaml rename to charts/nginx-gateway-fabric/templates/service.yaml diff --git a/deploy/helm-chart/values.yaml b/charts/nginx-gateway-fabric/values.yaml similarity index 100% rename from deploy/helm-chart/values.yaml rename to charts/nginx-gateway-fabric/values.yaml diff --git a/docs/developer/implementing-a-feature.md b/docs/developer/implementing-a-feature.md index e7759767ca..f56e8f99f1 100644 --- a/docs/developer/implementing-a-feature.md +++ b/docs/developer/implementing-a-feature.md @@ -42,7 +42,7 @@ practices to ensure a successful feature development process. - **Installation Changes**: If your feature involves changes to the installation process of NGF, update the [installation](/site/content/how-to/installation/installation.md) documentation. - **Helm Changes**: If your feature introduces or changes any values of the NGF Helm Chart, update the - [Helm README](/deploy/helm-chart/README.md). + [Helm README](/charts/nginx-gateway-fabric/README.md). - **Command-line Changes**: If your feature introduces or changes a command-line flag or subcommand, update the [cli help](/site/content/reference/cli-help.md) documentation. - **Other Documentation Updates**: For any other changes that affect the behavior, usage, or configuration of NGF, diff --git a/docs/developer/quickstart.md b/docs/developer/quickstart.md index c8846cb8b2..5893143666 100644 --- a/docs/developer/quickstart.md +++ b/docs/developer/quickstart.md @@ -139,16 +139,16 @@ This will build the docker images `nginx-gateway-fabric:` and `nginx- - To install with Helm (where your release name is `my-release`): ```shell - helm install my-release ./deploy/helm-chart --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=nginx-gateway-fabric --set nginxGateway.image.tag=$(whoami) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=nginx-gateway-fabric/nginx --set nginx.image.tag=$(whoami) --set nginx.image.pullPolicy=Never -n nginx-gateway + helm install my-release ./charts/nginx-gateway-fabric --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=nginx-gateway-fabric --set nginxGateway.image.tag=$(whoami) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=nginx-gateway-fabric/nginx --set nginx.image.tag=$(whoami) --set nginx.image.pullPolicy=Never -n nginx-gateway ``` - To install NGINX Plus with Helm (where your release name is `my-release`): ```shell - helm install my-release ./deploy/helm-chart --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=nginx-gateway-fabric --set nginxGateway.image.tag=$(whoami) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=nginx-gateway-fabric/nginx-plus --set nginx.image.tag=$(whoami) --set nginx.image.pullPolicy=Never --set nginx.plus=true -n nginx-gateway + helm install my-release ./charts/nginx-gateway-fabric --create-namespace --wait --set service.type=NodePort --set nginxGateway.image.repository=nginx-gateway-fabric --set nginxGateway.image.tag=$(whoami) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=nginx-gateway-fabric/nginx-plus --set nginx.image.tag=$(whoami) --set nginx.image.pullPolicy=Never --set nginx.plus=true -n nginx-gateway ``` - > For more information on Helm configuration options see the Helm [README](../../deploy/helm-chart/README.md). + > For more information on Helm configuration options see the Helm [README](../../charts/nginx-gateway-fabric/README.md). - To install with manifests: diff --git a/site/content/how-to/monitoring/prometheus.md b/site/content/how-to/monitoring/prometheus.md index 857c0c2bb6..7828d8da4a 100644 --- a/site/content/how-to/monitoring/prometheus.md +++ b/site/content/how-to/monitoring/prometheus.md @@ -104,7 +104,7 @@ You can configure monitoring metrics for NGINX Gateway Fabric using Helm or Mani ### Using Helm -If you're setting up NGINX Gateway Fabric with Helm, you can adjust the `metrics.*` parameters to fit your needs. For detailed options and instructions, see the [Helm README](/deploy/helm-chart/README.md). +If you're setting up NGINX Gateway Fabric with Helm, you can adjust the `metrics.*` parameters to fit your needs. For detailed options and instructions, see the [Helm README](/charts/nginx-gateway-fabric/README.md). ### Using Kubernetes manifests diff --git a/site/content/installation/installing-ngf/helm.md b/site/content/installation/installing-ngf/helm.md index a3605ca9cd..8c061ce3c1 100644 --- a/site/content/installation/installing-ngf/helm.md +++ b/site/content/installation/installing-ngf/helm.md @@ -265,7 +265,7 @@ Follow these steps to uninstall NGINX Gateway Fabric and Gateway API from your K ## Additional configuration -For a full list of the Helm Chart configuration parameters, read [the NGINX Gateway Fabric Helm Chart](https://github.com/nginxinc/nginx-gateway-fabric/blob/v1.2.0/deploy/helm-chart/README.md#configuration). +For a full list of the Helm Chart configuration parameters, read [the NGINX Gateway Fabric Helm Chart](https://github.com/nginxinc/nginx-gateway-fabric/blob/v1.2.0/charts/nginx-gateway-fabric/README.md#configuration). ## Next steps diff --git a/site/content/overview/gateway-architecture.md b/site/content/overview/gateway-architecture.md index c0ea4e2791..8f9ffed086 100644 --- a/site/content/overview/gateway-architecture.md +++ b/site/content/overview/gateway-architecture.md @@ -70,7 +70,7 @@ The following list describes the connections, preceeded by their types in parent 1. (HTTPS) - Read: _NGF_ reads the _Kubernetes API_ to get the latest versions of the resources in the cluster. - - Write: _NGF_ writes to the _Kubernetes API_ to update the handled resources' statuses and emit events. If there's more than one replica of _NGF_ and [leader election](https://github.com/nginxinc/nginx-gateway-fabric/tree/v1.2.0/deploy/helm-chart#configuration) is enabled, only the _NGF_ pod that is leading will write statuses to the _Kubernetes API_. + - Write: _NGF_ writes to the _Kubernetes API_ to update the handled resources' statuses and emit events. If there's more than one replica of _NGF_ and [leader election](https://github.com/nginxinc/nginx-gateway-fabric/tree/v1.2.0/charts/nginx-gateway-fabric#configuration) is enabled, only the _NGF_ pod that is leading will write statuses to the _Kubernetes API_. 1. (HTTP, HTTPS) _Prometheus_ fetches the `controller-runtime` and NGINX metrics via an HTTP endpoint that _NGF_ exposes (`:9113/metrics` by default). Prometheus is **not** required by NGINX Gateway Fabric, and its endpoint can be turned off. 1. (File I/O) - Write: _NGF_ generates NGINX _configuration_ based on the cluster resources and writes them as `.conf` files to the mounted `nginx-conf` volume, located at `/etc/nginx/conf.d`. It also writes _TLS certificates_ and _keys_ from [TLS secrets](https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets) referenced in the accepted Gateway resource to the `nginx-secrets` volume at the path `/etc/nginx/secrets`. diff --git a/tests/suite/system_suite_test.go b/tests/suite/system_suite_test.go index ee2343dbc0..d7786aaa3d 100644 --- a/tests/suite/system_suite_test.go +++ b/tests/suite/system_suite_test.go @@ -223,7 +223,7 @@ func getDefaultSetupCfg() setupConfig { _, file, _, _ := runtime.Caller(0) fileDir := path.Join(path.Dir(file), "../") basepath := filepath.Dir(fileDir) - localChartPath = filepath.Join(basepath, "deploy/helm-chart") + localChartPath = filepath.Join(basepath, "charts/nginx-gateway-fabric") return setupConfig{ releaseName: releaseName,