diff --git a/charts/commento/Chart.lock b/charts/commento/Chart.lock index 2741169d65bd83f3853826ba85379a7197387e86..9492e2a05afb283ce57daa2d07333dfe4e9b8f4c 100644 --- a/charts/commento/Chart.lock +++ b/charts/commento/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: postgres repository: https://groundhog2k.github.io/helm-charts - version: 0.2.5 -digest: sha256:1cbaca2458607369da14b57021d4823a56eed2c4a57226780abee2c7ebb4769b -generated: "2020-12-14T23:11:24.611033+01:00" + version: 0.2.7 +digest: sha256:97ed1617bdb942a568743f608d7bbb9a6a9cd77278e6283670c1ab54b828d4fb +generated: "2021-01-24T18:56:05.9746959+01:00" diff --git a/charts/commento/Chart.yaml b/charts/commento/Chart.yaml index e588bde5d3890b558778d77b6c5070f1fcfdc73a..e3ea676a63f9df9592c1a964f6126fcb98720e8f 100644 --- a/charts/commento/Chart.yaml +++ b/charts/commento/Chart.yaml @@ -7,12 +7,12 @@ type: application maintainers: - name: groundhog2k -version: 0.1.9 +version: 0.1.10 -appVersion: v1.8.0 +appVersion: "v1.8.0" dependencies: - name: postgres - version: 0.2.5 + version: 0.2.7 repository: "https://groundhog2k.github.io/helm-charts" condition: postgres.enabled diff --git a/charts/commento/README.md b/charts/commento/README.md index 433f89b4a631694c24461b1d461477aedb8fdea4..2855311f0621a5989f687600c735f9db00ae8a90 100644 --- a/charts/commento/README.md +++ b/charts/commento/README.md @@ -1,6 +1,6 @@ # Commento -   +   A Helm chart for Commento on Kubernetes @@ -45,7 +45,7 @@ $ helm uninstall my-release | Repository | Name | Version | |------------|------|---------| -| @groundhog2k | postgres | 0.2.5 | +| @groundhog2k | postgres | 0.2.7 | ## Common parameters @@ -62,8 +62,11 @@ $ helm uninstall my-release | image.repository | string | `"registry.gitlab.com/commento/commento"` | Image name | | image.tag | string | `""` | Image tag | | imagePullSecrets | list | `[]` | Image pull secrets | +| strategy | object | `{}` | Pod deployment strategy | | livenessProbe | object | `see values.yaml` | Liveness probe configuration | | readinessProbe | object | `see values.yaml` | Readiness probe configuration | +| customLivenessProbe | object | `{}` | Custom liveness probe (overwrites default liveness probe configuration) | +| customReadinessProbe | object | `{}` | Custom readiness probe (overwrites default readiness probe configuration) | | resources | object | `{}` | Resource limits and requests | | nodeSelector."kubernetes.io/arch" | string | `"amd64"` | Deployment node selector | | podAnnotations | object | `{}` | Additional pod annotations | diff --git a/charts/commento/charts/postgres-0.2.5.tgz b/charts/commento/charts/postgres-0.2.5.tgz deleted file mode 100644 index c2b41d43ffbc183aa96b8e09f0f01cfb08498002..0000000000000000000000000000000000000000 Binary files a/charts/commento/charts/postgres-0.2.5.tgz and /dev/null differ diff --git a/charts/commento/charts/postgres-0.2.7.tgz b/charts/commento/charts/postgres-0.2.7.tgz new file mode 100644 index 0000000000000000000000000000000000000000..a8a63a1a22cfb6b9817154979215a15069d38d84 Binary files /dev/null and b/charts/commento/charts/postgres-0.2.7.tgz differ diff --git a/charts/commento/templates/_helpers.tpl b/charts/commento/templates/_helpers.tpl index 4f67e5b7bff0e027dfd02c7d02cd05aacb6bd601..c40570258a2be974df78ffe9d32877064757c021 100644 --- a/charts/commento/templates/_helpers.tpl +++ b/charts/commento/templates/_helpers.tpl @@ -73,3 +73,27 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Commento settings via environment variables +*/}} +{{- define "commento.environment" -}} +- name: COMMENTO_FORBID_NEW_OWNERS + value: {{ .Values.settings.forbidNewOwners | quote }} +- name: COMMENTO_GZIP_STATIC + value: {{ .Values.settings.gzipStaticContent | quote }} +- name: COMMENTO_PORT + value: {{ .Values.containerPort | quote }} +- name: COMMENTO_ORIGIN + value: {{ (printf "%s://%s" .Values.settings.protocol .Values.ingress.host) | quote }} +{{- with .Values.settings.smtp }} + {{- if .enabled }} + - name: COMMENTO_SMTP_HOST + value: {{ .host | quote }} + - name: COMMENTO_SMTP_PORT + value: {{ .port | quote }} + - name: COMMENTO_SMTP_FROM_ADDRESS + value: {{ .from | quote }} + {{- end }} +{{- end }} +{{- end }} diff --git a/charts/commento/templates/deployment.yaml b/charts/commento/templates/deployment.yaml index cea432227691f874f289fca55898c12a2524951b..6ceedef86a7cd5ba8b34145fbfa6f2c9c0d058fa 100644 --- a/charts/commento/templates/deployment.yaml +++ b/charts/commento/templates/deployment.yaml @@ -9,10 +9,15 @@ spec: selector: matchLabels: {{- include "commento.selectorLabels" . | nindent 6 }} + {{- with .Values.strategy }} + strategy: + {{- toYaml . | nindent 4 }} + {{- end }} template: metadata: - {{- with .Values.podAnnotations }} annotations: + checksum/secureconfig: {{ include (print $.Template.BasePath "/secureconfig.yaml") . | sha256sum }} + {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} labels: @@ -47,6 +52,10 @@ spec: httpHeaders: - name: Host value: localhost:{{ .Values.containerPort }} + {{- if .Values.customLivenessProbe }} + livenessProbe: + {{- toYaml .Values.customLivenessProbe | nindent 12 }} + {{- else }} {{- with .Values.livenessProbe }} initialDelaySeconds: {{ .initialDelaySeconds }} timeoutSeconds: {{ .timeoutSeconds }} @@ -55,6 +64,11 @@ spec: periodSeconds: {{ .periodSeconds }} {{- end }} {{- end }} + {{- end }} + {{- if .Values.customReadinessProbe }} + readinessProbe: + {{- toYaml .Values.customReadinessProbe | nindent 12 }} + {{- else }} {{- if .Values.readinessProbe.enabled }} readinessProbe: httpGet: @@ -71,6 +85,7 @@ spec: periodSeconds: {{ .periodSeconds }} {{- end }} {{- end }} + {{- end }} {{- with .Values.resources }} resources: {{- toYaml . | nindent 12 }} @@ -79,14 +94,7 @@ spec: - secretRef: name: {{ include "commento.fullname" . }} env: - - name: COMMENTO_FORBID_NEW_OWNERS - value: {{ .Values.settings.forbidNewOwners | quote }} - - name: COMMENTO_GZIP_STATIC - value: {{ .Values.settings.gzipStaticContent |quote }} - - name: COMMENTO_PORT - value: {{ .Values.containerPort | quote }} - - name: COMMENTO_ORIGIN - value: {{ .Values.settings.protocol }}://{{ .Values.ingress.host }} + {{- include "commento.environment" . | nindent 12 }} {{- with .Values.env }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/commento/templates/secrets.yaml b/charts/commento/templates/secrets.yaml deleted file mode 100644 index 94ba6d04def34607bdb1bf8402e46c5e862a7501..0000000000000000000000000000000000000000 --- a/charts/commento/templates/secrets.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "commento.fullname" . }} - labels: - {{- include "commento.labels" . | nindent 4 }} -type: Opaque -stringData: -{{- if .Values.postgres.enabled }} - COMMENTO_POSTGRES: postgres://{{ .Values.postgres.userDatabase.user }}:{{ .Values.postgres.userDatabase.password }}@{{ include "postgres.servicename" . }}:{{ .Values.postgres.service.port }}/{{ .Values.postgres.userDatabase.name }}?sslmode=disable -{{- else }} -{{- with .Values.externalDatabase }} - COMMENTO_POSTGRES: postgres://{{ .user }}:{{ .password }}@{{ .host }}:{{ .port }}/{{ .name }}?sslmode=disable -{{- end }} -{{- end }} -{{- with .Values.settings.smtp }} - {{- if .enabled }} - COMMENTO_SMTP_HOST: {{ .host }} - COMMENTO_SMTP_PORT: {{ .port | quote }} - COMMENTO_SMTP_USERNAME: {{ .name }} - COMMENTO_SMTP_PASSWORD: {{ .password | quote }} - COMMENTO_SMTP_FROM_ADDRESS: {{ .from }} - {{- end }} -{{- end }} -{{- if .Values.settings.akismetKey }} - COMMENTO_AKISMET_KEY: {{ .Values.settings.akismetKey | quote }} -{{- end }} -{{- with .Values.settings.oauth }} - {{- if .google.enabled }} - COMMENTO_GOOGLE_KEY: {{ .google.key | quote }} - COMMENTO_GOOGLE_SECRET: {{ .google.secret | quote }} - {{- end }} - {{- if .github.enabled }} - COMMENTO_GITHUB_KEY: {{ .github.key | quote }} - COMMENTO_GITHUB_SECRET: {{ .github.secret | quote }} - {{- end }} - {{- if .gitlab.enabled }} - COMMENTO_GITLAB_KEY: {{ .gitlab.key | quote }} - COMMENTO_GITLAB_SECRET: {{ .gitlab.secret | quote }} - {{- end }} - {{- if .twitter.enabled }} - COMMENTO_TWITTER_KEY: {{ .twitter.key | quote }} - COMMENTO_TWITTER_SECRET: {{ .twitter.secret | quote }} - {{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/commento/templates/secureconfig.yaml b/charts/commento/templates/secureconfig.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2dea83e8792f9fbf242ed44440242ece0ba39943 --- /dev/null +++ b/charts/commento/templates/secureconfig.yaml @@ -0,0 +1,42 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "commento.fullname" . }} + labels: + {{- include "commento.labels" . | nindent 4 }} +type: Opaque +data: +{{- if .Values.postgres.enabled }} + COMMENTO_POSTGRES: {{ (printf "postgres://%s:%s@%s:%s/%s?sslmode=disable" .Values.postgres.userDatabase.user .Values.postgres.userDatabase.password (include "postgres.servicename" .) (.Values.postgres.service.port | toString) .Values.postgres.userDatabase.name) | b64enc }} +{{- else }} +{{- with .Values.externalDatabase }} + COMMENTO_POSTGRES: {{ (printf "mongodb://%s:%s@%s/%s?sslmode=disable" .user .password .host (.port | toString) .name) | b64enc }} +{{- end }} +{{- end }} +{{- with .Values.settings.smtp }} + {{- if .enabled }} + COMMENTO_SMTP_USERNAME: {{ .name | b64enc }} + COMMENTO_SMTP_PASSWORD: {{ .password | b64enc }} + {{- end }} +{{- end }} +{{- if .Values.settings.akismetKey }} + COMMENTO_AKISMET_KEY: {{ .Values.settings.akismetKey | b64enc }} +{{- end }} +{{- with .Values.settings.oauth }} + {{- if .google.enabled }} + COMMENTO_GOOGLE_KEY: {{ .google.key | b64enc }} + COMMENTO_GOOGLE_SECRET: {{ .google.secret | b64enc }} + {{- end }} + {{- if .github.enabled }} + COMMENTO_GITHUB_KEY: {{ .github.key | b64enc }} + COMMENTO_GITHUB_SECRET: {{ .github.secret | b64enc }} + {{- end }} + {{- if .gitlab.enabled }} + COMMENTO_GITLAB_KEY: {{ .gitlab.key | b64enc }} + COMMENTO_GITLAB_SECRET: {{ .gitlab.secret | b64enc }} + {{- end }} + {{- if .twitter.enabled }} + COMMENTO_TWITTER_KEY: {{ .twitter.key | b64enc }} + COMMENTO_TWITTER_SECRET: {{ .twitter.secret | b64enc }} + {{- end }} +{{- end }} diff --git a/charts/commento/values.yaml b/charts/commento/values.yaml index 907fd239351a2ea859b89aecfa293456c13eb747..24e5a88e2d67deedd4d613fa1ad073d36c74eaea 100644 --- a/charts/commento/values.yaml +++ b/charts/commento/values.yaml @@ -12,6 +12,9 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +## Pod deployment strategy +strategy: {} + ## Optional service account serviceAccount: # Specifies whether a service account should be created @@ -79,6 +82,9 @@ affinity: {} containerPort: 8080 +## Custom liveness probe (overwrites default liveness probe) +customLivenessProbe: {} + ## Default liveness probe livenessProbe: enabled: true @@ -88,6 +94,9 @@ livenessProbe: successThreshold: 1 periodSeconds: 10 +## Custom readiness probe (overwrites default readiness probe) +customReadinessProbe: {} + ## Default readiness probe readinessProbe: enabled: true