From 674b976523bcf800acf73201f8cea17d051d7bb3 Mon Sep 17 00:00:00 2001 From: Jeromy Cannon Date: Tue, 7 Nov 2023 13:28:40 -0600 Subject: [PATCH] feat: add cert-manager subchart to fullstack-cluster-setup Helm chart (#493) Signed-off-by: Jeromy Cannon --- charts/fullstack-cluster-setup/Chart.lock | 7 +++++-- charts/fullstack-cluster-setup/Chart.yaml | 7 ++++++- charts/fullstack-cluster-setup/values.yaml | 2 ++ .../src/commands/cluster.mjs | 14 ++++++++++++-- .../src/commands/flags.mjs | 18 ++++++++++++++++++ 5 files changed, 43 insertions(+), 5 deletions(-) diff --git a/charts/fullstack-cluster-setup/Chart.lock b/charts/fullstack-cluster-setup/Chart.lock index ebfead048..02c849996 100644 --- a/charts/fullstack-cluster-setup/Chart.lock +++ b/charts/fullstack-cluster-setup/Chart.lock @@ -11,5 +11,8 @@ dependencies: - name: gateway-helm repository: oci://docker.io/envoyproxy version: v0.0.0-latest -digest: sha256:e1a03b92eab1c8c7f21fb7d7640e9049086fc97c6b1549598457dc944801e7c7 -generated: "2023-11-03T14:01:11.306643Z" +- name: cert-manager + repository: https://charts.jetstack.io + version: v1.13.2 +digest: sha256:70fb74084662a235dea3c8d33d03753f30694029fa9a3a319132683504e177a4 +generated: "2023-11-06T17:15:18.09196Z" diff --git a/charts/fullstack-cluster-setup/Chart.yaml b/charts/fullstack-cluster-setup/Chart.yaml index a2a83b72e..64c5937be 100644 --- a/charts/fullstack-cluster-setup/Chart.yaml +++ b/charts/fullstack-cluster-setup/Chart.yaml @@ -45,4 +45,9 @@ dependencies: alias: envoy-gateway version: v0.0.0-latest repository: oci://docker.io/envoyproxy - condition: cloud.envoyGateway.enabled \ No newline at end of file + condition: cloud.envoyGateway.enabled + + - name: cert-manager + version: v1.13.2 + repository: https://charts.jetstack.io + condition: cloud.certManager.enabled \ No newline at end of file diff --git a/charts/fullstack-cluster-setup/values.yaml b/charts/fullstack-cluster-setup/values.yaml index 74b6a7be8..835f276cf 100644 --- a/charts/fullstack-cluster-setup/values.yaml +++ b/charts/fullstack-cluster-setup/values.yaml @@ -17,3 +17,5 @@ cloud: enabled: false envoyGateway: enabled: false + certManager: + enabled: false diff --git a/fullstack-network-manager/src/commands/cluster.mjs b/fullstack-network-manager/src/commands/cluster.mjs index dd3742c52..d6b261230 100644 --- a/fullstack-network-manager/src/commands/cluster.mjs +++ b/fullstack-network-manager/src/commands/cluster.mjs @@ -184,7 +184,8 @@ export class ClusterCommand extends BaseCommand { const chartName = "fullstack-cluster-setup" const namespace = argv.namespace const chartPath = `${core.constants.FST_HOME_DIR}/full-stack-testing/charts/${chartName}` - const valuesArg = this.prepareValuesArg(argv.prometheusStack, argv.minio, argv.envoyGateway) + const valuesArg = this.prepareValuesArg(argv.prometheusStack, + argv.minio, argv.envoyGateway, argv.certManager, argv.certManagerCrds) this.logger.showUser(chalk.cyan('> setting up cluster:'), chalk.yellow(`${clusterName}`)) await this.chartInstall(namespace, chartName, chartPath, valuesArg) @@ -287,6 +288,8 @@ export class ClusterCommand extends BaseCommand { yargs.option('prometheus-stack', flags.deployPrometheusStack) yargs.option('minio', flags.deployMinio) yargs.option('envoy-gateway', flags.deployEnvoyGateway) + yargs.option('cert-manager', flags.deployCertManager) + yargs.option('cert-manager-crds', flags.deployCertManagerCRDs) }, handler: argv => { clusterCmd.logger.debug("==== Running 'cluster setup' ===") @@ -305,11 +308,18 @@ export class ClusterCommand extends BaseCommand { } } - prepareValuesArg(prometheusStackEnabled, minioEnabled, envoyGatewayEnabled) { + prepareValuesArg(prometheusStackEnabled, minioEnabled, envoyGatewayEnabled, + certManagerEnabled, certManagerCrdsEnabled) { let valuesArg = '' valuesArg += ` --set cloud.prometheusStack.enabled=${prometheusStackEnabled}` valuesArg += ` --set cloud.minio.enabled=${minioEnabled}` valuesArg += ` --set cloud.envoyGateway.enabled=${envoyGatewayEnabled}` + valuesArg += ` --set cloud.certManager.enabled=${certManagerEnabled}` + valuesArg += ` --set cert-manager.installCRDs=${certManagerCrdsEnabled}` + if (certManagerEnabled && !certManagerCrdsEnabled) { + this.logger.showUser(chalk.yellowBright('> WARNING:'), chalk.yellow( + 'cert-manager CRDs are required for cert-manager, please enable it if you have not installed it independently.')) + } return valuesArg } } diff --git a/fullstack-network-manager/src/commands/flags.mjs b/fullstack-network-manager/src/commands/flags.mjs index 39f7b5408..9ae60d7e5 100644 --- a/fullstack-network-manager/src/commands/flags.mjs +++ b/fullstack-network-manager/src/commands/flags.mjs @@ -56,3 +56,21 @@ export const deployEnvoyGateway = { alias: 'e', type: 'boolean' } + +export const deployCertManager = { + describe: 'Deploy cert manager', + default: false, + alias: 'r', + type: 'boolean' +} + +/* + Deploy cert manager CRDs separately from cert manager itself. Cert manager + CRDs are required for cert manager to deploy successfully. + */ +export const deployCertManagerCRDs = { + describe: 'Deploy cert manager CRDs', + default: false, + alias: 'd', + type: 'boolean' +}