Skip to content

Commit 030acbb

Browse files
committed
operator: make minio endpoint cluster domain configurable
The operator hardcoded `.svc.cluster.local` when building the in-cluster Minio endpoint (RELEASE-minio.NAMESPACE.svc.cluster.local), so the operator can't reach Minio on clusters configured with a custom cluster domain (e.g. via kubelet's --cluster-domain). Adds a `clusterDomain` value (default `cluster.local`, preserving existing behavior) and uses it when building the endpoint. Fixes #2895 Signed-off-by: Amit Mishra <amit.mishra.eee21@itbhu.ac.in>
1 parent b30cb1f commit 030acbb

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

operator/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ helm install securecodebox-operator oci://ghcr.io/securecodebox/helm/operator
7070
| Key | Type | Default | Description |
7171
|-----|------|---------|-------------|
7272
| allowIstioSidecarInjectionInJobs | bool | `false` | Sets the value of the istio sidecar annotation ("sidecar.istio.io/inject") for jobs started by the operator (scans, parser and hooks). defaults to false to prevent jobs hanging indefinitely due to the sidecar never terminating. If you aren't using istio this setting/annotation has no effect. |
73+
| clusterDomain | string | `"cluster.local"` | The cluster domain to use when building the in-cluster Minio endpoint (`<release>-minio.<namespace>.svc.<clusterDomain>`). Override this if your cluster uses a custom domain instead of the Kubernetes default `cluster.local`. |
7374
| customCACertificate | object | `{"certificate":"public.crt","existingCertificate":null}` | Setup for Custom CA certificates. These are automatically mounted into every secureCodeBox component (lurker, parser & hooks). Requires that every namespace has a configmap with the CA certificate(s) |
7475
| customCACertificate.certificate | string | `"public.crt"` | key in the configmap holding the certificate(s) |
7576
| customCACertificate.existingCertificate | string | `nil` | name of the configMap holding the ca certificate(s), needs to be the same across all namespaces |

operator/templates/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ spec:
7575
- name: S3_USE_SSL
7676
value: "{{ .Values.minio.tls.enabled }}"
7777
- name: S3_ENDPOINT
78-
value: "{{ .Release.Name }}-minio.{{ .Release.Namespace }}.svc.cluster.local"
78+
value: "{{ .Release.Name }}-minio.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}"
7979
- name: S3_PORT
8080
value: '9000'
8181
- name: MINIO_ACCESS_KEY

operator/tests/operator_test.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,20 @@ tests:
9191
- equal:
9292
path: spec.template.spec.containers[0].env[?(@.name=="S3_ENDPOINT")].value
9393
value: "RELEASE-NAME-minio.NAMESPACE.svc.cluster.local"
94+
- it: allows overriding the cluster domain used for the minio endpoint
95+
templates:
96+
- manager/manager.yaml
97+
chart:
98+
version: 0.0.0
99+
appVersion: 0.0.0
100+
set:
101+
minio:
102+
enabled: true
103+
clusterDomain: custom.local
104+
asserts:
105+
- equal:
106+
path: spec.template.spec.containers[0].env[?(@.name=="S3_ENDPOINT")].value
107+
value: "RELEASE-NAME-minio.NAMESPACE.svc.custom.local"
94108
- it: configures manager deployment for external s3
95109
templates:
96110
- manager/manager.yaml

operator/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# telemetryEnabled -- The Operator sends anonymous telemetry data, to give the team an overview how much the secureCodeBox is used. Find out more at https://www.securecodebox.io/telemetry
1010
telemetryEnabled: true
1111

12+
# -- The cluster domain to use when building the in-cluster Minio endpoint (`<release>-minio.<namespace>.svc.<clusterDomain>`). Override this if your cluster uses a custom domain instead of the Kubernetes default `cluster.local`.
13+
clusterDomain: cluster.local
14+
1215
# -- Define imagePullSecrets when a private registry is used (see: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/)
1316
imagePullSecrets: []
1417

0 commit comments

Comments
 (0)