From 400ae2e725fb0ae1f133141958dc87d7f11f73d6 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Fri, 17 May 2024 16:04:02 -0700 Subject: [PATCH] move static deployment to tests --- Makefile | 2 +- config/{provisioner => tests}/static-deployment.yaml | 0 embedded.go | 4 ++-- tests/Makefile | 2 +- tests/conformance/provisioner/README.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename config/{provisioner => tests}/static-deployment.yaml (100%) diff --git a/Makefile b/Makefile index 374443427d..31d6ce2e99 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,7 @@ generate-manifests: ## Generate manifests using Helm. helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE) --set nginx.plus=true --set nginx.image.repository=$(NGINX_PLUS_PREFIX) -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-plus-gateway.yaml helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE) --set nginxGateway.gwAPIExperimentalFeatures.enable=true -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-gateway-experimental.yaml helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE) --set nginxGateway.gwAPIExperimentalFeatures.enable=true --set nginx.plus=true --set nginx.image.repository=$(NGINX_PLUS_PREFIX) -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-plus-gateway-experimental.yaml - helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set metrics.enable=false --set nginxGateway.productTelemetry.enable=false -n nginx-gateway -s templates/deployment.yaml > config/provisioner/static-deployment.yaml + helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set metrics.enable=false --set nginxGateway.productTelemetry.enable=false -n nginx-gateway -s templates/deployment.yaml > config/tests/static-deployment.yaml helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/loadbalancer.yaml helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set service.annotations.'service\.beta\.kubernetes\.io\/aws-load-balancer-type'="nlb" -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/loadbalancer-aws-nlb.yaml helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set service.type=NodePort --set service.externalTrafficPolicy="" -n nginx-gateway -s templates/service.yaml > $(strip $(MANIFEST_DIR))/service/nodeport.yaml diff --git a/config/provisioner/static-deployment.yaml b/config/tests/static-deployment.yaml similarity index 100% rename from config/provisioner/static-deployment.yaml rename to config/tests/static-deployment.yaml diff --git a/embedded.go b/embedded.go index a16eaab258..0147f76f0e 100644 --- a/embedded.go +++ b/embedded.go @@ -4,8 +4,8 @@ import _ "embed" // StaticModeDeploymentYAML contains the YAML manifest of the Deployment resource for the static mode. // We put this in the root of the repo because goembed doesn't support relative/absolute paths and symlinks, -// and we want to keep the static mode deployment manifest for the provisioner in the config/provisioner/ +// and we want to keep the static mode deployment manifest for the provisioner in the config/tests/ // directory. // -//go:embed config/provisioner/static-deployment.yaml +//go:embed config/tests/static-deployment.yaml var StaticModeDeploymentYAML []byte diff --git a/tests/Makefile b/tests/Makefile index 5680f2cdca..8e465499b3 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -157,7 +157,7 @@ deploy-updated-provisioner: ## Update provisioner manifest and deploy to the con .PHONY: generate-static-deployment generate-static-deployment: - helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set metrics.enable=false --set nginxGateway.productTelemetry.enable=false -n nginx-gateway -s templates/deployment.yaml --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 --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) --set nginx.plus=$(PLUS_ENABLED) > $(SELF_DIR)config/provisioner/static-deployment.yaml + helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set metrics.enable=false --set nginxGateway.productTelemetry.enable=false -n nginx-gateway -s templates/deployment.yaml --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 --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) --set nginx.plus=$(PLUS_ENABLED) > $(SELF_DIR)config/tests/static-deployment.yaml .PHONY: install-ngf-local-build install-ngf-local-build: deploy-updated-provisioner diff --git a/tests/conformance/provisioner/README.md b/tests/conformance/provisioner/README.md index 716a7d41d3..44f73b5265 100644 --- a/tests/conformance/provisioner/README.md +++ b/tests/conformance/provisioner/README.md @@ -19,7 +19,7 @@ Global Flags: https://github.com/nginxinc/nginx-gateway-fabric/issues/634). However, it can be used in the Gateway API conformance tests, which expect a Gateway API implementation to provision an independent data plane per Gateway. > -> Note: Provisioner uses [this manifest](https://github.com/nginxinc/nginx-gateway-fabric/blob/main/config/provisioner/static-deployment.yaml) +> Note: Provisioner uses [this manifest](https://github.com/nginxinc/nginx-gateway-fabric/blob/main/config/tests/static-deployment.yaml) to create an NGF static mode Deployment. > This manifest gets included into the NGF binary during the NGF build. To customize the Deployment, modify the manifest and **re-build** NGF.