Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add properties imagePullSecrets #28

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/dso-console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ A Helm chart to deploy Cloud Pi Native Console
| config.secrets | object | `{}` | Secrets to inject into the configuration. It is needed for server to get services informations such as urls, admin username, admin password or token, etc. |
| fullnameOverride | string | `""` | String to fully override the default application name. |
| global.env | object | `{"NODE_ENV":"production"}` | Map of environment variables to inject into backend and frontend containers. |
| global.imagePullSecrets | list | `[]` | |
| global.keycloak.clientIds.backend | string | `"console-backend"` | Keycloak clientId used for Console CPN client. |
| global.keycloak.clientIds.frontend | string | `"console-frontend"` | Keycloak clientId used for frontend. |
| global.keycloak.clientSecrets.backend | string | `""` | Keycloak clientSecret used for Console CPN client. |
Expand Down
17 changes: 17 additions & 0 deletions charts/dso-console/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ Create image pull secret
{{- end }}
{{- end }}

{{/*
Define image pull secret properties
*/}}
{{- define "cpnConsole.renderImagePullSecrets" }}
{{- $hasImagePullSecrets := (or (not (empty .Values.global.imagePullSecrets)) (and .Values.imageCredentials.username .Values.imageCredentials.password) ) }}
{{- if $hasImagePullSecrets }}
imagePullSecrets:
{{- if (and .Values.imageCredentials.username .Values.imageCredentials.password) }}
{{- $secretName := printf "%s-pullsecret" (include "cpnConsole.name" .)}}
- name: {{ $secretName }}
{{- end }}
{{- range .Values.global.imagePullSecrets | uniq }}
- name: {{ . }}
{{- end -}}
{{- end }}
{{- end }}


{{/*
Create container environment variables from configmap
Expand Down
5 changes: 1 addition & 4 deletions charts/dso-console/templates/client/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if and .Values.imageCredentials.username .Values.imageCredentials.password }}
imagePullSecrets:
- name: {{ include "cpnConsole.name" . }}-pullsecret
{{- end }}
{{ include "cpnConsole.renderImagePullSecrets" . | nindent 6 }}
securityContext:
{{- toYaml .Values.client.podSecurityContext | nindent 8 }}
{{- if .Values.client.initContainers }}
Expand Down
5 changes: 1 addition & 4 deletions charts/dso-console/templates/server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if and .Values.imageCredentials.username .Values.imageCredentials.password }}
imagePullSecrets:
- name: {{ include "cpnConsole.name" . }}-pullsecret
{{- end }}
{{ include "cpnConsole.renderImagePullSecrets" . | nindent 6 }}
serviceAccountName: {{ include "cpnConsole.server.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.server.podSecurityContext | nindent 8 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/dso-console/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ global:
# -- Map of environment variables to inject into backend and frontend containers.
env:
NODE_ENV: "production"


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manque un petit commentaire descriptif, préfixé de # -- pour prise en compte par helm-docs ;)

imagePullSecrets: []
# imagePullSecrets:
# - name: my-pull-secret

# -- Map of environment variables to inject into backend and frontend containers.
secrets: {}
## Global informations about the Keycloak instance that will be shared to the server and client.
Expand Down
Loading