Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
feat: add imagePullSecrets
Browse files Browse the repository at this point in the history
  • Loading branch information
lenglet-k committed Dec 7, 2023
1 parent 7df5ed2 commit f44cc92
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 3 deletions.
4 changes: 4 additions & 0 deletions templates/deployment-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ spec:
{{- end }}
app.kubernetes.io/component: registry
spec:
{{- with .Values.registry.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 6 }}
{{- end }}
serviceAccountName: {{ include "apicurio-registry.name" . }}
{{- with .Values.registry.initContainers }}
initContainers:
Expand Down
4 changes: 4 additions & 0 deletions templates/deployment-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ spec:
{{- end }}
app.kubernetes.io/component: sync
spec:
{{- with .Values.sync.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 6 }}
{{- end }}
serviceAccountName: {{ include "apicurio-registry.name" . }}
{{- with .Values.sync.initContainers }}
initContainers:
Expand Down
10 changes: 10 additions & 0 deletions test/lint/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ suite: lint registry values
templates:
- fake.yaml
tests:
- it: imagePullSecrets is not array
set:
registry:
imagePullSecrets: "qwe"
asserts:
- failedTemplate:
errorMessage: |
values don't meet the specifications of the schema(s) in the following chart(s):
apicurio-registry:
- registry.imagePullSecrets: Invalid type. Expected: array, given: string
- it: nodeSelector is not object
set:
registry:
Expand Down
10 changes: 10 additions & 0 deletions test/lint/sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ tests:
values don't meet the specifications of the schema(s) in the following chart(s):
apicurio-registry:
- sync.extraLabels: Invalid type. Expected: object, given: integer
- it: imagePullSecrets is not array
set:
sync:
imagePullSecrets: "qwe"
asserts:
- failedTemplate:
errorMessage: |
values don't meet the specifications of the schema(s) in the following chart(s):
apicurio-registry:
- sync.imagePullSecrets: Invalid type. Expected: array, given: string
- it: nodeSelector is not object
set:
sync:
Expand Down
9 changes: 9 additions & 0 deletions test/unit/deployment_registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ suite: test deployment-registry.yaml template
templates:
- deployment-registry.yaml
tests:
- it: set imagePullSecrets
set:
registry:
imagePullSecrets:
- name: mysecret
asserts:
- equal:
path: spec.template.spec.imagePullSecrets[0].name
value: mysecret
- it: no selector
asserts:
- notExists:
Expand Down
11 changes: 10 additions & 1 deletion test/unit/deployment_sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,13 @@ tests:
app.kubernetes.io/component: sync
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: apicurio-registry
testLabel: myLabel
testLabel: myLabel
- it: set imagePullSecrets
set:
sync:
imagePullSecrets:
- name: mysecret
asserts:
- equal:
path: spec.template.spec.imagePullSecrets[0].name
value: mysecret
7 changes: 6 additions & 1 deletion values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
"volumeMounts": {
"type": "array", "default": []
},
"imagePullSecrets": {
"type": "array", "default": []
},
"volumes": {
"type": "array", "default": []
},
Expand All @@ -67,7 +70,7 @@
"host": {"type": "string", "default": "apicurio.local", "title": "hostname"},
"path": {"type": "string", "default": "/", "title": "ingress path"},
"tls": {"type": "boolean", "default": false, "title": "enable TLS for ingress host",
"description": "if TLS enabled the certificate is retrieved from secret with the same name as ingress host"},
"description": "if TLS enabled the certificate is retrieved from secret with the same name as ingress host"},
"annotations": {"type": "object", "default": {}, "title": "ingress resource annotations"},
"labels": {"type": "object", "default": {}, "title": "ingress resource labels"}
}
Expand Down Expand Up @@ -105,6 +108,7 @@
"extraVolumes": {"$ref": "#/definitions/volumes", "title": "extra volumes for registry"},
"kafka": {"$ref": "#/definitions/persistence/kafka"},
"sql": {"$ref": "#/definitions/persistence/sql"},
"imagePullSecrets": {"$ref": "#/definitions/imagePullSecrets"},
"ingress": {"$ref": "#/definitions/ingress"},
"extraLabels": {"$ref": "#/definitions/labels", "title": "deployment and pod resources labels for registry"}
}
Expand All @@ -115,6 +119,7 @@
"properties": {
"enabled": {"$ref": "#/definitions/isEnabled"},
"image": {"$ref": "#/definitions/dockerImage"},
"imagePullSecrets": {"$ref": "#/definitions/imagePullSecrets"},
"nodeSelector": {"type": "object", "title": "node selector for registry content sync"},
"initContainers": {"$ref": "#/definitions/initContainers", "title": "init containers for registry content sync"},
"resources": {"$ref": "#/definitions/podResources"},
Expand Down
3 changes: 2 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
registry:
enabled: true

imagePullSecrets: []
## uncomment and adjust for kafka persistence
# kafka:
# bootstrapServers: kafka1:9092,kafka2:9092
Expand Down Expand Up @@ -54,6 +54,7 @@ registry:

sync:
enabled: true
imagePullSecrets: []
image:
registry: "quay.io"
repository: "apicurio/apicurio-registry-kube-sync"
Expand Down

0 comments on commit f44cc92

Please sign in to comment.