diff --git a/PendingReleaseNotes.md b/PendingReleaseNotes.md index f324e49ca..11a0c72f3 100644 --- a/PendingReleaseNotes.md +++ b/PendingReleaseNotes.md @@ -64,6 +64,7 @@ an example usage - The CSI driver is enabled by default. Documentation has been changed significantly for block and filesystem to use the CSI driver instead of flex. While the flex driver is still supported, it is anticipated to be deprecated soon. - The `Mon.PreferredCount` setting has been removed. +- imagePullSecrets option added to helm-chart ## Known Issues diff --git a/cluster/charts/rook-ceph/templates/_helpers.tpl b/cluster/charts/rook-ceph/templates/_helpers.tpl index f0d83d2ed..529b49017 100644 --- a/cluster/charts/rook-ceph/templates/_helpers.tpl +++ b/cluster/charts/rook-ceph/templates/_helpers.tpl @@ -14,3 +14,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Define imagePullSecrets option to pass to all service accounts +*/}} +{{- define "imagePullSecrets" }} +{{- if .Values.imagePullSecrets -}} +imagePullSecrets: +{{ toYaml .Values.imagePullSecrets }} +{{- end -}} +{{- end -}} diff --git a/cluster/charts/rook-ceph/templates/serviceaccount.yaml b/cluster/charts/rook-ceph/templates/serviceaccount.yaml index e6948a091..6bbe75988 100644 --- a/cluster/charts/rook-ceph/templates/serviceaccount.yaml +++ b/cluster/charts/rook-ceph/templates/serviceaccount.yaml @@ -7,6 +7,7 @@ metadata: operator: rook storage-backend: ceph chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" +{{ template "imagePullSecrets" . }} --- # Service account for the Ceph OSDs. Must exist and cannot be renamed. apiVersion: v1 @@ -17,6 +18,7 @@ metadata: operator: rook storage-backend: ceph chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" +{{ template "imagePullSecrets" . }} --- # Service account for the Ceph Mgr. Must exist and cannot be renamed. apiVersion: v1 @@ -27,6 +29,7 @@ metadata: operator: rook storage-backend: ceph chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" +{{ template "imagePullSecrets" . }} --- apiVersion: v1 kind: ServiceAccount @@ -36,27 +39,32 @@ metadata: operator: rook storage-backend: ceph chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" +{{ template "imagePullSecrets" . }} --- # Service account for the cephfs csi driver apiVersion: v1 kind: ServiceAccount metadata: name: rook-csi-cephfs-plugin-sa +{{ template "imagePullSecrets" . }} --- # Service account for the cephfs csi provisioner apiVersion: v1 kind: ServiceAccount metadata: name: rook-csi-cephfs-provisioner-sa +{{ template "imagePullSecrets" . }} --- # Service account for the rbd csi driver apiVersion: v1 kind: ServiceAccount metadata: name: rook-csi-rbd-plugin-sa +{{ template "imagePullSecrets" . }} --- # Service account for the rbd csi provisioner apiVersion: v1 kind: ServiceAccount metadata: name: rook-csi-rbd-provisioner-sa +{{ template "imagePullSecrets" . }} diff --git a/cluster/charts/rook-ceph/values.yaml b/cluster/charts/rook-ceph/values.yaml index 9e8b8f938..95ff13bca 100644 --- a/cluster/charts/rook-ceph/values.yaml +++ b/cluster/charts/rook-ceph/values.yaml @@ -105,3 +105,7 @@ hostpathRequiresPrivileged: false # Disable automatic orchestration when new devices are discovered. disableDeviceHotplug: false + +# imagePullSecrets option allow to pull docker images from private docker registry. Option will be passed to all service accounts. +# imagePullSecrets: +# - name: my-registry-secret diff --git a/cluster/examples/kubernetes/ceph/common.yaml b/cluster/examples/kubernetes/ceph/common.yaml index 6ec0586d0..91caecfb3 100644 --- a/cluster/examples/kubernetes/ceph/common.yaml +++ b/cluster/examples/kubernetes/ceph/common.yaml @@ -703,6 +703,9 @@ metadata: labels: operator: rook storage-backend: ceph +# imagePullSecrets: +# - name: my-registry-secret + # OLM: END SERVICE ACCOUNT SYSTEM # OLM: BEGIN OPERATOR ROLEBINDING --- @@ -755,6 +758,9 @@ kind: ServiceAccount metadata: name: rook-ceph-osd namespace: rook-ceph +# imagePullSecrets: +# - name: my-registry-secret + # OLM: END SERVICE ACCOUNT OSD # OLM: BEGIN SERVICE ACCOUNT MGR --- @@ -764,6 +770,9 @@ kind: ServiceAccount metadata: name: rook-ceph-mgr namespace: rook-ceph +# imagePullSecrets: +# - name: my-registry-secret + # OLM: END SERVICE ACCOUNT MGR # OLM: BEGIN CMD REPORTER SERVICE ACCOUNT ---