Skip to content

Commit 1c7b828

Browse files
authored
pull secrets (#847)
1 parent 64c2231 commit 1c7b828

File tree

10 files changed

+30
-6
lines changed

10 files changed

+30
-6
lines changed

.github/workflows/deploy-to-k8s.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ jobs:
8484
--set meshweb.environment="${{ inputs.environment }}" \
8585
--set ingress.hosts[0].host="${{ vars.INGRESS_HOST }}",ingress.hosts[0].paths[0].path=/,ingress.hosts[0].paths[0].pathType=Prefix \
8686
--set ingress.hosts[1].host="${{ vars.INGRESS_HOST_LEGACY }}",ingress.hosts[1].paths[0].path=/,ingress.hosts[1].paths[0].pathType=Prefix \
87+
--set imageCredentials.username="${{ secrets.PULL_SECRET_USERNAME }}" \
88+
--set imageCredentials.password="${{ secrets.PULL_SECRET_PASSWORD }}" \
89+
--set imageCredentials.email="${{ secrets.PULL_SECRET_EMAIL }}" \
8790
--set meshweb.image.tag="${{ inputs.useTag }}"
8891
8992
# Rolling restart

infra/helm/meshdb/charts/celery/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
replicaCount: 1
33

44
image:
5-
repository: willnilges/meshdb
5+
repository: docker.io/willnilges/meshdb
66
pullPolicy: Always
77
tag: "main"
88

infra/helm/meshdb/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 }}

infra/helm/meshdb/templates/meshweb.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ metadata:
77
{{- include "meshdb.labels" . | nindent 4 }}
88
spec:
99
replicas: 3
10+
{{- if .Values.imageCredentials }}
11+
imagePullSecrets:
12+
- name: pull-secret
13+
{{- end }}
1014
selector:
1115
matchLabels:
1216
{{- include "meshdb.selectorLabels" . | nindent 6 }}

infra/helm/meshdb/templates/nginx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232
- name: {{ .Chart.Name }}-nginx
3333
securityContext:
3434
{{- toYaml .Values.nginx.securityContext | nindent 12 }}
35-
image: "nginx:latest"
35+
image: "docker.io/nginx:latest"
3636
imagePullPolicy: {{ .Values.image.pullPolicy }}
3737
ports:
3838
- name: nginx

infra/helm/meshdb/templates/pelias.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
- name: {{ .Chart.Name }}-pelias
3232
securityContext:
3333
{{- toYaml .Values.pelias.securityContext | nindent 12 }}
34-
image: "pelias/parser"
34+
image: "docker.io/pelias/parser"
3535
imagePullPolicy: {{ .Values.image.pullPolicy }}
3636
ports:
3737
- name: pelias

infra/helm/meshdb/templates/postgres.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ spec:
3333
- name: {{ .Chart.Name }}-postgres
3434
securityContext:
3535
{{- toYaml .Values.pg.securityContext | nindent 12 }}
36-
image: postgres:15-bookworm
36+
image: docker.io/postgres:15-bookworm
3737
imagePullPolicy: {{ .Values.image.pullPolicy }}
3838
ports:
3939
- name: postgres
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: pull-secret
5+
namespace: {{ .Values.meshdb_app_namespace }}
6+
type: kubernetes.io/dockerconfigjson
7+
data:
8+
.dockerconfigjson: {{ template "imagePullSecret" . }}

infra/helm/meshdb/templates/redis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
- name: {{ .Chart.Name }}-redis
4545
securityContext:
4646
{{- toYaml .Values.redis.securityContext | nindent 12 }}
47-
image: "redis:latest"
47+
image: "docker.io/redis:latest"
4848
imagePullPolicy: {{ .Values.image.pullPolicy }}
4949
ports:
5050
- name: redis

infra/helm/meshdb/values.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ meshweb:
4141
readiness_probe: "true"
4242
startup_probe: "true"
4343
image:
44-
repository: willnilges/meshdb
44+
repository: docker.io/willnilges/meshdb
4545
tag: main
4646
podSecurityContext: {}
4747
securityContext: {}
@@ -122,6 +122,9 @@ pelias:
122122
image:
123123
pullPolicy: Always
124124

125+
imageCredentials:
126+
registry: docker.io
127+
125128
nameOverride: ""
126129
fullnameOverride: "meshdb"
127130

0 commit comments

Comments
 (0)