From dd3a70eca5f0883f9a1b5835253e73cd6798ba31 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Wed, 2 Nov 2022 19:21:47 +0200 Subject: [PATCH 01/22] feat(minio): add logsearchapi functionality --- charts/minio/1.6.58/ix_values.yaml | 7 ++++++ .../minio/1.6.58/templates/_logsearchapi.tpl | 22 +++++++++++++++++ charts/minio/1.6.58/templates/_postgres.tpl | 24 +++++++++++++++++++ charts/minio/1.6.58/templates/deployment.yaml | 12 ++++++++++ .../templates/logsearchapi-deployment.yaml | 18 ++++++++++++++ .../1.6.58/templates/logsearchapi-secret.yaml | 15 ++++++++++++ .../1.6.58/templates/postgres-secret.yaml | 17 +++++++++++++ charts/minio/1.6.58/test_values.yaml | 3 +++ 8 files changed, 118 insertions(+) create mode 100644 charts/minio/1.6.58/templates/_logsearchapi.tpl create mode 100644 charts/minio/1.6.58/templates/_postgres.tpl create mode 100644 charts/minio/1.6.58/templates/logsearchapi-deployment.yaml create mode 100644 charts/minio/1.6.58/templates/logsearchapi-secret.yaml create mode 100644 charts/minio/1.6.58/templates/postgres-secret.yaml diff --git a/charts/minio/1.6.58/ix_values.yaml b/charts/minio/1.6.58/ix_values.yaml index 428dc9e15e..1185caf608 100644 --- a/charts/minio/1.6.58/ix_values.yaml +++ b/charts/minio/1.6.58/ix_values.yaml @@ -2,5 +2,12 @@ image: pullPolicy: IfNotPresent repository: minio/minio tag: RELEASE.2022-10-24T18-35-07Z +logsearchapi: + enabled: false + diskCapacityGB: 5 + image: + pullPolicy: IfNotPresent + repository: minio/operator + tag: v4.5.3 runAsGroup: 473 runAsUser: 473 diff --git a/charts/minio/1.6.58/templates/_logsearchapi.tpl b/charts/minio/1.6.58/templates/_logsearchapi.tpl new file mode 100644 index 0000000000..65ec661904 --- /dev/null +++ b/charts/minio/1.6.58/templates/_logsearchapi.tpl @@ -0,0 +1,22 @@ +{{- define "logsearchapi.imageName" -}} +{{- print "minio/operator:v4.5.3" -}} +{{- end -}} + +{{- define "logsearchapi.command" -}} +{{- print "/logsearchapi" -}} +{{- end -}} + +{{- define "logsearchapi.secretName" -}} +{{- print "logsearchapi-details" -}} +{{- end -}} + +{{- define "logsearchapi.envVariableConfiguration" -}} +{{- $envList := list -}} +{{- $secretName := (include "logsearchapi.secretName" .) -}} +{{- $postgresSecretName := (include "postgres.secretName" .) -}} +{{- $envList = mustAppend $envList (dict "name" "MINIO_LOG_QUERY_AUTH_TOKEN" "valueFromSecret" true "secretName" $secretName "secretKey" "queryToken") -}} +{{- $envList = mustAppend $envList (dict "name" "LOGSEARCH_AUDIT_AUTH_TOKEN" "valueFromSecret" true "secretName" $secretName "secretKey" "auditToken") -}} +{{- $envList = mustAppend $envList (dict "name" "LOGSEARCH_PG_CONN_STR" "valueFromSecret" true "secretName" $postgresSecretName "secretKey" "postgresURL") -}} +{{- $envList = mustAppend $envList (dict "name" "LOGSEARCH_DISK_CAPACITY_GB" "value" .Values.logsearchapi.diskCapacityGB) -}} +{{- include "common.containers.environmentVariables" (dict "environmentVariables" $envList) -}} +{{- end -}} diff --git a/charts/minio/1.6.58/templates/_postgres.tpl b/charts/minio/1.6.58/templates/_postgres.tpl new file mode 100644 index 0000000000..039908c79e --- /dev/null +++ b/charts/minio/1.6.58/templates/_postgres.tpl @@ -0,0 +1,24 @@ +{{- define "postgres.imageName" -}} +{{- print "postgres:14.5" -}} +{{- end -}} + +{{- define "postgres.secretName" -}} +{{- print "postgres-details" -}} +{{- end -}} + +{{- define "postgres.dbName" -}} +{{- print "logsearchapi" -}} +{{- end -}} + +{{- define "postgres.dbUser" -}} +{{- print "logsearchapi" -}} +{{- end -}} + +{{- define "postgres.envVariableConfiguration" -}} +{{- $envList := list -}} +{{- $secretName := (include "postgres.secretName" .) -}} +{{- $envList = mustAppend $envList (dict "name" "POSTGRES_USER" "valueFromSecret" true "secretName" $secretName "secretKey" "db_user") -}} +{{- $envList = mustAppend $envList (dict "name" "POSTGRES_DB" "valueFromSecret" true "secretName" $secretName "secretKey" "db_name") -}} +{{- $envList = mustAppend $envList (dict "name" "POSTGRES_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "db_password") -}} +{{- include "common.containers.environmentVariables" (dict "environmentVariables" $envList) -}} +{{- end -}} diff --git a/charts/minio/1.6.58/templates/deployment.yaml b/charts/minio/1.6.58/templates/deployment.yaml index 05d3ebe366..cdcffe80e4 100644 --- a/charts/minio/1.6.58/templates/deployment.yaml +++ b/charts/minio/1.6.58/templates/deployment.yaml @@ -60,6 +60,18 @@ spec: {{ end }} {{ $envList = mustAppend $envList (dict "name" "MINIO_ROOT_USER" "valueFromSecret" true "secretName" $secretName "secretKey" "accesskey") }} {{ $envList = mustAppend $envList (dict "name" "MINIO_ROOT_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey") }} + {{ if .Values.logsearchapi.enabled }} + {{/* + We can put any ID we want here. Just make sure it's unique + It can be rolled on each startup without problems. + */}} + {{ $webhookID := (printf "ix-%v" (randAlphaNum 5)) }} + {{ $logsearchSecretName := (include "logsearchapi.secretName" .) }} + {{ $envList = mustAppend $envList (dict "name" "MINIO_LOG_QUERY_AUTH_TOKEN" "valueFromSecret" true "secretName" $logsearchSecretName "secretKey" "queryToken") }} + {{ $envList = mustAppend $envList (dict "name" "MINIO_LOG_QUERY_URL" "value" "http://localhost:8080") }} + {{ $envList = mustAppend $envList (dict "name" (printf "MINIO_AUDIT_WEBHOOK_ENDPOINT_%v" $webhookID) "valueFromSecret" true "secretName" $logsearchSecretName "secretKey" "webhookURL") }} + {{ $envList = mustAppend $envList (dict "name" (printf "MINIO_AUDIT_WEBHOOK_ENABLE_%v" $webhookID) "value" "on") }} + {{ end }} {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }} {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }} volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} diff --git a/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml b/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml new file mode 100644 index 0000000000..f5a8cf62ab --- /dev/null +++ b/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml @@ -0,0 +1,18 @@ +{{ if .Values.logsearchapi.enabled }} +{{ $values := (. | mustDeepCopy) }} +{{ $_ := set $values "common" (dict "nameSuffix" "logsearchapi") }} +{{ include "common.deployment.common_config" $values | nindent 0 }} +spec: {{ include "common.deployment.common_spec" $values | nindent 2 }} + template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }} + spec: + containers: + - name: {{ .Chart.Name }}-logsearchapi + image: {{ include "logsearchapi.imageName" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: {{ include "logsearchapi.envVariableConfiguration" $values | nindent 10 }} + command: {{ include "logsearchapi.command" . }} + ports: + - name: logsearchapi + containerPort: 8080 + protocol: TCP +{{ end }} diff --git a/charts/minio/1.6.58/templates/logsearchapi-secret.yaml b/charts/minio/1.6.58/templates/logsearchapi-secret.yaml new file mode 100644 index 0000000000..89d797e2cd --- /dev/null +++ b/charts/minio/1.6.58/templates/logsearchapi-secret.yaml @@ -0,0 +1,15 @@ +{{ if .Values.logsearchapi.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "logsearchapi.secretName" . }} +data: + {{/* + Those are passed to environment variables, which sets everything on startup + There is no need to remember previously created secrets. + */}} + {{ $auditToken := randAlphaNum 32 }} + auditToken: {{ $auditToken | b64enc }} + queryToken: {{ randAlphaNum 32 | b64enc }} + webhookURL: {{ (printf "http://localhost:8080/api/ingest?token=%v" $auditToken) | b64enc }} +{{ end }} diff --git a/charts/minio/1.6.58/templates/postgres-secret.yaml b/charts/minio/1.6.58/templates/postgres-secret.yaml new file mode 100644 index 0000000000..2c2cce2852 --- /dev/null +++ b/charts/minio/1.6.58/templates/postgres-secret.yaml @@ -0,0 +1,17 @@ +{{ if .Values.logsearchapi.enabled }} +{{ $dbPass := randAlphaNum 32 | b64enc }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "postgres.secretName" . }} +data: + db_user: {{ include "postgres.dbUser" . }} + db_name: {{ include "postgres.dbName" . }} + {{ with (lookup "v1" "Secret" .Release.Namespace (include "postgres.secretName" .)) }} + {{ $dbPass = (index .data "db_password") }} + db_password: {{ $dbPass }} + {{ else }} + db_password: {{ $dbPass }} + {{ end }} + postgresURL: {{ printf "postgres://%v:%v:5432/%v?sslmode=disable" (include "postgres.dbUser" .) ($dbPass | b64dec) (include "postgres.dbName" .) }} +{{ end }} diff --git a/charts/minio/1.6.58/test_values.yaml b/charts/minio/1.6.58/test_values.yaml index 01691c449a..c519bdcee0 100644 --- a/charts/minio/1.6.58/test_values.yaml +++ b/charts/minio/1.6.58/test_values.yaml @@ -14,6 +14,9 @@ image: pullPolicy: IfNotPresent repository: minio/minio tag: RELEASE.2022-10-24T18-35-07Z +logsearchapi: + enabled: true + diskCapacityGB: 5 minioDomain: null runAsGroup: 473 runAsUser: 473 From 7cddad890333606b0f40e5a7ec8f2323195a1bac Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Wed, 2 Nov 2022 19:39:41 +0200 Subject: [PATCH 02/22] fix host in URLs, replace hardcoded suffix with template add services --- charts/minio/1.6.58/templates/_logsearchapi.tpl | 6 +++++- charts/minio/1.6.58/templates/_postgres.tpl | 4 ++++ charts/minio/1.6.58/templates/deployment.yaml | 2 +- charts/minio/1.6.58/templates/logsearchapi-deployment.yaml | 2 +- charts/minio/1.6.58/templates/logsearchapi-secret.yaml | 5 ++++- charts/minio/1.6.58/templates/logsearchapi-service.yaml | 6 ++++++ charts/minio/1.6.58/templates/postgres-secret.yaml | 4 +++- charts/minio/1.6.58/templates/postgres-service.yaml | 6 ++++++ 8 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 charts/minio/1.6.58/templates/logsearchapi-service.yaml create mode 100644 charts/minio/1.6.58/templates/postgres-service.yaml diff --git a/charts/minio/1.6.58/templates/_logsearchapi.tpl b/charts/minio/1.6.58/templates/_logsearchapi.tpl index 65ec661904..daa060ebd5 100644 --- a/charts/minio/1.6.58/templates/_logsearchapi.tpl +++ b/charts/minio/1.6.58/templates/_logsearchapi.tpl @@ -2,6 +2,10 @@ {{- print "minio/operator:v4.5.3" -}} {{- end -}} +{{- define "logsearchapi.nameSuffix" -}} +{{- print "logsearchapi" -}} +{{- end -}} + {{- define "logsearchapi.command" -}} {{- print "/logsearchapi" -}} {{- end -}} @@ -16,7 +20,7 @@ {{- $postgresSecretName := (include "postgres.secretName" .) -}} {{- $envList = mustAppend $envList (dict "name" "MINIO_LOG_QUERY_AUTH_TOKEN" "valueFromSecret" true "secretName" $secretName "secretKey" "queryToken") -}} {{- $envList = mustAppend $envList (dict "name" "LOGSEARCH_AUDIT_AUTH_TOKEN" "valueFromSecret" true "secretName" $secretName "secretKey" "auditToken") -}} -{{- $envList = mustAppend $envList (dict "name" "LOGSEARCH_PG_CONN_STR" "valueFromSecret" true "secretName" $postgresSecretName "secretKey" "postgresURL") -}} +{{- $envList = mustAppend $envList (dict "name" "LOGSEARCH_PG_CONN_STR" "valueFromSecret" true "secretName" $secretName "secretKey" "postgresURL") -}} {{- $envList = mustAppend $envList (dict "name" "LOGSEARCH_DISK_CAPACITY_GB" "value" .Values.logsearchapi.diskCapacityGB) -}} {{- include "common.containers.environmentVariables" (dict "environmentVariables" $envList) -}} {{- end -}} diff --git a/charts/minio/1.6.58/templates/_postgres.tpl b/charts/minio/1.6.58/templates/_postgres.tpl index 039908c79e..af26a05f6b 100644 --- a/charts/minio/1.6.58/templates/_postgres.tpl +++ b/charts/minio/1.6.58/templates/_postgres.tpl @@ -2,6 +2,10 @@ {{- print "postgres:14.5" -}} {{- end -}} +{{- define "postgres.nameSuffix" -}} +{{- print "postgres" -}} +{{- end -}} + {{- define "postgres.secretName" -}} {{- print "postgres-details" -}} {{- end -}} diff --git a/charts/minio/1.6.58/templates/deployment.yaml b/charts/minio/1.6.58/templates/deployment.yaml index cdcffe80e4..b60d9faff9 100644 --- a/charts/minio/1.6.58/templates/deployment.yaml +++ b/charts/minio/1.6.58/templates/deployment.yaml @@ -68,7 +68,7 @@ spec: {{ $webhookID := (printf "ix-%v" (randAlphaNum 5)) }} {{ $logsearchSecretName := (include "logsearchapi.secretName" .) }} {{ $envList = mustAppend $envList (dict "name" "MINIO_LOG_QUERY_AUTH_TOKEN" "valueFromSecret" true "secretName" $logsearchSecretName "secretKey" "queryToken") }} - {{ $envList = mustAppend $envList (dict "name" "MINIO_LOG_QUERY_URL" "value" "http://localhost:8080") }} + {{ $envList = mustAppend $envList (dict "name" "MINIO_LOG_QUERY_URL" "valueFromSecret" true "secretName" $logsearchSecretName "secretKey" "logQueryURL") }} {{ $envList = mustAppend $envList (dict "name" (printf "MINIO_AUDIT_WEBHOOK_ENDPOINT_%v" $webhookID) "valueFromSecret" true "secretName" $logsearchSecretName "secretKey" "webhookURL") }} {{ $envList = mustAppend $envList (dict "name" (printf "MINIO_AUDIT_WEBHOOK_ENABLE_%v" $webhookID) "value" "on") }} {{ end }} diff --git a/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml b/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml index f5a8cf62ab..b7a4854fc4 100644 --- a/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml +++ b/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml @@ -1,6 +1,6 @@ {{ if .Values.logsearchapi.enabled }} {{ $values := (. | mustDeepCopy) }} -{{ $_ := set $values "common" (dict "nameSuffix" "logsearchapi") }} +{{ $_ := set $values "common" (dict "nameSuffix" (include "logsearchapi.nameSuffix" .)) }} {{ include "common.deployment.common_config" $values | nindent 0 }} spec: {{ include "common.deployment.common_spec" $values | nindent 2 }} template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }} diff --git a/charts/minio/1.6.58/templates/logsearchapi-secret.yaml b/charts/minio/1.6.58/templates/logsearchapi-secret.yaml index 89d797e2cd..2ae0021637 100644 --- a/charts/minio/1.6.58/templates/logsearchapi-secret.yaml +++ b/charts/minio/1.6.58/templates/logsearchapi-secret.yaml @@ -1,4 +1,6 @@ {{ if .Values.logsearchapi.enabled }} +{{ $logSearchValues := (. | mustDeepCopy) }} +{{ $_ := set $logSearchValues "common" (dict "nameSuffix" (include "logsearchapi.nameSuffix" .)) }} apiVersion: v1 kind: Secret metadata: @@ -11,5 +13,6 @@ data: {{ $auditToken := randAlphaNum 32 }} auditToken: {{ $auditToken | b64enc }} queryToken: {{ randAlphaNum 32 | b64enc }} - webhookURL: {{ (printf "http://localhost:8080/api/ingest?token=%v" $auditToken) | b64enc }} + logQueryURL: {{ (printf "http://%v:8080" (include "common.names.fullname" $logSearchValues)) | b64enc }} + webhookURL: {{ (printf "http://%v:8080/api/ingest?token=%v" (include "common.names.fullname" $logSearchValues) $auditToken) | b64enc }} {{ end }} diff --git a/charts/minio/1.6.58/templates/logsearchapi-service.yaml b/charts/minio/1.6.58/templates/logsearchapi-service.yaml new file mode 100644 index 0000000000..f9db1a86cf --- /dev/null +++ b/charts/minio/1.6.58/templates/logsearchapi-service.yaml @@ -0,0 +1,6 @@ +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "logsearchapi-tcp" "port" 8080 "targetPort" 8080) }} +{{ $values := (. | mustDeepCopy) }} +{{ $_ := set $values "common" (dict "nameSuffix" (include "logsearchapi.nameSuffix" .)) }} +{{ $_1 := set $values "commonService" (dict "type" "ClusterIP" "ports" $ports ) }} +{{ include "common.classes.service" $values }} diff --git a/charts/minio/1.6.58/templates/postgres-secret.yaml b/charts/minio/1.6.58/templates/postgres-secret.yaml index 2c2cce2852..fad28dfc65 100644 --- a/charts/minio/1.6.58/templates/postgres-secret.yaml +++ b/charts/minio/1.6.58/templates/postgres-secret.yaml @@ -1,5 +1,7 @@ {{ if .Values.logsearchapi.enabled }} {{ $dbPass := randAlphaNum 32 | b64enc }} +{{ $pgValues := (. | mustDeepCopy) }} +{{ $_ := set $pgValues "common" (dict "nameSuffix" (include "postgres.nameSuffix" .)) }} apiVersion: v1 kind: Secret metadata: @@ -13,5 +15,5 @@ data: {{ else }} db_password: {{ $dbPass }} {{ end }} - postgresURL: {{ printf "postgres://%v:%v:5432/%v?sslmode=disable" (include "postgres.dbUser" .) ($dbPass | b64dec) (include "postgres.dbName" .) }} + postgresURL: {{ printf "postgres://%v:%v@%v:5432/%v?sslmode=disable" (include "postgres.dbUser" .) ($dbPass | b64dec) (include "common.names.fullname" $pgValues) (include "postgres.dbName" .) }} {{ end }} diff --git a/charts/minio/1.6.58/templates/postgres-service.yaml b/charts/minio/1.6.58/templates/postgres-service.yaml new file mode 100644 index 0000000000..2bdb1e8a97 --- /dev/null +++ b/charts/minio/1.6.58/templates/postgres-service.yaml @@ -0,0 +1,6 @@ +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "postgres-tcp" "port" 5432 "targetPort" 5432) }} +{{ $values := (. | mustDeepCopy) }} +{{ $_ := set $values "common" (dict "nameSuffix" (include "postgres.nameSuffix" .)) }} +{{ $_1 := set $values "commonService" (dict "type" "ClusterIP" "ports" $ports ) }} +{{ include "common.classes.service" $values }} From 125a55fc84bf8d1f98e242cf6d778413a30c7754 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Wed, 2 Nov 2022 19:44:36 +0200 Subject: [PATCH 03/22] encode postgresURL --- charts/minio/1.6.58/templates/postgres-secret.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/minio/1.6.58/templates/postgres-secret.yaml b/charts/minio/1.6.58/templates/postgres-secret.yaml index fad28dfc65..27ad246778 100644 --- a/charts/minio/1.6.58/templates/postgres-secret.yaml +++ b/charts/minio/1.6.58/templates/postgres-secret.yaml @@ -15,5 +15,5 @@ data: {{ else }} db_password: {{ $dbPass }} {{ end }} - postgresURL: {{ printf "postgres://%v:%v@%v:5432/%v?sslmode=disable" (include "postgres.dbUser" .) ($dbPass | b64dec) (include "common.names.fullname" $pgValues) (include "postgres.dbName" .) }} + postgresURL: {{ printf "postgres://%v:%v@%v:5432/%v?sslmode=disable" (include "postgres.dbUser" .) ($dbPass | b64dec) (include "common.names.fullname" $pgValues) (include "postgres.dbName" .) | b64enc }} {{ end }} From 7bd6b303166cbba11b72a585c69ae3c404812364 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Wed, 2 Nov 2022 20:06:14 +0200 Subject: [PATCH 04/22] add probes to logsearchapi --- .../templates/logsearchapi-deployment.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml b/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml index b7a4854fc4..6a8d6f49bc 100644 --- a/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml +++ b/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml @@ -15,4 +15,25 @@ spec: {{ include "common.deployment.common_spec" $values | nindent 2 }} - name: logsearchapi containerPort: 8080 protocol: TCP + readinessProbe: + httpGet: + path: /status + port: 8080 + failureThreshold: 5 + periodSeconds: 15 + initialDelaySeconds: 15 + livenessProbe: + httpGet: + path: /status + port: 8080 + failureThreshold: 5 + periodSeconds: 15 + initialDelaySeconds: 15 + startupProbe: + httpGet: + path: /status + port: 8080 + failureThreshold: 5 + periodSeconds: 15 + initialDelaySeconds: 15 {{ end }} From cbed2b78a5f54c421003cf76494ef4ce2cd79c42 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Wed, 2 Nov 2022 20:07:37 +0200 Subject: [PATCH 05/22] bump versions --- charts/minio/{1.6.58 => 1.7.0}/.helmignore | 0 charts/minio/{1.6.58 => 1.7.0}/CHANGELOG.md | 0 charts/minio/{1.6.58 => 1.7.0}/Chart.yaml | 2 +- charts/minio/{1.6.58 => 1.7.0}/README.md | 0 charts/minio/{1.6.58 => 1.7.0}/app-readme.md | 0 .../{1.6.58 => 1.7.0}/charts/common-2207.0.0.tgz | Bin charts/minio/{1.6.58 => 1.7.0}/ix_values.yaml | 0 charts/minio/{1.6.58 => 1.7.0}/migrations/migrate | 0 .../{1.6.58 => 1.7.0}/migrations/migrate_from_1.0.0 | 0 charts/minio/{1.6.58 => 1.7.0}/questions.yaml | 0 charts/minio/{1.6.58 => 1.7.0}/requirements.lock | 0 charts/minio/{1.6.58 => 1.7.0}/templates/NOTES.txt | 0 charts/minio/{1.6.58 => 1.7.0}/templates/_cert.tpl | 0 .../minio/{1.6.58 => 1.7.0}/templates/_helpers.tpl | 0 .../{1.6.58 => 1.7.0}/templates/_logsearchapi.tpl | 0 .../minio/{1.6.58 => 1.7.0}/templates/_postgres.tpl | 0 .../{1.6.58 => 1.7.0}/templates/configmap.yaml | 0 .../{1.6.58 => 1.7.0}/templates/deployment.yaml | 0 .../templates/logsearchapi-deployment.yaml | 0 .../templates/logsearchapi-secret.yaml | 0 .../templates/logsearchapi-service.yaml | 0 .../templates/postgres-secret.yaml | 0 .../templates/postgres-service.yaml | 0 .../templates/pre-install-job.yaml | 0 .../minio/{1.6.58 => 1.7.0}/templates/secrets.yaml | 0 .../minio/{1.6.58 => 1.7.0}/templates/service.yaml | 0 .../{1.6.58 => 1.7.0}/templates/serviceaccount.yaml | 0 .../templates/tests/deployment-check.yaml | 0 charts/minio/{1.6.58 => 1.7.0}/test_values.yaml | 0 29 files changed, 1 insertion(+), 1 deletion(-) rename charts/minio/{1.6.58 => 1.7.0}/.helmignore (100%) rename charts/minio/{1.6.58 => 1.7.0}/CHANGELOG.md (100%) rename charts/minio/{1.6.58 => 1.7.0}/Chart.yaml (96%) rename charts/minio/{1.6.58 => 1.7.0}/README.md (100%) rename charts/minio/{1.6.58 => 1.7.0}/app-readme.md (100%) rename charts/minio/{1.6.58 => 1.7.0}/charts/common-2207.0.0.tgz (100%) rename charts/minio/{1.6.58 => 1.7.0}/ix_values.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/migrations/migrate (100%) rename charts/minio/{1.6.58 => 1.7.0}/migrations/migrate_from_1.0.0 (100%) rename charts/minio/{1.6.58 => 1.7.0}/questions.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/requirements.lock (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/NOTES.txt (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/_cert.tpl (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/_helpers.tpl (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/_logsearchapi.tpl (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/_postgres.tpl (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/configmap.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/deployment.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/logsearchapi-deployment.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/logsearchapi-secret.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/logsearchapi-service.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/postgres-secret.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/postgres-service.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/pre-install-job.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/secrets.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/service.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/serviceaccount.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/templates/tests/deployment-check.yaml (100%) rename charts/minio/{1.6.58 => 1.7.0}/test_values.yaml (100%) diff --git a/charts/minio/1.6.58/.helmignore b/charts/minio/1.7.0/.helmignore similarity index 100% rename from charts/minio/1.6.58/.helmignore rename to charts/minio/1.7.0/.helmignore diff --git a/charts/minio/1.6.58/CHANGELOG.md b/charts/minio/1.7.0/CHANGELOG.md similarity index 100% rename from charts/minio/1.6.58/CHANGELOG.md rename to charts/minio/1.7.0/CHANGELOG.md diff --git a/charts/minio/1.6.58/Chart.yaml b/charts/minio/1.7.0/Chart.yaml similarity index 96% rename from charts/minio/1.6.58/Chart.yaml rename to charts/minio/1.7.0/Chart.yaml index 81a5b20f67..aef01954c6 100644 --- a/charts/minio/1.6.58/Chart.yaml +++ b/charts/minio/1.7.0/Chart.yaml @@ -16,4 +16,4 @@ sources: - https://github.com/minio/minio - https://github.com/minio/charts upstream_version: 8.0.5 -version: 1.6.58 +version: 1.7.0 diff --git a/charts/minio/1.6.58/README.md b/charts/minio/1.7.0/README.md similarity index 100% rename from charts/minio/1.6.58/README.md rename to charts/minio/1.7.0/README.md diff --git a/charts/minio/1.6.58/app-readme.md b/charts/minio/1.7.0/app-readme.md similarity index 100% rename from charts/minio/1.6.58/app-readme.md rename to charts/minio/1.7.0/app-readme.md diff --git a/charts/minio/1.6.58/charts/common-2207.0.0.tgz b/charts/minio/1.7.0/charts/common-2207.0.0.tgz similarity index 100% rename from charts/minio/1.6.58/charts/common-2207.0.0.tgz rename to charts/minio/1.7.0/charts/common-2207.0.0.tgz diff --git a/charts/minio/1.6.58/ix_values.yaml b/charts/minio/1.7.0/ix_values.yaml similarity index 100% rename from charts/minio/1.6.58/ix_values.yaml rename to charts/minio/1.7.0/ix_values.yaml diff --git a/charts/minio/1.6.58/migrations/migrate b/charts/minio/1.7.0/migrations/migrate similarity index 100% rename from charts/minio/1.6.58/migrations/migrate rename to charts/minio/1.7.0/migrations/migrate diff --git a/charts/minio/1.6.58/migrations/migrate_from_1.0.0 b/charts/minio/1.7.0/migrations/migrate_from_1.0.0 similarity index 100% rename from charts/minio/1.6.58/migrations/migrate_from_1.0.0 rename to charts/minio/1.7.0/migrations/migrate_from_1.0.0 diff --git a/charts/minio/1.6.58/questions.yaml b/charts/minio/1.7.0/questions.yaml similarity index 100% rename from charts/minio/1.6.58/questions.yaml rename to charts/minio/1.7.0/questions.yaml diff --git a/charts/minio/1.6.58/requirements.lock b/charts/minio/1.7.0/requirements.lock similarity index 100% rename from charts/minio/1.6.58/requirements.lock rename to charts/minio/1.7.0/requirements.lock diff --git a/charts/minio/1.6.58/templates/NOTES.txt b/charts/minio/1.7.0/templates/NOTES.txt similarity index 100% rename from charts/minio/1.6.58/templates/NOTES.txt rename to charts/minio/1.7.0/templates/NOTES.txt diff --git a/charts/minio/1.6.58/templates/_cert.tpl b/charts/minio/1.7.0/templates/_cert.tpl similarity index 100% rename from charts/minio/1.6.58/templates/_cert.tpl rename to charts/minio/1.7.0/templates/_cert.tpl diff --git a/charts/minio/1.6.58/templates/_helpers.tpl b/charts/minio/1.7.0/templates/_helpers.tpl similarity index 100% rename from charts/minio/1.6.58/templates/_helpers.tpl rename to charts/minio/1.7.0/templates/_helpers.tpl diff --git a/charts/minio/1.6.58/templates/_logsearchapi.tpl b/charts/minio/1.7.0/templates/_logsearchapi.tpl similarity index 100% rename from charts/minio/1.6.58/templates/_logsearchapi.tpl rename to charts/minio/1.7.0/templates/_logsearchapi.tpl diff --git a/charts/minio/1.6.58/templates/_postgres.tpl b/charts/minio/1.7.0/templates/_postgres.tpl similarity index 100% rename from charts/minio/1.6.58/templates/_postgres.tpl rename to charts/minio/1.7.0/templates/_postgres.tpl diff --git a/charts/minio/1.6.58/templates/configmap.yaml b/charts/minio/1.7.0/templates/configmap.yaml similarity index 100% rename from charts/minio/1.6.58/templates/configmap.yaml rename to charts/minio/1.7.0/templates/configmap.yaml diff --git a/charts/minio/1.6.58/templates/deployment.yaml b/charts/minio/1.7.0/templates/deployment.yaml similarity index 100% rename from charts/minio/1.6.58/templates/deployment.yaml rename to charts/minio/1.7.0/templates/deployment.yaml diff --git a/charts/minio/1.6.58/templates/logsearchapi-deployment.yaml b/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml similarity index 100% rename from charts/minio/1.6.58/templates/logsearchapi-deployment.yaml rename to charts/minio/1.7.0/templates/logsearchapi-deployment.yaml diff --git a/charts/minio/1.6.58/templates/logsearchapi-secret.yaml b/charts/minio/1.7.0/templates/logsearchapi-secret.yaml similarity index 100% rename from charts/minio/1.6.58/templates/logsearchapi-secret.yaml rename to charts/minio/1.7.0/templates/logsearchapi-secret.yaml diff --git a/charts/minio/1.6.58/templates/logsearchapi-service.yaml b/charts/minio/1.7.0/templates/logsearchapi-service.yaml similarity index 100% rename from charts/minio/1.6.58/templates/logsearchapi-service.yaml rename to charts/minio/1.7.0/templates/logsearchapi-service.yaml diff --git a/charts/minio/1.6.58/templates/postgres-secret.yaml b/charts/minio/1.7.0/templates/postgres-secret.yaml similarity index 100% rename from charts/minio/1.6.58/templates/postgres-secret.yaml rename to charts/minio/1.7.0/templates/postgres-secret.yaml diff --git a/charts/minio/1.6.58/templates/postgres-service.yaml b/charts/minio/1.7.0/templates/postgres-service.yaml similarity index 100% rename from charts/minio/1.6.58/templates/postgres-service.yaml rename to charts/minio/1.7.0/templates/postgres-service.yaml diff --git a/charts/minio/1.6.58/templates/pre-install-job.yaml b/charts/minio/1.7.0/templates/pre-install-job.yaml similarity index 100% rename from charts/minio/1.6.58/templates/pre-install-job.yaml rename to charts/minio/1.7.0/templates/pre-install-job.yaml diff --git a/charts/minio/1.6.58/templates/secrets.yaml b/charts/minio/1.7.0/templates/secrets.yaml similarity index 100% rename from charts/minio/1.6.58/templates/secrets.yaml rename to charts/minio/1.7.0/templates/secrets.yaml diff --git a/charts/minio/1.6.58/templates/service.yaml b/charts/minio/1.7.0/templates/service.yaml similarity index 100% rename from charts/minio/1.6.58/templates/service.yaml rename to charts/minio/1.7.0/templates/service.yaml diff --git a/charts/minio/1.6.58/templates/serviceaccount.yaml b/charts/minio/1.7.0/templates/serviceaccount.yaml similarity index 100% rename from charts/minio/1.6.58/templates/serviceaccount.yaml rename to charts/minio/1.7.0/templates/serviceaccount.yaml diff --git a/charts/minio/1.6.58/templates/tests/deployment-check.yaml b/charts/minio/1.7.0/templates/tests/deployment-check.yaml similarity index 100% rename from charts/minio/1.6.58/templates/tests/deployment-check.yaml rename to charts/minio/1.7.0/templates/tests/deployment-check.yaml diff --git a/charts/minio/1.6.58/test_values.yaml b/charts/minio/1.7.0/test_values.yaml similarity index 100% rename from charts/minio/1.6.58/test_values.yaml rename to charts/minio/1.7.0/test_values.yaml From dc7889d8e020f92343915eeaab0d3df5fbb170b3 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Wed, 2 Nov 2022 20:19:48 +0200 Subject: [PATCH 06/22] update container name --- charts/minio/1.7.0/templates/logsearchapi-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml b/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml index 6a8d6f49bc..0084232fc3 100644 --- a/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml +++ b/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml @@ -6,7 +6,7 @@ spec: {{ include "common.deployment.common_spec" $values | nindent 2 }} template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }} spec: containers: - - name: {{ .Chart.Name }}-logsearchapi + - name: {{ .Chart.Name }}-{{ include "logsearchapi.nameSuffix" . }} image: {{ include "logsearchapi.imageName" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} env: {{ include "logsearchapi.envVariableConfiguration" $values | nindent 10 }} From d83df67347aeea1595290ffb4266a18194b63550 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Wed, 2 Nov 2022 20:43:55 +0200 Subject: [PATCH 07/22] add postgres deployment --- charts/minio/1.7.0/templates/_postgres.tpl | 14 ++++++ .../1.7.0/templates/postgres-deployment.yaml | 47 +++++++++++++++++++ charts/minio/1.7.0/test_values.yaml | 14 ++++++ 3 files changed, 75 insertions(+) create mode 100644 charts/minio/1.7.0/templates/postgres-deployment.yaml diff --git a/charts/minio/1.7.0/templates/_postgres.tpl b/charts/minio/1.7.0/templates/_postgres.tpl index af26a05f6b..01be54d6ae 100644 --- a/charts/minio/1.7.0/templates/_postgres.tpl +++ b/charts/minio/1.7.0/templates/_postgres.tpl @@ -26,3 +26,17 @@ {{- $envList = mustAppend $envList (dict "name" "POSTGRES_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "db_password") -}} {{- include "common.containers.environmentVariables" (dict "environmentVariables" $envList) -}} {{- end -}} + +{{/* +Retrieve postgres volume configuration +*/}} +{{- define "postgres.volumeConfiguration" -}} +{{ include "common.storage.configureAppVolumes" (dict "appVolumeMounts" .Values.postgresAppVolumeMounts "emptyDirVolumes" .Values.emptyDirVolumes "ixVolumes" .Values.ixVolumes) | nindent 0 }} +{{- end -}} + +{{/* +Retrieve postgres volume mounts configuration +*/}} +{{- define "postgres.volumeMountsConfiguration" -}} +{{ include "common.storage.configureAppVolumeMountsInContainer" (dict "appVolumeMounts" .Values.postgresql ) | nindent 0 }} +{{- end -}} diff --git a/charts/minio/1.7.0/templates/postgres-deployment.yaml b/charts/minio/1.7.0/templates/postgres-deployment.yaml new file mode 100644 index 0000000000..22d5c28d37 --- /dev/null +++ b/charts/minio/1.7.0/templates/postgres-deployment.yaml @@ -0,0 +1,47 @@ +{{ $values := (. | mustDeepCopy) }} +{{ $_ := set $values "common" (dict "nameSuffix" (include "postgres.nameSuffix" .)) }} +{{ include "common.deployment.common_config" $values | nindent 0 }} +spec: {{ include "common.deployment.common_spec" $values | nindent 2 }} + template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }} + spec: + containers: + - name: {{ .Chart.Name }}-{{ include "postgres.nameSuffix" .}} + image: {{ template "postgres.imageName" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }} + volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }} + ports: + - name: postgres-tcp + containerPort: 5432 + protocol: TCP + readinessProbe: + exec: + command: + - sh + - -c + - "until pg_isready -U${POSTGRES_USER} -h localhost; do sleep 2; done" + initialDelaySeconds: 15 + failureThreshold: 5 + periodSeconds: 15 + timeoutSeconds: 2 + livenessProbe: + exec: + command: + - sh + - -c + - "until pg_isready -U${POSTGRES_USER} -h localhost; do sleep 2; done" + initialDelaySeconds: 15 + failureThreshold: 5 + periodSeconds: 15 + timeoutSeconds: 2 + startupProbe: + exec: + command: + - sh + - -c + - "until pg_isready -U${POSTGRES_USER} -h localhost; do sleep 2; done" + initialDelaySeconds: 15 + failureThreshold: 20 + periodSeconds: 15 + timeoutSeconds: 2 + volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }} diff --git a/charts/minio/1.7.0/test_values.yaml b/charts/minio/1.7.0/test_values.yaml index c519bdcee0..47c5943db1 100644 --- a/charts/minio/1.7.0/test_values.yaml +++ b/charts/minio/1.7.0/test_values.yaml @@ -2,6 +2,20 @@ appVolumeMounts: export: emptyDir: true mountPath: /export +postgresAppVolumeMounts: + postgres-backup: + emptyDir: true + mountPath: /postgres_backups + postgres-data: + emptyDir: true + mountPath: /var/lib/postgresql/data +postgresql: + backupVolume: + datasetName: ix-postgres_backups + mountPath: /postgres_backups + dataVolume: + datasetName: ix-postgres_data + mountPath: /var/lib/postgresql/data distributedIps: [] distributedMode: false dnsConfig: From 6809e1632d8df019c794b3b17b85d52692265c81 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 3 Nov 2022 01:15:50 +0200 Subject: [PATCH 08/22] add postgres job and update questions --- charts/minio/1.7.0/questions.yaml | 101 ++++++++++++++++++ charts/minio/1.7.0/templates/_postgres.tpl | 9 ++ .../templates/backup-postgres-config.yaml | 15 +++ .../1.7.0/templates/backup-postgres-hook.yaml | 38 +++++++ charts/minio/1.7.0/test_values.yaml | 1 + 5 files changed, 164 insertions(+) create mode 100644 charts/minio/1.7.0/templates/backup-postgres-config.yaml create mode 100644 charts/minio/1.7.0/templates/backup-postgres-hook.yaml diff --git a/charts/minio/1.7.0/questions.yaml b/charts/minio/1.7.0/questions.yaml index 54b54b30b4..259fde747f 100644 --- a/charts/minio/1.7.0/questions.yaml +++ b/charts/minio/1.7.0/questions.yaml @@ -184,6 +184,28 @@ questions: $ref: - "definitions/certificate" + - variable: logsearchapi + label: Log Search API Configuration + description: Log Search API Configuration + group: Minio Configuration + schema: + type: dict + additional_attrs: true + attrs: + - variable: enabled + label: Enable Log Search API + description: Enables Log Search API and configures MinIO to use it. It also deploys a postgres DB for it. + schema: + type: boolean + default: false + - variable: diskCapacityGB + label: Disk Capacity in GB + description: Capacity in GB that logs are allowed to occupy. + schema: + type: int + show_if: [["enabled", "=", true]] + default: 5 + - variable: appVolumeMounts label: "Minio Storage" group: "Storage" @@ -252,6 +274,85 @@ questions: type: hostpath required: true + - variable: postgresAppVolumeMounts + label: Postgres Storage + group: Storage + schema: + type: dict + attrs: + - variable: postgres-data + label: Postgres Data Volume + schema: + type: dict + attrs: + - variable: datasetName + label: Postgres Data Volume Name + schema: + type: string + hidden: true + $ref: + - normalize/ixVolume + default: ix-postgres_data + show_if: [["hostPathEnabled", "=", false]] + editable: false + + - variable: mountPath + label: Postgresql Data Mount Path + description: Path where the volume will be mounted inside the pod + schema: + type: path + hidden: true + editable: false + default: /var/lib/postgresql/data + - variable: hostPathEnabled + label: Enable Host Path for Postgres Data Volume + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: Host Path for Postgres Data Volume + schema: + type: hostpath + required: true + + - variable: postgres-backup + label: Postgres Backup Volume + schema: + type: dict + attrs: + - variable: datasetName + label: Postgres Backup Volume Name + schema: + type: string + hidden: true + $ref: + - normalize/ixVolume + default: ix-postgres_backups + show_if: [["hostPathEnabled", "=", false]] + editable: false + - variable: mountPath + label: Postgresql Backup Mount Path + description: Path where the volume will be mounted inside the pod + schema: + type: path + hidden: true + editable: false + default: /postgres_backups + - variable: hostPathEnabled + label: Enable Host Path for Postgres Backup Volume + schema: + type: boolean + default: false + show_subquestions_if: true + subquestions: + - variable: hostPath + label: Host Path for Postgres Backup Volume + schema: + type: hostpath + required: true + - variable: enableResourceLimits label: "Enable Pod resource limits" group: "Resource Limits" diff --git a/charts/minio/1.7.0/templates/_postgres.tpl b/charts/minio/1.7.0/templates/_postgres.tpl index 01be54d6ae..e90c3a83a3 100644 --- a/charts/minio/1.7.0/templates/_postgres.tpl +++ b/charts/minio/1.7.0/templates/_postgres.tpl @@ -18,6 +18,15 @@ {{- print "logsearchapi" -}} {{- end -}} +{{/* +Retrieve postgres backup name +This will return a unique name based on revision and chart numbers specified. +*/}} +{{- define "postgres.backupName" -}} +{{- $upgradeDict := .Values.ixChartContext.upgradeMetadata -}} +{{- printf "postgres-backup-from-%s-to-%s-revision-%d" $upgradeDict.oldChartVersion $upgradeDict.newChartVersion (int64 $upgradeDict.preUpgradeRevision) -}} +{{- end -}} + {{- define "postgres.envVariableConfiguration" -}} {{- $envList := list -}} {{- $secretName := (include "postgres.secretName" .) -}} diff --git a/charts/minio/1.7.0/templates/backup-postgres-config.yaml b/charts/minio/1.7.0/templates/backup-postgres-config.yaml new file mode 100644 index 0000000000..d3ddec6294 --- /dev/null +++ b/charts/minio/1.7.0/templates/backup-postgres-config.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: postgres-backup-hook-config-map + annotations: + rollme: {{ randAlphaNum 5 | quote }} +data: + entrypoint.sh: |- + #!/bin/sh + cmd="/docker-entrypoint.sh postgres" + eval "${cmd}" & disown; + until pg_isready; do + sleep 5; + done; + pg_dump -U $POSTGRES_USER -d {{ include "postgres.dbName" . }} > /postgres_backups/$BACKUP_NAME; diff --git a/charts/minio/1.7.0/templates/backup-postgres-hook.yaml b/charts/minio/1.7.0/templates/backup-postgres-hook.yaml new file mode 100644 index 0000000000..d9e515761a --- /dev/null +++ b/charts/minio/1.7.0/templates/backup-postgres-hook.yaml @@ -0,0 +1,38 @@ +{{- if .Values.ixChartContext.isUpgrade -}} +{{ $values := (. | mustDeepCopy) }} +{{ $_ := set $values "common" (dict "nameSuffix" (include "postgres.nameSuffix" .)) }} +apiVersion: batch/v1 +kind: Job +metadata: + name: pre-upgrade-hook + annotations: + "helm.sh/hook": pre-upgrade + "helm.sh/hook-weight": "1" + "helm.sh/hook-delete-policy": hook-succeeded + rollme: {{ randAlphaNum 5 | quote }} +spec: + template: + metadata: + name: pre-upgrade-hook + spec: + restartPolicy: Never + containers: + - name: {{ .Chart.Name }}-postgres-backup + image: {{ include "postgres.imageName" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }} + - name: BACKUP_NAME + value: {{ include "postgres.backupName" . }} + volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }} + - name: backup-script-configmap + mountPath: /bin/backup_entrypoint.sh + readOnly: true + subPath: entrypoint.sh + command: + - /bin/backup_entrypoint.sh + volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }} + - name: backup-script-configmap + configMap: + defaultMode: 0700 + name: postgres-backup-hook-config-map +{{- end -}} diff --git a/charts/minio/1.7.0/test_values.yaml b/charts/minio/1.7.0/test_values.yaml index 47c5943db1..62a60e1d2c 100644 --- a/charts/minio/1.7.0/test_values.yaml +++ b/charts/minio/1.7.0/test_values.yaml @@ -16,6 +16,7 @@ postgresql: dataVolume: datasetName: ix-postgres_data mountPath: /var/lib/postgresql/data +ixChartContext: {} distributedIps: [] distributedMode: false dnsConfig: From 2dc33338474d3b750e1e44af5afbce55ceeaba25 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 3 Nov 2022 01:26:04 +0200 Subject: [PATCH 09/22] deploy pg and pg hook only when logsearch is enabled --- charts/minio/1.7.0/templates/backup-postgres-hook.yaml | 2 ++ charts/minio/1.7.0/templates/postgres-deployment.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/charts/minio/1.7.0/templates/backup-postgres-hook.yaml b/charts/minio/1.7.0/templates/backup-postgres-hook.yaml index d9e515761a..46ef35d8af 100644 --- a/charts/minio/1.7.0/templates/backup-postgres-hook.yaml +++ b/charts/minio/1.7.0/templates/backup-postgres-hook.yaml @@ -1,3 +1,4 @@ +{{- if .Values.logsearchapi.enabled -}} {{- if .Values.ixChartContext.isUpgrade -}} {{ $values := (. | mustDeepCopy) }} {{ $_ := set $values "common" (dict "nameSuffix" (include "postgres.nameSuffix" .)) }} @@ -36,3 +37,4 @@ spec: defaultMode: 0700 name: postgres-backup-hook-config-map {{- end -}} +{{- end -}} diff --git a/charts/minio/1.7.0/templates/postgres-deployment.yaml b/charts/minio/1.7.0/templates/postgres-deployment.yaml index 22d5c28d37..b93425e997 100644 --- a/charts/minio/1.7.0/templates/postgres-deployment.yaml +++ b/charts/minio/1.7.0/templates/postgres-deployment.yaml @@ -1,3 +1,4 @@ +{{ if .Values.logsearchapi.enabled }} {{ $values := (. | mustDeepCopy) }} {{ $_ := set $values "common" (dict "nameSuffix" (include "postgres.nameSuffix" .)) }} {{ include "common.deployment.common_config" $values | nindent 0 }} @@ -45,3 +46,4 @@ spec: {{ include "common.deployment.common_spec" $values | nindent 2 }} periodSeconds: 15 timeoutSeconds: 2 volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }} +{{ end }} From 2355fc80e5e6971553c8a8738bb65cfd4ace6e58 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 3 Nov 2022 01:36:01 +0200 Subject: [PATCH 10/22] command is a list --- charts/minio/1.7.0/templates/logsearchapi-deployment.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml b/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml index 0084232fc3..543089881d 100644 --- a/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml +++ b/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml @@ -10,7 +10,8 @@ spec: {{ include "common.deployment.common_spec" $values | nindent 2 }} image: {{ include "logsearchapi.imageName" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} env: {{ include "logsearchapi.envVariableConfiguration" $values | nindent 10 }} - command: {{ include "logsearchapi.command" . }} + command: + - {{ include "logsearchapi.command" . }} ports: - name: logsearchapi containerPort: 8080 From a26fe709883c38756e505a4597cea1f85354af38 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 3 Nov 2022 04:03:54 +0200 Subject: [PATCH 11/22] add init containers, fix backup hook --- .../minio/1.7.0/templates/_logsearchapi.tpl | 10 ++- charts/minio/1.7.0/templates/_postgres.tpl | 22 +++++- .../templates/backup-postgres-config.yaml | 4 +- .../1.7.0/templates/backup-postgres-hook.yaml | 2 +- charts/minio/1.7.0/templates/deployment.yaml | 13 ++++ .../templates/logsearchapi-deployment.yaml | 73 +++++++++++-------- .../1.7.0/templates/postgres-secret.yaml | 5 +- 7 files changed, 91 insertions(+), 38 deletions(-) diff --git a/charts/minio/1.7.0/templates/_logsearchapi.tpl b/charts/minio/1.7.0/templates/_logsearchapi.tpl index daa060ebd5..3bcf4e38f9 100644 --- a/charts/minio/1.7.0/templates/_logsearchapi.tpl +++ b/charts/minio/1.7.0/templates/_logsearchapi.tpl @@ -20,7 +20,15 @@ {{- $postgresSecretName := (include "postgres.secretName" .) -}} {{- $envList = mustAppend $envList (dict "name" "MINIO_LOG_QUERY_AUTH_TOKEN" "valueFromSecret" true "secretName" $secretName "secretKey" "queryToken") -}} {{- $envList = mustAppend $envList (dict "name" "LOGSEARCH_AUDIT_AUTH_TOKEN" "valueFromSecret" true "secretName" $secretName "secretKey" "auditToken") -}} -{{- $envList = mustAppend $envList (dict "name" "LOGSEARCH_PG_CONN_STR" "valueFromSecret" true "secretName" $secretName "secretKey" "postgresURL") -}} +{{- $envList = mustAppend $envList (dict "name" "LOGSEARCH_PG_CONN_STR" "valueFromSecret" true "secretName" $postgresSecretName "secretKey" "postgresURL") -}} {{- $envList = mustAppend $envList (dict "name" "LOGSEARCH_DISK_CAPACITY_GB" "value" .Values.logsearchapi.diskCapacityGB) -}} {{- include "common.containers.environmentVariables" (dict "environmentVariables" $envList) -}} {{- end -}} + +{{/* Used in the minio init container (checks that logsearchapi is available) */}} +{{- define "logsearchapiInit.envVariableConfiguration" -}} +{{- $envList := list -}} +{{- $secretName := (include "logsearchapi.secretName" .) -}} +{{- $envList = mustAppend $envList (dict "name" "apiURL" "valueFromSecret" true "secretName" $secretName "secretKey" "logQueryURL") -}} +{{- include "common.containers.environmentVariables" (dict "environmentVariables" $envList) -}} +{{- end -}} diff --git a/charts/minio/1.7.0/templates/_postgres.tpl b/charts/minio/1.7.0/templates/_postgres.tpl index e90c3a83a3..63b577ee1c 100644 --- a/charts/minio/1.7.0/templates/_postgres.tpl +++ b/charts/minio/1.7.0/templates/_postgres.tpl @@ -36,6 +36,26 @@ This will return a unique name based on revision and chart numbers specified. {{- include "common.containers.environmentVariables" (dict "environmentVariables" $envList) -}} {{- end -}} +{{- define "postgresBackup.envVariableConfiguration" -}} +{{- $envList := list -}} +{{- $secretName := (include "postgres.secretName" .) -}} +{{- $envList = mustAppend $envList (dict "name" "POSTGRES_USER" "valueFromSecret" true "secretName" $secretName "secretKey" "db_user") -}} +{{- $envList = mustAppend $envList (dict "name" "POSTGRES_DB" "valueFromSecret" true "secretName" $secretName "secretKey" "db_name") -}} +{{/* PGPASSWORD is used by pg_dump */}} +{{- $envList = mustAppend $envList (dict "name" "PGPASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "db_password") -}} +{{- $envList = mustAppend $envList (dict "name" "pgHost" "valueFromSecret" true "secretName" $secretName "secretKey" "postgresHost") -}} +{{- include "common.containers.environmentVariables" (dict "environmentVariables" $envList) -}} +{{- end -}} + +{{/* Used in the logsearchapi init container (checks that postgres is available) */}} +{{- define "postgresInit.envVariableConfiguration" -}} +{{- $envList := list -}} +{{- $secretName := (include "postgres.secretName" .) -}} +{{- $envList = mustAppend $envList (dict "name" "pgHost" "valueFromSecret" true "secretName" $secretName "secretKey" "postgresHost") -}} +{{- $envList = mustAppend $envList (dict "name" "pguser" "valueFromSecret" true "secretName" $secretName "secretKey" "db_user") -}} +{{- include "common.containers.environmentVariables" (dict "environmentVariables" $envList) -}} +{{- end -}} + {{/* Retrieve postgres volume configuration */}} @@ -47,5 +67,5 @@ Retrieve postgres volume configuration Retrieve postgres volume mounts configuration */}} {{- define "postgres.volumeMountsConfiguration" -}} -{{ include "common.storage.configureAppVolumeMountsInContainer" (dict "appVolumeMounts" .Values.postgresql ) | nindent 0 }} +{{ include "common.storage.configureAppVolumeMountsInContainer" (dict "appVolumeMounts" .Values.postgresAppVolumeMounts ) | nindent 0 }} {{- end -}} diff --git a/charts/minio/1.7.0/templates/backup-postgres-config.yaml b/charts/minio/1.7.0/templates/backup-postgres-config.yaml index d3ddec6294..ec42d3f8f7 100644 --- a/charts/minio/1.7.0/templates/backup-postgres-config.yaml +++ b/charts/minio/1.7.0/templates/backup-postgres-config.yaml @@ -9,7 +9,7 @@ data: #!/bin/sh cmd="/docker-entrypoint.sh postgres" eval "${cmd}" & disown; - until pg_isready; do + until pg_isready -U "$POSTGRES_USER" -h "$pgHost"; do sleep 5; done; - pg_dump -U $POSTGRES_USER -d {{ include "postgres.dbName" . }} > /postgres_backups/$BACKUP_NAME; + pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" -h "$pgHost" -Fc -f /postgres_backups/$BACKUP_NAME.dump; diff --git a/charts/minio/1.7.0/templates/backup-postgres-hook.yaml b/charts/minio/1.7.0/templates/backup-postgres-hook.yaml index 46ef35d8af..5a576900b3 100644 --- a/charts/minio/1.7.0/templates/backup-postgres-hook.yaml +++ b/charts/minio/1.7.0/templates/backup-postgres-hook.yaml @@ -21,7 +21,7 @@ spec: - name: {{ .Chart.Name }}-postgres-backup image: {{ include "postgres.imageName" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} - env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }} + env: {{ include "postgresBackup.envVariableConfiguration" $values | nindent 10 }} - name: BACKUP_NAME value: {{ include "postgres.backupName" . }} volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }} diff --git a/charts/minio/1.7.0/templates/deployment.yaml b/charts/minio/1.7.0/templates/deployment.yaml index b60d9faff9..31215c78c4 100644 --- a/charts/minio/1.7.0/templates/deployment.yaml +++ b/charts/minio/1.7.0/templates/deployment.yaml @@ -1,4 +1,6 @@ {{ include "common.storage.hostPathValidate" .Values }} +{{ $logsearchValues := (. | mustDeepCopy) }} +{{ $_ := set $logsearchValues "common" (dict "nameSuffix" (include "logsearchapi.nameSuffix" .)) }} apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }} kind: Deployment metadata: @@ -32,6 +34,17 @@ spec: runAsGroup: {{ .Values.runAsGroup }} serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }} hostNetwork: {{ include "minio.hostNetworking" . }} + {{ if .Values.logsearchapi.enabled }} + initContainers: + - name: {{ .Chart.Name }}-waitapi + image: alpine/curl + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: {{ include "logsearchapiInit.envVariableConfiguration" $logsearchValues | nindent 10 }} + command: + - sh + - -c + - "until curl $apiURL/status; do sleep 2; done" + {{ end }} containers: - name: {{ .Chart.Name }} {{ include "common.resources.limitation" . | nindent 10 }} diff --git a/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml b/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml index 543089881d..71b54705d3 100644 --- a/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml +++ b/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml @@ -1,40 +1,51 @@ {{ if .Values.logsearchapi.enabled }} {{ $values := (. | mustDeepCopy) }} {{ $_ := set $values "common" (dict "nameSuffix" (include "logsearchapi.nameSuffix" .)) }} +{{ $pg_values := (. | mustDeepCopy) }} +{{ $_ := set $pg_values "common" (dict "nameSuffix" (include "postgres.nameSuffix" .)) }} {{ include "common.deployment.common_config" $values | nindent 0 }} spec: {{ include "common.deployment.common_spec" $values | nindent 2 }} template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }} spec: + initContainers: + - name: {{ .Chart.Name }}-{{ include "logsearchapi.nameSuffix" . }}-waitdb + image: {{ include "postgres.imageName" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: {{ include "postgresInit.envVariableConfiguration" $pg_values | nindent 10 }} + command: + - sh + - -c + - 'until pg_isready -U "$pgUser" -h "$pgHost"; do sleep 2; done' containers: - - name: {{ .Chart.Name }}-{{ include "logsearchapi.nameSuffix" . }} - image: {{ include "logsearchapi.imageName" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: {{ include "logsearchapi.envVariableConfiguration" $values | nindent 10 }} - command: - - {{ include "logsearchapi.command" . }} - ports: - - name: logsearchapi - containerPort: 8080 - protocol: TCP - readinessProbe: - httpGet: - path: /status - port: 8080 - failureThreshold: 5 - periodSeconds: 15 - initialDelaySeconds: 15 - livenessProbe: - httpGet: - path: /status - port: 8080 - failureThreshold: 5 - periodSeconds: 15 - initialDelaySeconds: 15 - startupProbe: - httpGet: - path: /status - port: 8080 - failureThreshold: 5 - periodSeconds: 15 - initialDelaySeconds: 15 + - name: {{ .Chart.Name }}-{{ include "logsearchapi.nameSuffix" . }} + image: {{ include "logsearchapi.imageName" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: {{ include "logsearchapi.envVariableConfiguration" $values | nindent 10 }} + command: + - {{ include "logsearchapi.command" . }} + ports: + - name: logsearchapi + containerPort: 8080 + protocol: TCP + readinessProbe: + httpGet: + path: /status + port: 8080 + failureThreshold: 5 + periodSeconds: 15 + initialDelaySeconds: 15 + livenessProbe: + httpGet: + path: /status + port: 8080 + failureThreshold: 5 + periodSeconds: 15 + initialDelaySeconds: 15 + startupProbe: + httpGet: + path: /status + port: 8080 + failureThreshold: 5 + periodSeconds: 15 + initialDelaySeconds: 15 {{ end }} diff --git a/charts/minio/1.7.0/templates/postgres-secret.yaml b/charts/minio/1.7.0/templates/postgres-secret.yaml index 27ad246778..ea149e2197 100644 --- a/charts/minio/1.7.0/templates/postgres-secret.yaml +++ b/charts/minio/1.7.0/templates/postgres-secret.yaml @@ -7,8 +7,8 @@ kind: Secret metadata: name: {{ include "postgres.secretName" . }} data: - db_user: {{ include "postgres.dbUser" . }} - db_name: {{ include "postgres.dbName" . }} + db_user: {{ include "postgres.dbUser" . | b64enc }} + db_name: {{ include "postgres.dbName" . | b64enc }} {{ with (lookup "v1" "Secret" .Release.Namespace (include "postgres.secretName" .)) }} {{ $dbPass = (index .data "db_password") }} db_password: {{ $dbPass }} @@ -16,4 +16,5 @@ data: db_password: {{ $dbPass }} {{ end }} postgresURL: {{ printf "postgres://%v:%v@%v:5432/%v?sslmode=disable" (include "postgres.dbUser" .) ($dbPass | b64dec) (include "common.names.fullname" $pgValues) (include "postgres.dbName" .) | b64enc }} + postgresHost: {{ printf "%v" (include "common.names.fullname" $pgValues) | b64enc }} {{ end }} From d95846be07368d6b1f1175e339c88ca7a9616ef8 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 3 Nov 2022 04:06:11 +0200 Subject: [PATCH 12/22] move minio to test --- charts/minio/{1.7.0 => 1.6.58}/.helmignore | 0 charts/minio/{1.7.0 => 1.6.58}/CHANGELOG.md | 0 {test => charts}/minio/1.6.58/Chart.yaml | 0 charts/minio/{1.7.0 => 1.6.58}/README.md | 0 charts/minio/{1.7.0 => 1.6.58}/app-readme.md | 0 .../{1.7.0 => 1.6.58}/charts/common-2207.0.0.tgz | Bin {test => charts}/minio/1.6.58/ix_values.yaml | 0 charts/minio/{1.7.0 => 1.6.58}/migrations/migrate | 0 .../{1.7.0 => 1.6.58}/migrations/migrate_from_1.0.0 | 0 {test => charts}/minio/1.6.58/questions.yaml | 0 charts/minio/{1.7.0 => 1.6.58}/requirements.lock | 0 charts/minio/{1.7.0 => 1.6.58}/templates/NOTES.txt | 0 charts/minio/{1.7.0 => 1.6.58}/templates/_cert.tpl | 0 .../minio/{1.7.0 => 1.6.58}/templates/_helpers.tpl | 0 .../{1.7.0 => 1.6.58}/templates/configmap.yaml | 0 .../minio/1.6.58/templates/deployment.yaml | 0 .../templates/pre-install-job.yaml | 0 .../minio/{1.7.0 => 1.6.58}/templates/secrets.yaml | 0 .../minio/{1.7.0 => 1.6.58}/templates/service.yaml | 0 .../{1.7.0 => 1.6.58}/templates/serviceaccount.yaml | 0 .../templates/tests/deployment-check.yaml | 0 {test => charts}/minio/1.6.58/test_values.yaml | 0 test/minio/{1.6.58 => 1.7.0}/.helmignore | 0 test/minio/{1.6.58 => 1.7.0}/CHANGELOG.md | 0 {charts => test}/minio/1.7.0/Chart.yaml | 0 test/minio/{1.6.58 => 1.7.0}/README.md | 0 test/minio/{1.6.58 => 1.7.0}/app-readme.md | 0 .../{1.6.58 => 1.7.0}/charts/common-2207.0.0.tgz | Bin {charts => test}/minio/1.7.0/ix_values.yaml | 0 test/minio/{1.6.58 => 1.7.0}/migrations/migrate | 0 .../{1.6.58 => 1.7.0}/migrations/migrate_from_1.0.0 | 0 {charts => test}/minio/1.7.0/questions.yaml | 0 test/minio/{1.6.58 => 1.7.0}/requirements.lock | 0 test/minio/{1.6.58 => 1.7.0}/templates/NOTES.txt | 0 test/minio/{1.6.58 => 1.7.0}/templates/_cert.tpl | 0 test/minio/{1.6.58 => 1.7.0}/templates/_helpers.tpl | 0 .../minio/1.7.0/templates/_logsearchapi.tpl | 0 .../minio/1.7.0/templates/_postgres.tpl | 0 .../1.7.0/templates/backup-postgres-config.yaml | 0 .../minio/1.7.0/templates/backup-postgres-hook.yaml | 0 .../{1.6.58 => 1.7.0}/templates/configmap.yaml | 0 .../minio/1.7.0/templates/deployment.yaml | 0 .../1.7.0/templates/logsearchapi-deployment.yaml | 0 .../minio/1.7.0/templates/logsearchapi-secret.yaml | 0 .../minio/1.7.0/templates/logsearchapi-service.yaml | 0 .../minio/1.7.0/templates/postgres-deployment.yaml | 0 .../minio/1.7.0/templates/postgres-secret.yaml | 0 .../minio/1.7.0/templates/postgres-service.yaml | 0 .../templates/pre-install-job.yaml | 0 test/minio/{1.6.58 => 1.7.0}/templates/secrets.yaml | 0 test/minio/{1.6.58 => 1.7.0}/templates/service.yaml | 0 .../{1.6.58 => 1.7.0}/templates/serviceaccount.yaml | 0 .../templates/tests/deployment-check.yaml | 0 {charts => test}/minio/1.7.0/test_values.yaml | 0 54 files changed, 0 insertions(+), 0 deletions(-) rename charts/minio/{1.7.0 => 1.6.58}/.helmignore (100%) rename charts/minio/{1.7.0 => 1.6.58}/CHANGELOG.md (100%) rename {test => charts}/minio/1.6.58/Chart.yaml (100%) rename charts/minio/{1.7.0 => 1.6.58}/README.md (100%) rename charts/minio/{1.7.0 => 1.6.58}/app-readme.md (100%) rename charts/minio/{1.7.0 => 1.6.58}/charts/common-2207.0.0.tgz (100%) rename {test => charts}/minio/1.6.58/ix_values.yaml (100%) rename charts/minio/{1.7.0 => 1.6.58}/migrations/migrate (100%) rename charts/minio/{1.7.0 => 1.6.58}/migrations/migrate_from_1.0.0 (100%) rename {test => charts}/minio/1.6.58/questions.yaml (100%) rename charts/minio/{1.7.0 => 1.6.58}/requirements.lock (100%) rename charts/minio/{1.7.0 => 1.6.58}/templates/NOTES.txt (100%) rename charts/minio/{1.7.0 => 1.6.58}/templates/_cert.tpl (100%) rename charts/minio/{1.7.0 => 1.6.58}/templates/_helpers.tpl (100%) rename charts/minio/{1.7.0 => 1.6.58}/templates/configmap.yaml (100%) rename {test => charts}/minio/1.6.58/templates/deployment.yaml (100%) rename charts/minio/{1.7.0 => 1.6.58}/templates/pre-install-job.yaml (100%) rename charts/minio/{1.7.0 => 1.6.58}/templates/secrets.yaml (100%) rename charts/minio/{1.7.0 => 1.6.58}/templates/service.yaml (100%) rename charts/minio/{1.7.0 => 1.6.58}/templates/serviceaccount.yaml (100%) rename charts/minio/{1.7.0 => 1.6.58}/templates/tests/deployment-check.yaml (100%) rename {test => charts}/minio/1.6.58/test_values.yaml (100%) rename test/minio/{1.6.58 => 1.7.0}/.helmignore (100%) rename test/minio/{1.6.58 => 1.7.0}/CHANGELOG.md (100%) rename {charts => test}/minio/1.7.0/Chart.yaml (100%) rename test/minio/{1.6.58 => 1.7.0}/README.md (100%) rename test/minio/{1.6.58 => 1.7.0}/app-readme.md (100%) rename test/minio/{1.6.58 => 1.7.0}/charts/common-2207.0.0.tgz (100%) rename {charts => test}/minio/1.7.0/ix_values.yaml (100%) rename test/minio/{1.6.58 => 1.7.0}/migrations/migrate (100%) rename test/minio/{1.6.58 => 1.7.0}/migrations/migrate_from_1.0.0 (100%) rename {charts => test}/minio/1.7.0/questions.yaml (100%) rename test/minio/{1.6.58 => 1.7.0}/requirements.lock (100%) rename test/minio/{1.6.58 => 1.7.0}/templates/NOTES.txt (100%) rename test/minio/{1.6.58 => 1.7.0}/templates/_cert.tpl (100%) rename test/minio/{1.6.58 => 1.7.0}/templates/_helpers.tpl (100%) rename {charts => test}/minio/1.7.0/templates/_logsearchapi.tpl (100%) rename {charts => test}/minio/1.7.0/templates/_postgres.tpl (100%) rename {charts => test}/minio/1.7.0/templates/backup-postgres-config.yaml (100%) rename {charts => test}/minio/1.7.0/templates/backup-postgres-hook.yaml (100%) rename test/minio/{1.6.58 => 1.7.0}/templates/configmap.yaml (100%) rename {charts => test}/minio/1.7.0/templates/deployment.yaml (100%) rename {charts => test}/minio/1.7.0/templates/logsearchapi-deployment.yaml (100%) rename {charts => test}/minio/1.7.0/templates/logsearchapi-secret.yaml (100%) rename {charts => test}/minio/1.7.0/templates/logsearchapi-service.yaml (100%) rename {charts => test}/minio/1.7.0/templates/postgres-deployment.yaml (100%) rename {charts => test}/minio/1.7.0/templates/postgres-secret.yaml (100%) rename {charts => test}/minio/1.7.0/templates/postgres-service.yaml (100%) rename test/minio/{1.6.58 => 1.7.0}/templates/pre-install-job.yaml (100%) rename test/minio/{1.6.58 => 1.7.0}/templates/secrets.yaml (100%) rename test/minio/{1.6.58 => 1.7.0}/templates/service.yaml (100%) rename test/minio/{1.6.58 => 1.7.0}/templates/serviceaccount.yaml (100%) rename test/minio/{1.6.58 => 1.7.0}/templates/tests/deployment-check.yaml (100%) rename {charts => test}/minio/1.7.0/test_values.yaml (100%) diff --git a/charts/minio/1.7.0/.helmignore b/charts/minio/1.6.58/.helmignore similarity index 100% rename from charts/minio/1.7.0/.helmignore rename to charts/minio/1.6.58/.helmignore diff --git a/charts/minio/1.7.0/CHANGELOG.md b/charts/minio/1.6.58/CHANGELOG.md similarity index 100% rename from charts/minio/1.7.0/CHANGELOG.md rename to charts/minio/1.6.58/CHANGELOG.md diff --git a/test/minio/1.6.58/Chart.yaml b/charts/minio/1.6.58/Chart.yaml similarity index 100% rename from test/minio/1.6.58/Chart.yaml rename to charts/minio/1.6.58/Chart.yaml diff --git a/charts/minio/1.7.0/README.md b/charts/minio/1.6.58/README.md similarity index 100% rename from charts/minio/1.7.0/README.md rename to charts/minio/1.6.58/README.md diff --git a/charts/minio/1.7.0/app-readme.md b/charts/minio/1.6.58/app-readme.md similarity index 100% rename from charts/minio/1.7.0/app-readme.md rename to charts/minio/1.6.58/app-readme.md diff --git a/charts/minio/1.7.0/charts/common-2207.0.0.tgz b/charts/minio/1.6.58/charts/common-2207.0.0.tgz similarity index 100% rename from charts/minio/1.7.0/charts/common-2207.0.0.tgz rename to charts/minio/1.6.58/charts/common-2207.0.0.tgz diff --git a/test/minio/1.6.58/ix_values.yaml b/charts/minio/1.6.58/ix_values.yaml similarity index 100% rename from test/minio/1.6.58/ix_values.yaml rename to charts/minio/1.6.58/ix_values.yaml diff --git a/charts/minio/1.7.0/migrations/migrate b/charts/minio/1.6.58/migrations/migrate similarity index 100% rename from charts/minio/1.7.0/migrations/migrate rename to charts/minio/1.6.58/migrations/migrate diff --git a/charts/minio/1.7.0/migrations/migrate_from_1.0.0 b/charts/minio/1.6.58/migrations/migrate_from_1.0.0 similarity index 100% rename from charts/minio/1.7.0/migrations/migrate_from_1.0.0 rename to charts/minio/1.6.58/migrations/migrate_from_1.0.0 diff --git a/test/minio/1.6.58/questions.yaml b/charts/minio/1.6.58/questions.yaml similarity index 100% rename from test/minio/1.6.58/questions.yaml rename to charts/minio/1.6.58/questions.yaml diff --git a/charts/minio/1.7.0/requirements.lock b/charts/minio/1.6.58/requirements.lock similarity index 100% rename from charts/minio/1.7.0/requirements.lock rename to charts/minio/1.6.58/requirements.lock diff --git a/charts/minio/1.7.0/templates/NOTES.txt b/charts/minio/1.6.58/templates/NOTES.txt similarity index 100% rename from charts/minio/1.7.0/templates/NOTES.txt rename to charts/minio/1.6.58/templates/NOTES.txt diff --git a/charts/minio/1.7.0/templates/_cert.tpl b/charts/minio/1.6.58/templates/_cert.tpl similarity index 100% rename from charts/minio/1.7.0/templates/_cert.tpl rename to charts/minio/1.6.58/templates/_cert.tpl diff --git a/charts/minio/1.7.0/templates/_helpers.tpl b/charts/minio/1.6.58/templates/_helpers.tpl similarity index 100% rename from charts/minio/1.7.0/templates/_helpers.tpl rename to charts/minio/1.6.58/templates/_helpers.tpl diff --git a/charts/minio/1.7.0/templates/configmap.yaml b/charts/minio/1.6.58/templates/configmap.yaml similarity index 100% rename from charts/minio/1.7.0/templates/configmap.yaml rename to charts/minio/1.6.58/templates/configmap.yaml diff --git a/test/minio/1.6.58/templates/deployment.yaml b/charts/minio/1.6.58/templates/deployment.yaml similarity index 100% rename from test/minio/1.6.58/templates/deployment.yaml rename to charts/minio/1.6.58/templates/deployment.yaml diff --git a/charts/minio/1.7.0/templates/pre-install-job.yaml b/charts/minio/1.6.58/templates/pre-install-job.yaml similarity index 100% rename from charts/minio/1.7.0/templates/pre-install-job.yaml rename to charts/minio/1.6.58/templates/pre-install-job.yaml diff --git a/charts/minio/1.7.0/templates/secrets.yaml b/charts/minio/1.6.58/templates/secrets.yaml similarity index 100% rename from charts/minio/1.7.0/templates/secrets.yaml rename to charts/minio/1.6.58/templates/secrets.yaml diff --git a/charts/minio/1.7.0/templates/service.yaml b/charts/minio/1.6.58/templates/service.yaml similarity index 100% rename from charts/minio/1.7.0/templates/service.yaml rename to charts/minio/1.6.58/templates/service.yaml diff --git a/charts/minio/1.7.0/templates/serviceaccount.yaml b/charts/minio/1.6.58/templates/serviceaccount.yaml similarity index 100% rename from charts/minio/1.7.0/templates/serviceaccount.yaml rename to charts/minio/1.6.58/templates/serviceaccount.yaml diff --git a/charts/minio/1.7.0/templates/tests/deployment-check.yaml b/charts/minio/1.6.58/templates/tests/deployment-check.yaml similarity index 100% rename from charts/minio/1.7.0/templates/tests/deployment-check.yaml rename to charts/minio/1.6.58/templates/tests/deployment-check.yaml diff --git a/test/minio/1.6.58/test_values.yaml b/charts/minio/1.6.58/test_values.yaml similarity index 100% rename from test/minio/1.6.58/test_values.yaml rename to charts/minio/1.6.58/test_values.yaml diff --git a/test/minio/1.6.58/.helmignore b/test/minio/1.7.0/.helmignore similarity index 100% rename from test/minio/1.6.58/.helmignore rename to test/minio/1.7.0/.helmignore diff --git a/test/minio/1.6.58/CHANGELOG.md b/test/minio/1.7.0/CHANGELOG.md similarity index 100% rename from test/minio/1.6.58/CHANGELOG.md rename to test/minio/1.7.0/CHANGELOG.md diff --git a/charts/minio/1.7.0/Chart.yaml b/test/minio/1.7.0/Chart.yaml similarity index 100% rename from charts/minio/1.7.0/Chart.yaml rename to test/minio/1.7.0/Chart.yaml diff --git a/test/minio/1.6.58/README.md b/test/minio/1.7.0/README.md similarity index 100% rename from test/minio/1.6.58/README.md rename to test/minio/1.7.0/README.md diff --git a/test/minio/1.6.58/app-readme.md b/test/minio/1.7.0/app-readme.md similarity index 100% rename from test/minio/1.6.58/app-readme.md rename to test/minio/1.7.0/app-readme.md diff --git a/test/minio/1.6.58/charts/common-2207.0.0.tgz b/test/minio/1.7.0/charts/common-2207.0.0.tgz similarity index 100% rename from test/minio/1.6.58/charts/common-2207.0.0.tgz rename to test/minio/1.7.0/charts/common-2207.0.0.tgz diff --git a/charts/minio/1.7.0/ix_values.yaml b/test/minio/1.7.0/ix_values.yaml similarity index 100% rename from charts/minio/1.7.0/ix_values.yaml rename to test/minio/1.7.0/ix_values.yaml diff --git a/test/minio/1.6.58/migrations/migrate b/test/minio/1.7.0/migrations/migrate similarity index 100% rename from test/minio/1.6.58/migrations/migrate rename to test/minio/1.7.0/migrations/migrate diff --git a/test/minio/1.6.58/migrations/migrate_from_1.0.0 b/test/minio/1.7.0/migrations/migrate_from_1.0.0 similarity index 100% rename from test/minio/1.6.58/migrations/migrate_from_1.0.0 rename to test/minio/1.7.0/migrations/migrate_from_1.0.0 diff --git a/charts/minio/1.7.0/questions.yaml b/test/minio/1.7.0/questions.yaml similarity index 100% rename from charts/minio/1.7.0/questions.yaml rename to test/minio/1.7.0/questions.yaml diff --git a/test/minio/1.6.58/requirements.lock b/test/minio/1.7.0/requirements.lock similarity index 100% rename from test/minio/1.6.58/requirements.lock rename to test/minio/1.7.0/requirements.lock diff --git a/test/minio/1.6.58/templates/NOTES.txt b/test/minio/1.7.0/templates/NOTES.txt similarity index 100% rename from test/minio/1.6.58/templates/NOTES.txt rename to test/minio/1.7.0/templates/NOTES.txt diff --git a/test/minio/1.6.58/templates/_cert.tpl b/test/minio/1.7.0/templates/_cert.tpl similarity index 100% rename from test/minio/1.6.58/templates/_cert.tpl rename to test/minio/1.7.0/templates/_cert.tpl diff --git a/test/minio/1.6.58/templates/_helpers.tpl b/test/minio/1.7.0/templates/_helpers.tpl similarity index 100% rename from test/minio/1.6.58/templates/_helpers.tpl rename to test/minio/1.7.0/templates/_helpers.tpl diff --git a/charts/minio/1.7.0/templates/_logsearchapi.tpl b/test/minio/1.7.0/templates/_logsearchapi.tpl similarity index 100% rename from charts/minio/1.7.0/templates/_logsearchapi.tpl rename to test/minio/1.7.0/templates/_logsearchapi.tpl diff --git a/charts/minio/1.7.0/templates/_postgres.tpl b/test/minio/1.7.0/templates/_postgres.tpl similarity index 100% rename from charts/minio/1.7.0/templates/_postgres.tpl rename to test/minio/1.7.0/templates/_postgres.tpl diff --git a/charts/minio/1.7.0/templates/backup-postgres-config.yaml b/test/minio/1.7.0/templates/backup-postgres-config.yaml similarity index 100% rename from charts/minio/1.7.0/templates/backup-postgres-config.yaml rename to test/minio/1.7.0/templates/backup-postgres-config.yaml diff --git a/charts/minio/1.7.0/templates/backup-postgres-hook.yaml b/test/minio/1.7.0/templates/backup-postgres-hook.yaml similarity index 100% rename from charts/minio/1.7.0/templates/backup-postgres-hook.yaml rename to test/minio/1.7.0/templates/backup-postgres-hook.yaml diff --git a/test/minio/1.6.58/templates/configmap.yaml b/test/minio/1.7.0/templates/configmap.yaml similarity index 100% rename from test/minio/1.6.58/templates/configmap.yaml rename to test/minio/1.7.0/templates/configmap.yaml diff --git a/charts/minio/1.7.0/templates/deployment.yaml b/test/minio/1.7.0/templates/deployment.yaml similarity index 100% rename from charts/minio/1.7.0/templates/deployment.yaml rename to test/minio/1.7.0/templates/deployment.yaml diff --git a/charts/minio/1.7.0/templates/logsearchapi-deployment.yaml b/test/minio/1.7.0/templates/logsearchapi-deployment.yaml similarity index 100% rename from charts/minio/1.7.0/templates/logsearchapi-deployment.yaml rename to test/minio/1.7.0/templates/logsearchapi-deployment.yaml diff --git a/charts/minio/1.7.0/templates/logsearchapi-secret.yaml b/test/minio/1.7.0/templates/logsearchapi-secret.yaml similarity index 100% rename from charts/minio/1.7.0/templates/logsearchapi-secret.yaml rename to test/minio/1.7.0/templates/logsearchapi-secret.yaml diff --git a/charts/minio/1.7.0/templates/logsearchapi-service.yaml b/test/minio/1.7.0/templates/logsearchapi-service.yaml similarity index 100% rename from charts/minio/1.7.0/templates/logsearchapi-service.yaml rename to test/minio/1.7.0/templates/logsearchapi-service.yaml diff --git a/charts/minio/1.7.0/templates/postgres-deployment.yaml b/test/minio/1.7.0/templates/postgres-deployment.yaml similarity index 100% rename from charts/minio/1.7.0/templates/postgres-deployment.yaml rename to test/minio/1.7.0/templates/postgres-deployment.yaml diff --git a/charts/minio/1.7.0/templates/postgres-secret.yaml b/test/minio/1.7.0/templates/postgres-secret.yaml similarity index 100% rename from charts/minio/1.7.0/templates/postgres-secret.yaml rename to test/minio/1.7.0/templates/postgres-secret.yaml diff --git a/charts/minio/1.7.0/templates/postgres-service.yaml b/test/minio/1.7.0/templates/postgres-service.yaml similarity index 100% rename from charts/minio/1.7.0/templates/postgres-service.yaml rename to test/minio/1.7.0/templates/postgres-service.yaml diff --git a/test/minio/1.6.58/templates/pre-install-job.yaml b/test/minio/1.7.0/templates/pre-install-job.yaml similarity index 100% rename from test/minio/1.6.58/templates/pre-install-job.yaml rename to test/minio/1.7.0/templates/pre-install-job.yaml diff --git a/test/minio/1.6.58/templates/secrets.yaml b/test/minio/1.7.0/templates/secrets.yaml similarity index 100% rename from test/minio/1.6.58/templates/secrets.yaml rename to test/minio/1.7.0/templates/secrets.yaml diff --git a/test/minio/1.6.58/templates/service.yaml b/test/minio/1.7.0/templates/service.yaml similarity index 100% rename from test/minio/1.6.58/templates/service.yaml rename to test/minio/1.7.0/templates/service.yaml diff --git a/test/minio/1.6.58/templates/serviceaccount.yaml b/test/minio/1.7.0/templates/serviceaccount.yaml similarity index 100% rename from test/minio/1.6.58/templates/serviceaccount.yaml rename to test/minio/1.7.0/templates/serviceaccount.yaml diff --git a/test/minio/1.6.58/templates/tests/deployment-check.yaml b/test/minio/1.7.0/templates/tests/deployment-check.yaml similarity index 100% rename from test/minio/1.6.58/templates/tests/deployment-check.yaml rename to test/minio/1.7.0/templates/tests/deployment-check.yaml diff --git a/charts/minio/1.7.0/test_values.yaml b/test/minio/1.7.0/test_values.yaml similarity index 100% rename from charts/minio/1.7.0/test_values.yaml rename to test/minio/1.7.0/test_values.yaml From f87a48405eaf0a34cbc999e9cc68dd831c8dde39 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 3 Nov 2022 11:09:36 +0200 Subject: [PATCH 13/22] move to remembered secrets for safety --- .../1.7.0/templates/logsearchapi-secret.yaml | 23 ++++++++++++------- .../1.7.0/templates/postgres-secret.yaml | 14 ++++++----- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/test/minio/1.7.0/templates/logsearchapi-secret.yaml b/test/minio/1.7.0/templates/logsearchapi-secret.yaml index 2ae0021637..bb03c5a329 100644 --- a/test/minio/1.7.0/templates/logsearchapi-secret.yaml +++ b/test/minio/1.7.0/templates/logsearchapi-secret.yaml @@ -1,18 +1,25 @@ {{ if .Values.logsearchapi.enabled }} {{ $logSearchValues := (. | mustDeepCopy) }} {{ $_ := set $logSearchValues "common" (dict "nameSuffix" (include "logsearchapi.nameSuffix" .)) }} + +{{ $auditToken := randAlphaNum 32 | b64enc }} +{{ $queryToken := randAlphaNum 32 | b32enc }} + apiVersion: v1 kind: Secret metadata: name: {{ include "logsearchapi.secretName" . }} data: - {{/* - Those are passed to environment variables, which sets everything on startup - There is no need to remember previously created secrets. - */}} - {{ $auditToken := randAlphaNum 32 }} - auditToken: {{ $auditToken | b64enc }} - queryToken: {{ randAlphaNum 32 | b64enc }} + {{ with (lookup "v1" "Secret" .Release.Namespace (include "logsearchapi.secretName")) }} + {{ $auditToken = (index .data "auditToken") }} + {{ end }} + auditToken: {{ $auditToken }} + + {{ with (lookup "v1" "Secret" .Release.Namespace (include "logsearchapi.secretName")) }} + {{ $queryToken = (index .data "queryToken") }} + {{ end }} + queryToken: {{ $queryToken }} + logQueryURL: {{ (printf "http://%v:8080" (include "common.names.fullname" $logSearchValues)) | b64enc }} - webhookURL: {{ (printf "http://%v:8080/api/ingest?token=%v" (include "common.names.fullname" $logSearchValues) $auditToken) | b64enc }} + webhookURL: {{ (printf "http://%v:8080/api/ingest?token=%v" (include "common.names.fullname" $logSearchValues) ($auditToken | b64dec)) | b64enc }} {{ end }} diff --git a/test/minio/1.7.0/templates/postgres-secret.yaml b/test/minio/1.7.0/templates/postgres-secret.yaml index ea149e2197..563c2b2d15 100644 --- a/test/minio/1.7.0/templates/postgres-secret.yaml +++ b/test/minio/1.7.0/templates/postgres-secret.yaml @@ -1,20 +1,22 @@ {{ if .Values.logsearchapi.enabled }} -{{ $dbPass := randAlphaNum 32 | b64enc }} {{ $pgValues := (. | mustDeepCopy) }} {{ $_ := set $pgValues "common" (dict "nameSuffix" (include "postgres.nameSuffix" .)) }} + +{{ $dbPass := randAlphaNum 32 | b64enc }} + apiVersion: v1 kind: Secret metadata: name: {{ include "postgres.secretName" . }} data: - db_user: {{ include "postgres.dbUser" . | b64enc }} - db_name: {{ include "postgres.dbName" . | b64enc }} {{ with (lookup "v1" "Secret" .Release.Namespace (include "postgres.secretName" .)) }} {{ $dbPass = (index .data "db_password") }} - db_password: {{ $dbPass }} - {{ else }} - db_password: {{ $dbPass }} {{ end }} + db_password: {{ $dbPass }} + + db_user: {{ include "postgres.dbUser" . | b64enc }} + db_name: {{ include "postgres.dbName" . | b64enc }} + postgresURL: {{ printf "postgres://%v:%v@%v:5432/%v?sslmode=disable" (include "postgres.dbUser" .) ($dbPass | b64dec) (include "common.names.fullname" $pgValues) (include "postgres.dbName" .) | b64enc }} postgresHost: {{ printf "%v" (include "common.names.fullname" $pgValues) | b64enc }} {{ end }} From c708203126a4c3f66096e6ff7b18cf9cc71d301b Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 3 Nov 2022 11:12:57 +0200 Subject: [PATCH 14/22] pass dot --- test/minio/1.7.0/templates/logsearchapi-secret.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/minio/1.7.0/templates/logsearchapi-secret.yaml b/test/minio/1.7.0/templates/logsearchapi-secret.yaml index bb03c5a329..18e71479e6 100644 --- a/test/minio/1.7.0/templates/logsearchapi-secret.yaml +++ b/test/minio/1.7.0/templates/logsearchapi-secret.yaml @@ -10,12 +10,12 @@ kind: Secret metadata: name: {{ include "logsearchapi.secretName" . }} data: - {{ with (lookup "v1" "Secret" .Release.Namespace (include "logsearchapi.secretName")) }} + {{ with (lookup "v1" "Secret" .Release.Namespace (include "logsearchapi.secretName" .)) }} {{ $auditToken = (index .data "auditToken") }} {{ end }} auditToken: {{ $auditToken }} - {{ with (lookup "v1" "Secret" .Release.Namespace (include "logsearchapi.secretName")) }} + {{ with (lookup "v1" "Secret" .Release.Namespace (include "logsearchapi.secretName" .)) }} {{ $queryToken = (index .data "queryToken") }} {{ end }} queryToken: {{ $queryToken }} From a08e98adfa655991db92537f006edbf717de9b02 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 3 Nov 2022 11:14:35 +0200 Subject: [PATCH 15/22] autocomplete -.- --- test/minio/1.7.0/templates/logsearchapi-secret.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/minio/1.7.0/templates/logsearchapi-secret.yaml b/test/minio/1.7.0/templates/logsearchapi-secret.yaml index 18e71479e6..a8a233d7e7 100644 --- a/test/minio/1.7.0/templates/logsearchapi-secret.yaml +++ b/test/minio/1.7.0/templates/logsearchapi-secret.yaml @@ -3,7 +3,7 @@ {{ $_ := set $logSearchValues "common" (dict "nameSuffix" (include "logsearchapi.nameSuffix" .)) }} {{ $auditToken := randAlphaNum 32 | b64enc }} -{{ $queryToken := randAlphaNum 32 | b32enc }} +{{ $queryToken := randAlphaNum 32 | b64enc }} apiVersion: v1 kind: Secret From ec1013ac4ab45af5cb454cc8dfce6a271c41484f Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 3 Nov 2022 11:37:31 +0200 Subject: [PATCH 16/22] extend comment --- test/minio/1.7.0/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/minio/1.7.0/templates/deployment.yaml b/test/minio/1.7.0/templates/deployment.yaml index 31215c78c4..f952770526 100644 --- a/test/minio/1.7.0/templates/deployment.yaml +++ b/test/minio/1.7.0/templates/deployment.yaml @@ -76,7 +76,7 @@ spec: {{ if .Values.logsearchapi.enabled }} {{/* We can put any ID we want here. Just make sure it's unique - It can be rolled on each startup without problems. + It can be rolled on each startup without problems, or se can set a static one. */}} {{ $webhookID := (printf "ix-%v" (randAlphaNum 5)) }} {{ $logsearchSecretName := (include "logsearchapi.secretName" .) }} From f9cc0c395130f3417da603a9206e79b78bed6c93 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 3 Nov 2022 13:14:18 +0200 Subject: [PATCH 17/22] use recreate for postgres --- test/minio/1.7.0/templates/postgres-deployment.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/minio/1.7.0/templates/postgres-deployment.yaml b/test/minio/1.7.0/templates/postgres-deployment.yaml index b93425e997..521fd7b152 100644 --- a/test/minio/1.7.0/templates/postgres-deployment.yaml +++ b/test/minio/1.7.0/templates/postgres-deployment.yaml @@ -2,7 +2,14 @@ {{ $values := (. | mustDeepCopy) }} {{ $_ := set $values "common" (dict "nameSuffix" (include "postgres.nameSuffix" .)) }} {{ include "common.deployment.common_config" $values | nindent 0 }} -spec: {{ include "common.deployment.common_spec" $values | nindent 2 }} +spec: + replicas: {{ (default 1 .Values.replicas) }} + strategy: + type: Recreate + selector: + matchLabels: + app: {{ template "common.names.name" . }} + release: {{ .Release.Name }} template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }} spec: containers: From 04c55ec62cd9a5c2a99b5bbb8ff00c5c1c162626 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 3 Nov 2022 13:41:54 +0200 Subject: [PATCH 18/22] use the default output format --- test/minio/1.7.0/templates/backup-postgres-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/minio/1.7.0/templates/backup-postgres-config.yaml b/test/minio/1.7.0/templates/backup-postgres-config.yaml index ec42d3f8f7..e5892b8222 100644 --- a/test/minio/1.7.0/templates/backup-postgres-config.yaml +++ b/test/minio/1.7.0/templates/backup-postgres-config.yaml @@ -12,4 +12,4 @@ data: until pg_isready -U "$POSTGRES_USER" -h "$pgHost"; do sleep 5; done; - pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" -h "$pgHost" -Fc -f /postgres_backups/$BACKUP_NAME.dump; + pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" -h "$pgHost" -f /postgres_backups/$BACKUP_NAME.sql; From 1ebfeeb18556fee3ffdfb151e2bfd4db37967fe1 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Tue, 29 Nov 2022 14:06:42 +0200 Subject: [PATCH 19/22] update versions --- test/minio/1.7.0/ix_values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/minio/1.7.0/ix_values.yaml b/test/minio/1.7.0/ix_values.yaml index 1185caf608..e7f54f1888 100644 --- a/test/minio/1.7.0/ix_values.yaml +++ b/test/minio/1.7.0/ix_values.yaml @@ -1,13 +1,13 @@ image: pullPolicy: IfNotPresent repository: minio/minio - tag: RELEASE.2022-10-24T18-35-07Z + tag: RELEASE.2022-11-10T18-20-21Z logsearchapi: enabled: false diskCapacityGB: 5 image: pullPolicy: IfNotPresent repository: minio/operator - tag: v4.5.3 + tag: v4.5.4 runAsGroup: 473 runAsUser: 473 From aeb9c3ca7a9fd4e842e022d3b698ca1c3c7d2605 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Tue, 29 Nov 2022 15:22:17 +0200 Subject: [PATCH 20/22] remove additinal_attrs and move logsearch image in its own dict --- test/minio/1.7.0/ix_values.yaml | 8 ++++---- test/minio/1.7.0/questions.yaml | 1 - test/minio/1.7.0/templates/_logsearchapi.tpl | 2 +- test/minio/1.7.0/templates/logsearchapi-deployment.yaml | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/test/minio/1.7.0/ix_values.yaml b/test/minio/1.7.0/ix_values.yaml index e7f54f1888..ce25a89d77 100644 --- a/test/minio/1.7.0/ix_values.yaml +++ b/test/minio/1.7.0/ix_values.yaml @@ -2,12 +2,12 @@ image: pullPolicy: IfNotPresent repository: minio/minio tag: RELEASE.2022-11-10T18-20-21Z +logSearchImage: + pullPolicy: IfNotPresent + repository: minio/operator + tag: v4.5.4 logsearchapi: enabled: false diskCapacityGB: 5 - image: - pullPolicy: IfNotPresent - repository: minio/operator - tag: v4.5.4 runAsGroup: 473 runAsUser: 473 diff --git a/test/minio/1.7.0/questions.yaml b/test/minio/1.7.0/questions.yaml index 259fde747f..a0496b4084 100644 --- a/test/minio/1.7.0/questions.yaml +++ b/test/minio/1.7.0/questions.yaml @@ -190,7 +190,6 @@ questions: group: Minio Configuration schema: type: dict - additional_attrs: true attrs: - variable: enabled label: Enable Log Search API diff --git a/test/minio/1.7.0/templates/_logsearchapi.tpl b/test/minio/1.7.0/templates/_logsearchapi.tpl index 3bcf4e38f9..7ca162d970 100644 --- a/test/minio/1.7.0/templates/_logsearchapi.tpl +++ b/test/minio/1.7.0/templates/_logsearchapi.tpl @@ -1,5 +1,5 @@ {{- define "logsearchapi.imageName" -}} -{{- print "minio/operator:v4.5.3" -}} +{{- printf "%s:%s" .Values.logSearchImage.repository .Values.logSearchImage.tag -}} {{- end -}} {{- define "logsearchapi.nameSuffix" -}} diff --git a/test/minio/1.7.0/templates/logsearchapi-deployment.yaml b/test/minio/1.7.0/templates/logsearchapi-deployment.yaml index 71b54705d3..9a88dd46b3 100644 --- a/test/minio/1.7.0/templates/logsearchapi-deployment.yaml +++ b/test/minio/1.7.0/templates/logsearchapi-deployment.yaml @@ -19,7 +19,7 @@ spec: {{ include "common.deployment.common_spec" $values | nindent 2 }} containers: - name: {{ .Chart.Name }}-{{ include "logsearchapi.nameSuffix" . }} image: {{ include "logsearchapi.imageName" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} + imagePullPolicy: {{ .Values.logSearchImage.pullPolicy }} env: {{ include "logsearchapi.envVariableConfiguration" $values | nindent 10 }} command: - {{ include "logsearchapi.command" . }} From d3bc5cafc20cd98a32f745c37d98d4e665445fe8 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Tue, 29 Nov 2022 15:28:38 +0200 Subject: [PATCH 21/22] update test values --- test/minio/1.7.0/test_values.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/minio/1.7.0/test_values.yaml b/test/minio/1.7.0/test_values.yaml index 62a60e1d2c..3d44f1fa70 100644 --- a/test/minio/1.7.0/test_values.yaml +++ b/test/minio/1.7.0/test_values.yaml @@ -29,6 +29,10 @@ image: pullPolicy: IfNotPresent repository: minio/minio tag: RELEASE.2022-10-24T18-35-07Z +logSearchImage: + pullPolicy: IfNotPresent + repository: minio/operator + tag: v4.5.4 logsearchapi: enabled: true diskCapacityGB: 5 From fde53b9dd4fd3fe04bf348b57ab9ba7da0e1ff14 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Wed, 30 Nov 2022 19:09:53 +0200 Subject: [PATCH 22/22] make hostpath immutable --- test/minio/1.7.0/questions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/minio/1.7.0/questions.yaml b/test/minio/1.7.0/questions.yaml index a0496b4084..4c6fb76d2d 100644 --- a/test/minio/1.7.0/questions.yaml +++ b/test/minio/1.7.0/questions.yaml @@ -294,7 +294,6 @@ questions: default: ix-postgres_data show_if: [["hostPathEnabled", "=", false]] editable: false - - variable: mountPath label: Postgresql Data Mount Path description: Path where the volume will be mounted inside the pod @@ -315,6 +314,7 @@ questions: schema: type: hostpath required: true + immutable: true - variable: postgres-backup label: Postgres Backup Volume