Skip to content

Commit 86d3a4f

Browse files
authored
chore: use ecr registry and hardcode service account (#1906)
* chore: use ecr registry and hardcode service account * chore: update image registry in helm test * chore: add ci debug step * chore: update image registry in helm test * chore: use image.globalRegsitry for postgres * chore: update registry defaults * chore: fix helm test * chore: address review comments * chore: remove debug action * chore: do not push latest on ecr
1 parent 9bd1b3d commit 86d3a4f

File tree

7 files changed

+15
-8
lines changed

7 files changed

+15
-8
lines changed

.github/workflows/helm-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
context: .
2727
file: ./build/full/Dockerfile
2828
push: true
29-
tags: localhost:5000/canary-checker:latest
29+
tags: localhost:5000/flanksource/canary-checker:latest
3030
cache-from: type=registry,ref=docker.io/flanksource/canary-checker
3131

3232
- name: Update canary-checker image in helm chart
3333
uses: mikefarah/yq@master
3434
with:
35-
cmd: yq -i e '.image.repository = "kind-registry:5000/canary-checker"' chart/values.yaml
35+
cmd: yq -i e '.global.imageRegistry = "kind-registry:5000"' chart/values.yaml
3636

3737
- name: Setup Helm
3838
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5

chart/templates/_helpers.tpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,9 @@ control-plane: canary-checker
7171
Image Name
7272
*/}}
7373
{{- define "canary-checker.imageString" -}}
74-
{{ .Values.image.repository }}{{- if eq (lower .Values.image.type) "full" }}-full{{- end }}:{{ .Values.image.tag }}
74+
{{ tpl .Values.global.imageRegistry . }}/{{ tpl .Values.image.name . }}{{- if eq (lower .Values.image.type) "full" }}-full{{- end }}:{{ .Values.image.tag }}
75+
{{- end }}
76+
77+
{{- define "canary-checker.postgres.imageString" -}}
78+
{{ tpl .Values.global.imageRegistry . }}/supabase/postgres:14.1.0.89
7579
{{- end }}

chart/templates/clusterrolebinding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ roleRef:
88
name: {{ include "canary-checker.name" . }}-role
99
subjects:
1010
- kind: ServiceAccount
11-
name: {{ include "canary-checker.fullname" . }}-sa
11+
name: {{ .Values.serviceAccount.name }}
1212
namespace: {{ .Release.Namespace }}

chart/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ spec:
3737
labels:
3838
{{- include "canary-checker.selectorLabels" . | nindent 8 }}
3939
spec:
40-
serviceAccountName: {{ include "canary-checker.fullname" . }}-sa
40+
serviceAccountName: {{ .Values.serviceAccount.name }}
4141
volumes:
4242
{{- if eq .Values.dockerSocket true }}
4343
- name: dockersock

chart/templates/postgres-statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
spec:
2121
containers:
2222
- name: postgresql
23-
image: postgres:14
23+
image: {{ include "canary-checker.postgres.imageString" . }}
2424
volumeMounts:
2525
- name: postgresql
2626
mountPath: /data

chart/templates/serviceaccount.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: ServiceAccount
33
metadata:
4-
name: {{ include "canary-checker.fullname" . }}-sa
4+
name: {{ .Values.serviceAccount.name }}
55
{{- with .Values.serviceAccount.annotations }}
66
annotations:
77
{{- toYaml . | nindent 4 }}

chart/values.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Declare variables to be passed into your templates.
44

55
global:
6+
imageRegistry: docker.io
7+
imagePrefix: flanksource
68
db:
79
connectionPooler:
810
enabled: false
@@ -13,7 +15,7 @@ global:
1315
replicas: 1
1416

1517
image:
16-
repository: docker.io/flanksource/canary-checker
18+
name: '{{.Values.global.imagePrefix}}/canary-checker'
1719
## Options: minimal | full
1820
## full image is larger and requires more permissions to run, but is required to execute 3rd party checks (jmeter, restic, k6 etc)
1921
type: minimal
@@ -148,6 +150,7 @@ resources:
148150
memory: 2Gi
149151

150152
serviceAccount:
153+
name: canary-checker-sa
151154
# Configures extra annotations on the service account
152155
# annotations:
153156
# some: annotation

0 commit comments

Comments
 (0)