Skip to content

Commit

Permalink
feat: add cert-manager subchart to fullstack-cluster-setup Helm chart (
Browse files Browse the repository at this point in the history
…#493)

Signed-off-by: Jeromy Cannon <[email protected]>
  • Loading branch information
jeromy-cannon authored Nov 7, 2023
1 parent 8c143e9 commit 674b976
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
7 changes: 5 additions & 2 deletions charts/fullstack-cluster-setup/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
7 changes: 6 additions & 1 deletion charts/fullstack-cluster-setup/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,9 @@ dependencies:
alias: envoy-gateway
version: v0.0.0-latest
repository: oci://docker.io/envoyproxy
condition: cloud.envoyGateway.enabled
condition: cloud.envoyGateway.enabled

- name: cert-manager
version: v1.13.2
repository: https://charts.jetstack.io
condition: cloud.certManager.enabled
2 changes: 2 additions & 0 deletions charts/fullstack-cluster-setup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ cloud:
enabled: false
envoyGateway:
enabled: false
certManager:
enabled: false
14 changes: 12 additions & 2 deletions fullstack-network-manager/src/commands/cluster.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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' ===")
Expand All @@ -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
}
}
18 changes: 18 additions & 0 deletions fullstack-network-manager/src/commands/flags.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

0 comments on commit 674b976

Please sign in to comment.