From 16988e4d2467f4d24f8e8aaf472c512be00e62ac Mon Sep 17 00:00:00 2001 From: Jeromy Cannon Date: Mon, 6 Nov 2023 07:25:51 -0600 Subject: [PATCH] feat: add envoy gateway to fullstack-cluster-setup helm chart (#486) Signed-off-by: Jeromy Cannon --- charts/fullstack-cluster-setup/Chart.lock | 7 +++++-- charts/fullstack-cluster-setup/Chart.yaml | 6 ++++++ charts/fullstack-cluster-setup/values.yaml | 2 ++ charts/fullstack-deployment/Chart.lock | 4 ++-- dev/Makefile | 18 +++++++----------- .../src/commands/cluster.mjs | 11 ++++++++--- .../src/commands/flags.mjs | 7 +++++++ 7 files changed, 37 insertions(+), 18 deletions(-) diff --git a/charts/fullstack-cluster-setup/Chart.lock b/charts/fullstack-cluster-setup/Chart.lock index 56b1d0cff..ebfead048 100644 --- a/charts/fullstack-cluster-setup/Chart.lock +++ b/charts/fullstack-cluster-setup/Chart.lock @@ -8,5 +8,8 @@ dependencies: - name: grafana-agent repository: https://grafana.github.io/helm-charts version: 0.27.1 -digest: sha256:1d98a6cef658a43c687cf9cfa773f8cb7f5b2468b7e38e9cbb4f99cbcfec6651 -generated: "2023-10-27T14:52:43.529303+01:00" +- name: gateway-helm + repository: oci://docker.io/envoyproxy + version: v0.0.0-latest +digest: sha256:e1a03b92eab1c8c7f21fb7d7640e9049086fc97c6b1549598457dc944801e7c7 +generated: "2023-11-03T14:01:11.306643Z" diff --git a/charts/fullstack-cluster-setup/Chart.yaml b/charts/fullstack-cluster-setup/Chart.yaml index 79ea09711..a2a83b72e 100644 --- a/charts/fullstack-cluster-setup/Chart.yaml +++ b/charts/fullstack-cluster-setup/Chart.yaml @@ -40,3 +40,9 @@ dependencies: version: 0.27.1 repository: https://grafana.github.io/helm-charts condition: cloud.grafanaAgent.enabled + + - name: gateway-helm + alias: envoy-gateway + version: v0.0.0-latest + repository: oci://docker.io/envoyproxy + condition: cloud.envoyGateway.enabled \ No newline at end of file diff --git a/charts/fullstack-cluster-setup/values.yaml b/charts/fullstack-cluster-setup/values.yaml index e612c6619..74b6a7be8 100644 --- a/charts/fullstack-cluster-setup/values.yaml +++ b/charts/fullstack-cluster-setup/values.yaml @@ -15,3 +15,5 @@ cloud: enabled: false grafanaAgent: enabled: false + envoyGateway: + enabled: false diff --git a/charts/fullstack-deployment/Chart.lock b/charts/fullstack-deployment/Chart.lock index b32b63749..18cefa63a 100644 --- a/charts/fullstack-deployment/Chart.lock +++ b/charts/fullstack-deployment/Chart.lock @@ -8,5 +8,5 @@ dependencies: - name: tenant repository: https://operator.min.io/ version: 5.0.7 -digest: sha256:5dbc1a4af8f2b057dbd7730b6308e1a2954f3f95f86e8484bb232e64ed12e923 -generated: "2023-10-04T15:47:44.747012+11:00" +digest: sha256:07f6ea06b7748b59dd24b34f2e742222ca2718592efc66d6fc55f78b628d4366 +generated: "2023-11-03T13:52:20.781862Z" diff --git a/dev/Makefile b/dev/Makefile index 564cb423d..934f0a2d2 100644 --- a/dev/Makefile +++ b/dev/Makefile @@ -66,7 +66,7 @@ init-shared: echo "cloud:" > ${CLUSTER_SETUP_VALUES_FILE} .PHONY: deploy-shared -deploy-shared: init-shared update-helm-dependencies deploy-gateway-api enable-prometheus-stack-if-required enable-minio-operator-if-required +deploy-shared: init-shared update-helm-dependencies enable-gateway-api enable-prometheus-stack-if-required enable-minio-operator-if-required source "${SCRIPTS_DIR}/main.sh" && deploy_shared # run only after gateway-api CRDs are available .PHONY: destroy-shared @@ -153,15 +153,11 @@ restart: stop-nodes start-nodes reset: destroy-network start ######################################### Gateway API ################################# -.PHONY: deploy-gateway-api -deploy-gateway-api: - #source "${SCRIPTS_DIR}/${GATEWAY_API_SCRIPT}" && deploy_haproxy_ingress - source "${SCRIPTS_DIR}/${GATEWAY_API_SCRIPT}" && deploy_envoy_gateway_api - -.PHONY: destroy-gateway-api -destroy-gateway-api: - #source "${SCRIPTS_DIR}/${GATEWAY_API_SCRIPT}" && destroy_haproxy_ingress - source "${SCRIPTS_DIR}/${GATEWAY_API_SCRIPT}" && destroy_envoy_gateway_api +.PHONY: enable-gateway-api +enable-gateway-api: + @echo ">> Enabling envoy gateway..."; \ + echo " envoyGateway:" >> ${CLUSTER_SETUP_VALUES_FILE}; \ + echo " enabled: true" >> ${CLUSTER_SETUP_VALUES_FILE}; ######################################### Telemetry ################################# .PHONY: enable-prometheus-stack-if-required @@ -189,7 +185,7 @@ destroy-grafana-tempo: source "${SCRIPTS_DIR}/${TELEMETRY_SCRIPT}" && unexpose_grafana && destroy_grafana_tempo .PHONY: deploy-prometheus -deploy-prometheus: init-shared deploy-gateway-api enable-prometheus-stack +deploy-prometheus: init-shared enable-gateway-api enable-prometheus-stack source "${SCRIPTS_DIR}/main.sh" && deploy_shared # run only after gateway-api CRDs are available -$(MAKE) wait-for-prometheus-operator source "${SCRIPTS_DIR}/${TELEMETRY_SCRIPT}" && deploy-prometheus && expose_prometheus diff --git a/fullstack-network-manager/src/commands/cluster.mjs b/fullstack-network-manager/src/commands/cluster.mjs index 5ffafb643..05e80ac8a 100644 --- a/fullstack-network-manager/src/commands/cluster.mjs +++ b/fullstack-network-manager/src/commands/cluster.mjs @@ -184,7 +184,7 @@ export class ClusterCommand extends BaseCommand { let chartName = "fullstack-cluster-setup" let namespace = argv.namespace let chartPath = `${core.constants.FST_HOME_DIR}/full-stack-testing/charts/${chartName}` - let valuesArg = this.prepareValuesArg(argv.prometheusStack, argv.minio) + let valuesArg = this.prepareValuesArg(argv.prometheusStack, argv.minio, argv.envoyGateway) this.logger.showUser(chalk.cyan('> setting up cluster:'), chalk.yellow(`${clusterName}`)) await this.chartInstall(namespace, chartName, chartPath, valuesArg) @@ -286,6 +286,7 @@ export class ClusterCommand extends BaseCommand { yargs.option('namespace', flags.namespaceFlag) yargs.option('prometheus-stack', flags.deployPrometheusStack) yargs.option('minio', flags.deployMinio) + yargs.option('envoy-gateway', flags.deployEnvoyGateway) }, handler: argv => { clusterCmd.logger.debug("==== Running 'cluster setup' ===") @@ -304,7 +305,11 @@ export class ClusterCommand extends BaseCommand { } } - prepareValuesArg(prometheusStackEnabled, minioEnabled) { - return ` --set cloud.prometheusStack.enabled=${prometheusStackEnabled} --set cloud.minio.enabled=${minioEnabled}` + prepareValuesArg(prometheusStackEnabled, minioEnabled, envoyGatewayEnabled) { + let valuesArg = '' + valuesArg += ` --set cloud.prometheusStack.enabled=${prometheusStackEnabled}` + valuesArg += ` --set cloud.minio.enabled=${minioEnabled}` + valuesArg += ` --set cloud.envoyGateway.enabled=${envoyGatewayEnabled}` + return valuesArg } } diff --git a/fullstack-network-manager/src/commands/flags.mjs b/fullstack-network-manager/src/commands/flags.mjs index d4266ba00..39f7b5408 100644 --- a/fullstack-network-manager/src/commands/flags.mjs +++ b/fullstack-network-manager/src/commands/flags.mjs @@ -49,3 +49,10 @@ export const deployMinio = { alias: 'o', type: 'boolean' } + +export const deployEnvoyGateway = { + describe: 'Deploy envoy gateway', + default: true, + alias: 'e', + type: 'boolean' +}