diff --git a/api/v1alpha1/observatorium_types.go b/api/v1alpha1/observatorium_types.go index 109d1dd0..3af62c61 100644 --- a/api/v1alpha1/observatorium_types.go +++ b/api/v1alpha1/observatorium_types.go @@ -47,6 +47,9 @@ type ObservatoriumSpec struct { // Security options the pod should run with. // +optional SecurityContext *v1.SecurityContext `json:"securityContext,omitempty"` + // Pull secret used to pull the images. + // +optional + PullSecret string `json:"pullSecret,omitempty"` } type ThanosSpec struct { diff --git a/jsonnet/obs-operator.jsonnet b/jsonnet/obs-operator.jsonnet index 177e928b..9379b400 100644 --- a/jsonnet/obs-operator.jsonnet +++ b/jsonnet/obs-operator.jsonnet @@ -238,6 +238,18 @@ local operatorObs = obs { }, }, } else {} + ) + ( + if (std.objectHas(cr.spec, 'pullSecret') && (v.kind == 'StatefulSet' || v.kind == 'Deployment')) then { + template+: { + spec+:{ + imagePullSecrets: [ + { + name: cr.spec.pullSecret, + }, + ], + }, + }, + } else {} ), }, operatorObs.manifests), } diff --git a/manifests/crds/core.observatorium.io_observatoria.yaml b/manifests/crds/core.observatorium.io_observatoria.yaml index 20c00761..cb10af9c 100644 --- a/manifests/crds/core.observatorium.io_observatoria.yaml +++ b/manifests/crds/core.observatorium.io_observatoria.yaml @@ -733,6 +733,9 @@ spec: required: - thanos type: object + pullSecret: + description: Pull secret used to pull the images. + type: string securityContext: description: Security options the pod should run with. properties: