From fd9c3e8341076c1a553674214de63ecae059b49e Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Wed, 22 Dec 2021 09:42:31 -0500 Subject: [PATCH 1/6] feat(deployment): add `extraEnvVarsMap` --- ndustrial/deployment/Chart.yaml | 4 ++-- ndustrial/deployment/templates/deployment.yaml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ndustrial/deployment/Chart.yaml b/ndustrial/deployment/Chart.yaml index 4c6985b..ca78239 100644 --- a/ndustrial/deployment/Chart.yaml +++ b/ndustrial/deployment/Chart.yaml @@ -12,5 +12,5 @@ maintainers: - email: devops@ndustrial.io name: DevOps # Please make sure that version and appVersion are always the same. -version: 0.1.21 -appVersion: 0.1.21 +version: 0.1.22 +appVersion: 0.1.22 diff --git a/ndustrial/deployment/templates/deployment.yaml b/ndustrial/deployment/templates/deployment.yaml index 3ac0f96..2b6e7ca 100644 --- a/ndustrial/deployment/templates/deployment.yaml +++ b/ndustrial/deployment/templates/deployment.yaml @@ -97,6 +97,12 @@ spec: {{- if .Values.extraEnvVars }} {{- include "nio-common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} {{- end }} + {{- if .Values.extraEnvVarsMap }} + {{- range $key, $val := .Values.extraEnvVarsMap }} + - name: {{ $key }} + value: {{ include "nio-common.tplvalues.render" (dict "value" $key "context" $) | quote }} + {{- end }} + {{- end }} - name: POD_NAMESPACE valueFrom: fieldRef: From b8faa8b08d10b4d6c89a3ddc6f5b6567d21b7582 Mon Sep 17 00:00:00 2001 From: Holden Omans Date: Tue, 4 Jan 2022 12:59:45 -0500 Subject: [PATCH 2/6] Add values.yaml entry for extraEnvVarsMap --- ndustrial/deployment/values.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ndustrial/deployment/values.yaml b/ndustrial/deployment/values.yaml index 299d8eb..9b32011 100644 --- a/ndustrial/deployment/values.yaml +++ b/ndustrial/deployment/values.yaml @@ -372,6 +372,13 @@ shareProcessNamespace: false ## extraEnvVars: [] +## @param extraEnvVarsMap Add extra environment variables to the Deployment container +## E.g: +## extraEnvVarsMap: +## FOO: "bar" +## +extraEnvVarsMap: {} + ## @param extraEnvVarsCM Name of existing ConfigMap containing extra env vars ## extraEnvVarsCM: From 75adbd1e58897570c522c2df0d1b4a63eba7a491 Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Tue, 4 Jan 2022 13:07:59 -0500 Subject: [PATCH 3/6] fix: update readme-generator install --- scripts/gen.sh | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/scripts/gen.sh b/scripts/gen.sh index 6995f9e..550401f 100755 --- a/scripts/gen.sh +++ b/scripts/gen.sh @@ -2,39 +2,25 @@ set -e WORKDIR=$(pwd) -CI_DIR=${WORKDIR}/.ci -README_GEN_BIN=$(which readme-generator) +README_GEN_BIN=$(which readme-generator || true) to_workdir() { - cd ${WORKDIR} + cd "${WORKDIR}" } to_chart_dir() { local chart=$1 - cd ${WORKDIR}/ndustrial/${chart} + cd "${WORKDIR}"/ndustrial/"${chart}" } install_md_gen() { - if [ -d ${CI_DIR} ]; then - mkdir -p ${CI_DIR} - fi - - if [ -d ${CI_DIR}/readme-generator-for-helm ]; then - cd ${CI_DIR} - git clone https://github.com/bitnami-labs/readme-generator-for-helm - cd ${CI_DIR}/readme-generator-for-helm - npm install - cd ${CI_DIR} - npm install -g readme-generator-for-helm - fi - - to_workdir + npm install -g git+https://github.com/bitnami-labs/readme-generator-for-helm #--include=dev } gen_readme() { local chart=$1 echo "Generating README.md for ${chart}" - to_chart_dir ${chart} + to_chart_dir "${chart}" ${README_GEN_BIN} -r ./README.md -v values.yaml to_workdir } @@ -43,13 +29,14 @@ gen_questions() { local chart=$1 echo "Generating questions for ${chart}" - docker run --rm -v $(pwd):/app crystallang/crystal:1.0.0 \ - crystal /app/scripts/question_gen.cr -f /app/ndustrial/${chart}/values.yaml + docker run --rm -v "$(pwd)":/app crystallang/crystal:1.0.0 \ + crystal /app/scripts/question_gen.cr -f /app/ndustrial/"${chart}"/values.yaml } -if [ -z ${README_GEN_BIN} ]; then +if [ -z "${README_GEN_BIN}" ]; then echo "missing readme-generator" install_md_gen + README_GEN_BIN=$(which readme-generator) fi echo "Generating README.md" From cadb087b4813dfe2113de5ad12068e19609a7211 Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Tue, 4 Jan 2022 13:08:14 -0500 Subject: [PATCH 4/6] docs: update --- ndustrial/deployment/README.md | 3 ++- ndustrial/deployment/_var_list.yml | 4 ++++ ndustrial/statefulset/README.md | 16 ++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ndustrial/deployment/README.md b/ndustrial/deployment/README.md index acea25d..c753946 100644 --- a/ndustrial/deployment/README.md +++ b/ndustrial/deployment/README.md @@ -90,7 +90,7 @@ | `ingress.pathType` | Ingress path type | `ImplementationSpecific` | | `ingress.apiVersion` | Force Ingress API version (automatically detected if not set) | `nil` | | `ingress.hostname` | Default host for the ingress record | `chart-example.local` | -| `ingress.path` | Default path for the ingress record | `ImplementationSpecific` | +| `ingress.path` | Default path for the ingress record | `/` | | `ingress.annotations` | Additional custom annotations for the ingress record | `{}` | | `ingress.tls` | Enable TLS configuration for the host defined at `ingress.hostname` parameter | `false` | | `ingress.certManager` | Add the corresponding annotations for cert-manager integration | `false` | @@ -142,6 +142,7 @@ | `lifecycleHooks` | Add lifecycle hooks to the Deployment deployment | `{}` | | `shareProcessNamespace` | Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false. | `false` | | `extraEnvVars` | Add extra environment variables to the Deployment container | `[]` | +| `extraEnvVarsMap` | Add extra environment variables to the Deployment container | `{}` | | `extraEnvVarsCM` | Name of existing ConfigMap containing extra env vars | `nil` | | `extraEnvVarsCMs` | Optionally specify extra list of additional existing ConfigMaps containing extra env vars | `[]` | | `extraEnvVarsSecret` | Name of existing Secret containing extra env vars | `nil` | diff --git a/ndustrial/deployment/_var_list.yml b/ndustrial/deployment/_var_list.yml index ec9cbfe..66b5ba9 100644 --- a/ndustrial/deployment/_var_list.yml +++ b/ndustrial/deployment/_var_list.yml @@ -363,6 +363,10 @@ group: Pod default: [] type: +- variable: extraEnvVarsMap + group: Pod + default: {} + type: - variable: extraEnvVarsCM group: Pod default: diff --git a/ndustrial/statefulset/README.md b/ndustrial/statefulset/README.md index eeb6133..0336015 100644 --- a/ndustrial/statefulset/README.md +++ b/ndustrial/statefulset/README.md @@ -66,13 +66,13 @@ ### persistentVolume parameters -| Name | Description | Value | -| ------------------------------- | ------------------------------------ | ------------- | -| `persistentVolume.enabled` | Enable persistentVolume | `true` | -| `persistentVolume.accessModes` | Storage size of the persistentVolume | `[]` | -| `persistentVolume.storageClass` | StorageClass of the persistentVolume | `""` | -| `persistentVolume.size` | Storage size of the persistentVolume | `400M` | -| `persistentVolume.mountPath` | Mount path of the persistentVolume | `/tmp/volume` | +| Name | Description | Value | +| ------------------------------- | ------------------------------------ | ------------------- | +| `persistentVolume.enabled` | Enable persistentVolume | `true` | +| `persistentVolume.accessModes` | Storage size of the persistentVolume | `["ReadWriteOnce"]` | +| `persistentVolume.storageClass` | StorageClass of the persistentVolume | `""` | +| `persistentVolume.size` | Storage size of the persistentVolume | `400M` | +| `persistentVolume.mountPath` | Mount path of the persistentVolume | `/tmp/volume` | ### Service parameters @@ -101,7 +101,7 @@ | `ingress.pathType` | Ingress path type | `ImplementationSpecific` | | `ingress.apiVersion` | Force Ingress API version (automatically detected if not set) | `nil` | | `ingress.hostname` | Default host for the ingress record | `chart-example.local` | -| `ingress.path` | Default path for the ingress record | `ImplementationSpecific` | +| `ingress.path` | Default path for the ingress record | `/` | | `ingress.annotations` | Additional custom annotations for the ingress record | `{}` | | `ingress.tls` | Enable TLS configuration for the host defined at `ingress.hostname` parameter | `false` | | `ingress.certManager` | Add the corresponding annotations for cert-manager integration | `false` | From 7abea0fc66b89835dc34ca177148f625b6cf6d31 Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Tue, 4 Jan 2022 13:10:35 -0500 Subject: [PATCH 5/6] bump version --- ndustrial/statefulset/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndustrial/statefulset/Chart.yaml b/ndustrial/statefulset/Chart.yaml index 92616c9..908e1a0 100644 --- a/ndustrial/statefulset/Chart.yaml +++ b/ndustrial/statefulset/Chart.yaml @@ -12,5 +12,5 @@ maintainers: - email: devops@ndustrial.io name: DevOps # Please make sure that version and appVersion are always the same. -version: 0.1.20 -appVersion: 0.1.20 +version: 0.1.21 +appVersion: 0.1.21 From d1e5451846ed1cfc24a882197584cb4ca724a527 Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Tue, 4 Jan 2022 13:11:39 -0500 Subject: [PATCH 6/6] clean up --- scripts/gen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gen.sh b/scripts/gen.sh index 550401f..49ab7bd 100755 --- a/scripts/gen.sh +++ b/scripts/gen.sh @@ -14,7 +14,7 @@ to_chart_dir() { } install_md_gen() { - npm install -g git+https://github.com/bitnami-labs/readme-generator-for-helm #--include=dev + npm install -g git+https://github.com/bitnami-labs/readme-generator-for-helm } gen_readme() {