Skip to content

Commit

Permalink
feat: Overwrite individual images in values.yaml
Browse files Browse the repository at this point in the history
This enables greater flexibility and adaptability in highly restricted environments
while keeping the simple configuration as default.

The feature can also be used to set Guacamole to a fixed version to avoid restarts
during (possibly frequent) updates of the management portal.
  • Loading branch information
MoritzWeber0 committed May 28, 2024
1 parent 221ac2e commit 277f901
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/docs/admin/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ chmod 600 values.yaml

Adjust all values according to your needs.

!!! info

You can overwrite individual images by setting the `docker.images.*` values.
This is useful to set Guacamole to a fixed version to avoid restarts during updates,
which would lead to session interruptions.

## Step 7: Install the Application in the Cluster

Run the following commands in the root directory of the repository:
Expand Down
8 changes: 8 additions & 0 deletions helm/templates/backend/backend.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: {{ .Release.Name }}-backend
{{ if .Values.docker.images.backend }}
image: {{ .Values.docker.images.backend }}
{{ else }}
image: {{ .Values.docker.registry.internal }}/backend:{{ .Values.docker.tag }}
{{ end }}
ports:
- name: http
containerPort: 8000
Expand Down Expand Up @@ -96,7 +100,11 @@ spec:
{{ end }}
{{ if .Values.loki.enabled }}
- name: promtail
{{ if .Values.docker.images.promtail }}
image: {{ .Values.docker.images.promtail }}
{{ else }}
image: {{ .Values.docker.registry.external -}}/grafana/promtail
{{ end }}
args:
- "--config.file=/etc/promtail/promtail.yaml"
- "-log-config-reverse-order"
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/backend/postgres.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: {{ .Release.Name }}-backend-postgres
{{ if .Values.docker.images.postgres }}
image: {{ .Values.docker.images.postgres }}
{{ else }}
image: {{ .Values.docker.registry.external }}/postgres:14.1
{{ end }}
env:
- name: PGDATA
value: /var/lib/postgresql/data/data
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/docs/docs.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: {{ .Release.Name }}-docs
{{ if .Values.docker.images.docs }}
image: {{ .Values.docker.images.docs }}
{{ else }}
image: {{ .Values.docker.registry.internal }}/docs:{{ .Values.docker.tag }}
{{ end }}
ports:
- name: http
containerPort: 8080
Expand Down
8 changes: 8 additions & 0 deletions helm/templates/frontend/frontend.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: {{ .Release.Name }}-frontend
{{ if .Values.docker.images.frontend }}
image: {{ .Values.docker.images.frontend }}
{{ else }}
image: {{ .Values.docker.registry.internal }}/frontend:{{ .Values.docker.tag }}
{{ end }}
ports:
- name: http
containerPort: 8080
Expand Down Expand Up @@ -74,7 +78,11 @@ spec:
{{ end }}
{{ if .Values.loki.enabled }}
- name: promtail
{{ if .Values.docker.images.promtail }}
image: {{ .Values.docker.images.promtail }}
{{ else }}
image: {{ .Values.docker.registry.external -}}/grafana/promtail
{{ end }}
args:
- "--config.file=/etc/promtail/promtail.yaml"
- "-log-config-reverse-order"
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/grafana/grafana.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: grafana
{{ if .Values.docker.images.grafana }}
image: {{ .Values.docker.images.grafana }}
{{ else }}
image: {{ .Values.docker.registry.external }}/grafana/grafana:10.0.1
{{ end }}
ports:
- containerPort: 3000
resources:
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/grafana/nginx.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: {{ .Release.Name }}-grafana-nginx
{{ if .Values.docker.images.nginxUnprivileged }}
image: {{ .Values.docker.images.nginxUnprivileged }}
{{ else }}
image: {{ .Values.docker.registry.external }}/nginxinc/nginx-unprivileged
{{ end }}
ports:
- name: grafui
containerPort: 3118
Expand Down
8 changes: 8 additions & 0 deletions helm/templates/guacamole/guacamole.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: {{ .Release.Name }}-guacamole-guacamole
{{ if .Values.docker.images.guacamole.guacamole }}
image: {{ .Values.docker.images.guacamole.guacamole }}
{{ else }}
image: {{ .Values.docker.registry.internal }}/guacamole:{{ .Values.docker.tag }}
{{ end }}
env:
- name: GUACD_HOSTNAME
value: {{ .Release.Name }}-guacamole-guacd
Expand Down Expand Up @@ -109,7 +113,11 @@ spec:
{{ end }}
{{ if .Values.loki.enabled }}
- name: promtail
{{ if .Values.docker.images.promtail }}
image: {{ .Values.docker.images.promtail }}
{{ else }}
image: {{ .Values.docker.registry.external -}}/grafana/promtail
{{ end }}
args:
- "--config.file=/etc/promtail/promtail.yaml"
- "-log-config-reverse-order"
Expand Down
8 changes: 8 additions & 0 deletions helm/templates/guacamole/guacd.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: {{ .Release.Name }}-guacamole-guacd
{{ if .Values.docker.images.guacamole.guacd }}
image: {{ .Values.docker.images.guacamole.guacd }}
{{ else }}
image: {{ .Values.docker.registry.external }}/guacamole/guacd:1.5.2
{{ end }}
command: ["/bin/sh", "-c", "mkdir -p /home/guacd/logs; /opt/guacamole/sbin/guacd -b 0.0.0.0 -L $GUACD_LOG_LEVEL -f > >(tee -a /home/guacd/logs/stdout.log) 2> >(tee -a /home/guacd/logs/stderr.log >&2)"]
ports:
- name: guacd
Expand Down Expand Up @@ -81,7 +85,11 @@ spec:
{{ end }}
{{ if .Values.loki.enabled }}
- name: promtail
{{ if .Values.docker.images.promtail }}
image: {{ .Values.docker.images.promtail }}
{{ else }}
image: {{ .Values.docker.registry.external -}}/grafana/promtail
{{ end }}
args:
- "--config.file=/etc/promtail/promtail.yaml"
- "-log-config-reverse-order"
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/guacamole/postgres.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: {{ .Release.Name }}-guacamole-postgres
{{ if .Values.docker.images.postgres }}
image: {{ .Values.docker.images.postgres }}
{{ else }}
image: {{ .Values.docker.registry.external }}/postgres:14.1
{{ end }}
env:
- name: PGDATA
value: /var/lib/postgresql/data/data
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/mock/oauth.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: {{ .Release.Name }}-oauth-mock
{{ if .Values.docker.images.mockOauth2Server }}
image: {{ .Values.docker.images.mockOauth2Server }}
{{ else }}
image: {{ .Values.docker.registry.github }}/navikt/mock-oauth2-server:0.5.8
{{ end }}
ports:
- name: http
containerPort: 8080
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/prometheus/nginx.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: {{ .Release.Name }}-prometheus-nginx
{{ if .Values.docker.images.nginxUnprivileged }}
image: {{ .Values.docker.images.nginxUnprivileged }}
{{ else }}
image: {{ .Values.docker.registry.external }}/nginxinc/nginx-unprivileged
{{ end }}
ports:
- name: promui
containerPort: 9118
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/prometheus/prometheus.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: prometheus
{{ if .Values.docker.images.prometheus }}
image: {{ .Values.docker.images.prometheus }}
{{ else }}
image: {{ .Values.docker.registry.external }}/prom/prometheus
{{ end }}
args:
- "--storage.tsdb.retention.time=1y"
- "--config.file=/etc/prometheus/prometheus.yml"
Expand Down
4 changes: 4 additions & 0 deletions helm/templates/sessions/sessions.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ spec:
{{- include "capellacollab.pod.spec" . | indent 6 -}}
containers:
- name: {{ .Release.Name }}-session-nginx
{{ if .Values.docker.images.nginxUnprivileged }}
image: {{ .Values.docker.images.nginxUnprivileged }}
{{ else }}
image: {{ .Values.docker.registry.external }}/nginxinc/nginx-unprivileged
{{ end }}
ports:
- name: http
containerPort: 8080
Expand Down
20 changes: 20 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ docker:
# Docker tag for the internal images (e.g. main)
tag: main

# Optional section to overwrite images.
# The images have to be in the format <registry>/<image>:<tag>
# If not set, the images are derived from registry, image name and tag.
images:
guacamole:
# To avoid Guacamole restarts on every deployment, the Guacamole image can be set to a specific version.
guacamole: null
guacd: null

frontend: null
backend: null
docs: null

promtail: null
postgres: null
grafana: null
nginxUnprivileged: null
mockOauth2Server: null
prometheus: null

general:
# Base URL on which the service listens
host: localhost
Expand Down

0 comments on commit 277f901

Please sign in to comment.