From ee39aeb7ee27c92571c4ea9e128267915682105e Mon Sep 17 00:00:00 2001 From: Mattias Persson Date: Mon, 8 Jun 2026 14:01:47 +0200 Subject: [PATCH 1/5] Support global.imagePullSecrets in solr-operator helm chart Adds global.imagePullSecrets to the solr-operator deployment pod spec. The existing image.imagePullSecret was rendered inside containers[], which is not a valid Kubernetes field and is silently ignored. This places imagePullSecrets at the correct pod spec level and supports both Kubernetes-native format ([{name: "secret"}]) and plain strings. Closes #338 --- helm/solr-operator/Chart.yaml | 7 +++++++ helm/solr-operator/README.md | 1 + helm/solr-operator/templates/deployment.yaml | 10 ++++++++++ helm/solr-operator/values.yaml | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/helm/solr-operator/Chart.yaml b/helm/solr-operator/Chart.yaml index 81138d09..29fe1cc5 100644 --- a/helm/solr-operator/Chart.yaml +++ b/helm/solr-operator/Chart.yaml @@ -55,6 +55,13 @@ annotations: # Allowed syntax is described at: https://artifacthub.io/docs/topics/annotations/helm/#example # 'kind' accepts values: "added", "changed", "deprecated", "removed", "fixed" and "security" artifacthub.io/changes: | + - kind: added + description: Support global.imagePullSecrets for pulling images from private registries + links: + - name: Github Issue + url: https://github.com/apache/solr-operator/issues/338 + - name: Github PR + url: https://github.com/apache/solr-operator/pull/343 - kind: changed description: A container PostStart Hook is no longer used to create the ZooKeeper ChRoot, instead the initContainer will manage this links: diff --git a/helm/solr-operator/README.md b/helm/solr-operator/README.md index 2e44b873..57dd5b03 100644 --- a/helm/solr-operator/README.md +++ b/helm/solr-operator/README.md @@ -171,6 +171,7 @@ The command removes all the Kubernetes components associated with the chart and | Key | Type | Default | Description | |-----|------|---------|-------------| +| global.imagePullSecrets | []object/string | `[]` | Secrets for pulling images from private registries. Accepts both Kubernetes-native format (`[{name: "secret"}]`) and plain strings (`["secret"]`). | | image.repository | string | `"apache/solr-operator"` | The repository of the Solr Operator image | | image.tag | string | `"v0.10.0-prerelease"` | The tag/version of the Solr Operator to run | | image.pullPolicy | string | `"IfNotPresent"` | | diff --git a/helm/solr-operator/templates/deployment.yaml b/helm/solr-operator/templates/deployment.yaml index 1c13fae4..63a8d3f6 100644 --- a/helm/solr-operator/templates/deployment.yaml +++ b/helm/solr-operator/templates/deployment.yaml @@ -38,6 +38,16 @@ spec: {{ toYaml .Values.labels | nindent 8 }} {{- end }} spec: + {{- with .Values.global.imagePullSecrets }} + imagePullSecrets: + {{- range . }} + {{- if kindIs "string" . }} + - name: {{ . }} + {{- else }} + - {{ toYaml . | nindent 10 }} + {{- end }} + {{- end }} + {{- end }} serviceAccountName: {{ include "solr-operator.serviceAccountName" . }} {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} diff --git a/helm/solr-operator/values.yaml b/helm/solr-operator/values.yaml index efdbe0a0..541adc72 100644 --- a/helm/solr-operator/values.yaml +++ b/helm/solr-operator/values.yaml @@ -19,6 +19,11 @@ replicaCount: 1 +global: + # List the secrets needed to pull images from a private registry. + # Accepts both Kubernetes-native format [{name: "secret"}] and plain strings ["secret"]. + imagePullSecrets: [] + # Development mode configures certain settings for convenient development. # When 'true', logging will use: encoder=console, level=debug, stacktrace-level=warn development: false From dcc4709678e35c3540dc6a6f32fe0f93bf2a7fa0 Mon Sep 17 00:00:00 2001 From: Houston Putman Date: Thu, 18 Jun 2026 11:32:56 -0700 Subject: [PATCH 2/5] Add support in both charts, merge local and global. Add changelog and docs --- helm/solr-operator/Chart.yaml | 13 +++++++------ helm/solr-operator/templates/deployment.yaml | 11 +++++------ helm/solr/Chart.yaml | 7 +++++++ helm/solr/README.md | 4 ++-- helm/solr/templates/_custom_option_helpers.tpl | 8 +++++++- helm/solr/values.yaml | 5 +++++ 6 files changed, 33 insertions(+), 15 deletions(-) diff --git a/helm/solr-operator/Chart.yaml b/helm/solr-operator/Chart.yaml index f472a914..14e9b982 100644 --- a/helm/solr-operator/Chart.yaml +++ b/helm/solr-operator/Chart.yaml @@ -56,12 +56,6 @@ annotations: # 'kind' accepts values: "added", "changed", "deprecated", "removed", "fixed" and "security" artifacthub.io/changes: | - kind: added - description: Support global.imagePullSecrets for pulling images from private registries - links: - - name: Github Issue - url: https://github.com/apache/solr-operator/issues/338 - - name: Github PR - url: https://github.com/apache/solr-operator/pull/343 description: The operator can now resize (expand) persistent data PVCs, which requires new RBAC permissions for persistentvolumeclaims (update/patch) and storageclasses (get/list/watch) links: - name: Github Issue @@ -130,6 +124,13 @@ annotations: url: https://github.com/apache/solr-operator/issues/817 - name: Github PR url: https://github.com/apache/solr-operator/pull/818 + - kind: added + description: Support global.imagePullSecrets for pulling images from private registries + links: + - name: Github Issue + url: https://github.com/apache/solr-operator/issues/338 + - name: Github PR + url: https://github.com/apache/solr-operator/pull/832 artifacthub.io/images: | - name: solr-operator image: apache/solr-operator:v0.10.0-prerelease diff --git a/helm/solr-operator/templates/deployment.yaml b/helm/solr-operator/templates/deployment.yaml index 3d67d7b9..0b1e3eae 100644 --- a/helm/solr-operator/templates/deployment.yaml +++ b/helm/solr-operator/templates/deployment.yaml @@ -38,24 +38,23 @@ spec: {{ toYaml .Values.labels | nindent 8 }} {{- end }} spec: - {{- with .Values.global.imagePullSecrets }} + {{- if or .Values.global.imagePullSecrets .Values.image.imagePullSecret }} imagePullSecrets: - {{- range . }} + {{- range .Values.global.imagePullSecrets }} {{- if kindIs "string" . }} - name: {{ . }} {{- else }} - {{ toYaml . | nindent 10 }} {{- end }} {{- end }} + {{- with .Values.image.imagePullSecret }} + - name: {{ . }} + {{- end }} {{- end }} serviceAccountName: {{ include "solr-operator.serviceAccountName" . }} {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} {{- end }} - {{- if .Values.image.imagePullSecret }} - imagePullSecrets: - - name: {{ .Values.image.imagePullSecret }} - {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/helm/solr/Chart.yaml b/helm/solr/Chart.yaml index 224b3edf..29a4bafb 100644 --- a/helm/solr/Chart.yaml +++ b/helm/solr/Chart.yaml @@ -53,6 +53,13 @@ annotations: links: - name: Github PR url: https://github.com/apache/solr-operator/pull/811 + - kind: added + description: global.imagePullSecrets and podOptions.imagePullSecrets now accept plain strings in addition to objects, and are merged correctly into the Solr pods + links: + - name: Github Issue + url: https://github.com/apache/solr-operator/issues/338 + - name: Github PR + url: https://github.com/apache/solr-operator/pull/832 artifacthub.io/containsSecurityUpdates: "false" artifacthub.io/recommendations: | - url: https://artifacthub.io/packages/helm/apache-solr/solr-operator diff --git a/helm/solr/README.md b/helm/solr/README.md index 2d95171a..a7a10786 100644 --- a/helm/solr/README.md +++ b/helm/solr/README.md @@ -265,7 +265,7 @@ Configure Solr to use a separate TLS certificate for client auth. | Key | Type | Default | Description | |-----|------|---------|-------------| -| global.imagePullSecrets | []object | | The list of imagePullSecrets to include in pods | +| global.imagePullSecrets | []object/string | | The list of imagePullSecrets to include in all pods (Solr and ZK). Accepts both Kubernetes-native format (`[{name: "secret"}]`) and plain strings (`["secret"]`). | | global.clusterDomain | string | | The cluster domain the Kubernetes is addressed under. | ### Custom Kubernetes Options @@ -300,7 +300,7 @@ When using the helm chart, omit `customSolrKubeOptions.` | podOptions.readinessProbe | object | | Custom readiness probe for the Solr container | | podOptions.startupProbe | object | | Custom startup probe for the Solr container | | podOptions.lifecycle | object | | Custom lifecycle for the Solr container | -| podOptions.imagePullSecrets | []object | | List of image pull secrets to inject into the Solr pod, in addition to `global.imagePullSecrets` | +| podOptions.imagePullSecrets | []object/string | | List of image pull secrets to inject into the Solr pod, in addition to `global.imagePullSecrets`. Accepts both Kubernetes-native format (`[{name: "secret"}]`) and plain strings (`["secret"]`). | | podOptions.volumes | []object | | List of additional volumes to attach to the Solr pod, and optionally how to mount them to the Solr container | | statefulSetOptions.annotations | map[string]string | | Custom annotations to add to the Solr statefulSet | | statefulSetOptions.labels | map[string]string | | Custom labels to add to the Solr statefulSet | diff --git a/helm/solr/templates/_custom_option_helpers.tpl b/helm/solr/templates/_custom_option_helpers.tpl index 4082e6c4..441fb67d 100644 --- a/helm/solr/templates/_custom_option_helpers.tpl +++ b/helm/solr/templates/_custom_option_helpers.tpl @@ -71,7 +71,13 @@ containerSecurityContext: {{ end }} {{- if (or .Values.podOptions.imagePullSecrets .Values.global.imagePullSecrets) -}} imagePullSecrets: - {{- toYaml (append .Values.podOptions.imagePullSecrets .Values.global.imagePullSecrets) | nindent 2 }} +{{- range (concat .Values.podOptions.imagePullSecrets .Values.global.imagePullSecrets) }} +{{- if kindIs "string" . }} + - name: {{ . }} +{{- else }} + - {{ toYaml . | nindent 4 }} +{{- end }} +{{- end }} {{ end }} {{- if .Values.podOptions.volumes -}} volumes: diff --git a/helm/solr/values.yaml b/helm/solr/values.yaml index 595fd85f..281a7579 100644 --- a/helm/solr/values.yaml +++ b/helm/solr/values.yaml @@ -24,6 +24,9 @@ fullnameOverride: "" replicas: null global: + # List the secrets needed to pull images from a private registry. + # Accepts both Kubernetes-native format [{name: "secret"}] and plain strings ["secret"]. + # These are merged with podOptions.imagePullSecrets and applied to the Solr pods. imagePullSecrets: [] clusterDomain: "" @@ -325,6 +328,8 @@ podOptions: # Lifecycle for the Solr container lifecycle: {} + # List of image pull secrets to inject into the Solr pod, in addition to global.imagePullSecrets. + # Accepts both Kubernetes-native format [{name: "secret"}] and plain strings ["secret"]. imagePullSecrets: [] resources: {} From ee4c300a9f426d0fc874e0466956248c845e692c Mon Sep 17 00:00:00 2001 From: Houston Putman Date: Thu, 18 Jun 2026 11:47:24 -0700 Subject: [PATCH 3/5] Validate object and make all entries 1 line --- helm/solr-operator/templates/deployment.yaml | 2 +- helm/solr/templates/_custom_option_helpers.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/solr-operator/templates/deployment.yaml b/helm/solr-operator/templates/deployment.yaml index 0b1e3eae..2def7ef7 100644 --- a/helm/solr-operator/templates/deployment.yaml +++ b/helm/solr-operator/templates/deployment.yaml @@ -44,7 +44,7 @@ spec: {{- if kindIs "string" . }} - name: {{ . }} {{- else }} - - {{ toYaml . | nindent 10 }} + - name: {{ required "Each entry in global.imagePullSecrets must be a string or an object with a 'name' field" .name }} {{- end }} {{- end }} {{- with .Values.image.imagePullSecret }} diff --git a/helm/solr/templates/_custom_option_helpers.tpl b/helm/solr/templates/_custom_option_helpers.tpl index 441fb67d..b74c52d2 100644 --- a/helm/solr/templates/_custom_option_helpers.tpl +++ b/helm/solr/templates/_custom_option_helpers.tpl @@ -75,7 +75,7 @@ imagePullSecrets: {{- if kindIs "string" . }} - name: {{ . }} {{- else }} - - {{ toYaml . | nindent 4 }} + - name: {{ required "Each entry in imagePullSecrets must be a string or an object with a 'name' field" .name }} {{- end }} {{- end }} {{ end }} From cb0995bea1f1b4773e8f00c761b79125e67b068b Mon Sep 17 00:00:00 2001 From: Mattias Persson Date: Thu, 18 Jun 2026 20:51:32 +0200 Subject: [PATCH 4/5] Fix identation --- helm/solr-operator/Chart.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/helm/solr-operator/Chart.yaml b/helm/solr-operator/Chart.yaml index 14e9b982..39ba9afd 100644 --- a/helm/solr-operator/Chart.yaml +++ b/helm/solr-operator/Chart.yaml @@ -125,12 +125,12 @@ annotations: - name: Github PR url: https://github.com/apache/solr-operator/pull/818 - kind: added - description: Support global.imagePullSecrets for pulling images from private registries - links: - - name: Github Issue - url: https://github.com/apache/solr-operator/issues/338 - - name: Github PR - url: https://github.com/apache/solr-operator/pull/832 + description: Support global.imagePullSecrets for pulling images from private registries + links: + - name: Github Issue + url: https://github.com/apache/solr-operator/issues/338 + - name: Github PR + url: https://github.com/apache/solr-operator/pull/832 artifacthub.io/images: | - name: solr-operator image: apache/solr-operator:v0.10.0-prerelease From 1f96816bc82dc2110f976dd7352d37234e0a58eb Mon Sep 17 00:00:00 2001 From: Houston Putman Date: Thu, 18 Jun 2026 11:50:19 -0700 Subject: [PATCH 5/5] Fix changelog indentation, and text --- helm/solr-operator/Chart.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/solr-operator/Chart.yaml b/helm/solr-operator/Chart.yaml index 14e9b982..81ba86c5 100644 --- a/helm/solr-operator/Chart.yaml +++ b/helm/solr-operator/Chart.yaml @@ -106,7 +106,7 @@ annotations: - name: Github PR url: https://github.com/apache/solr-operator/pull/790 - kind: fixed - description: Correct the placement and syntax of the imagePullSecret in the Solr-Operator Helm chart + description: Correct the placement and syntax of the image.imagePullSecret in the Solr-Operator Helm chart links: - name: Github PR url: https://github.com/apache/solr-operator/pull/782 @@ -125,12 +125,12 @@ annotations: - name: Github PR url: https://github.com/apache/solr-operator/pull/818 - kind: added - description: Support global.imagePullSecrets for pulling images from private registries - links: - - name: Github Issue - url: https://github.com/apache/solr-operator/issues/338 - - name: Github PR - url: https://github.com/apache/solr-operator/pull/832 + description: Support global.imagePullSecrets for pulling images from private registries, this is merged with image.imagePullSecret. Both accept plain strings in addition to objects + links: + - name: Github Issue + url: https://github.com/apache/solr-operator/issues/338 + - name: Github PR + url: https://github.com/apache/solr-operator/pull/832 artifacthub.io/images: | - name: solr-operator image: apache/solr-operator:v0.10.0-prerelease