Skip to content

Commit 64cba54

Browse files
authored
add pull secret (#9)
1 parent 562ca75 commit 64cba54

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

.github/workflows/helm_deploy.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
-f ./website-map/values.yaml \
4949
--set app_namespace="${{ vars.APP_NAMESPACE }}" \
5050
--set fqdn="${{ vars.FQDN }}" \
51+
--set imageCredentials.username="${{ secrets.PULL_SECRET_USERNAME }}" \
52+
--set imageCredentials.password="${{ secrets.PULL_SECRET_PASSWORD }}" \
53+
--set imageCredentials.email="${{ secrets.PULL_SECRET_EMAIL }}" \
5154
--set github_client_id="${{ secrets.GH_CLIENT_ID }}" \
5255
--set github_install_id="${{ secrets.GH_INSTALL_ID }}" \
5356
--set github_secret="${{ secrets.GH_APP_KEY }}"

website-map/templates/_helpers.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,9 @@ Create the name of the service account to use
6060
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}
6262
{{- end }}
63+
64+
{{- define "imagePullSecret" }}
65+
{{- with .Values.imageCredentials }}
66+
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
67+
{{- end }}
68+
{{- end }}

website-map/templates/backend.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ spec:
2525
spec:
2626
securityContext:
2727
{{- toYaml .Values.podSecurityContext | nindent 8 }}
28+
{{- if .Values.imageCredentials }}
29+
imagePullSecrets:
30+
- name: pull-secret
31+
{{- end }}
2832
containers:
2933
- name: {{ .Chart.Name }}-backend
3034
securityContext:

website-map/values.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
backend:
22
replicaCount: 1
33
image:
4-
repository: nginx
4+
repository: docker.io/nginx
55
pullPolicy: IfNotPresent
66
tag: "latest"
77
service:
@@ -16,10 +16,13 @@ backend:
1616

1717
cron:
1818
image:
19-
repository: python
19+
repository: docker.io/python
2020
pullPolicy: IfNotPresent
2121
tag: "3.13-alpine"
2222

23+
imageCredentials:
24+
registry: docker.io
25+
2326
pvc_name: "website-map-data"
2427
pvc_size: "1Gi"
2528

0 commit comments

Comments
 (0)