From 6ea2e29462c33a559da952d96941cdf78f21bd62 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Thu, 20 Mar 2025 14:01:14 -0600 Subject: [PATCH] operator: set dns policy for host network if needed When host network is enabled, the operator needs to set the dns policy to ClusterFirstWithHostNet so the request to the rgw endpoint will resolve properly. Signed-off-by: Travis Nielsen (cherry picked from commit fe70248a1328855f071c1b81a7938267ba593d90) --- deploy/charts/rook-ceph/templates/deployment.yaml | 1 + deploy/examples/operator-openshift.yaml | 4 ++++ deploy/examples/operator.yaml | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/deploy/charts/rook-ceph/templates/deployment.yaml b/deploy/charts/rook-ceph/templates/deployment.yaml index cee5d63af..18c1bfd41 100644 --- a/deploy/charts/rook-ceph/templates/deployment.yaml +++ b/deploy/charts/rook-ceph/templates/deployment.yaml @@ -118,6 +118,7 @@ spec: {{- end }} {{- if .Values.useOperatorHostNetwork }} hostNetwork: true + dnsPolicy: ClusterFirstWithHostNet {{- end }} {{- if .Values.nodeSelector }} nodeSelector: diff --git a/deploy/examples/operator-openshift.yaml b/deploy/examples/operator-openshift.yaml index c0f314117..e7c45a7cc 100644 --- a/deploy/examples/operator-openshift.yaml +++ b/deploy/examples/operator-openshift.yaml @@ -754,6 +754,10 @@ spec: #- name: LIB_BUCKET_PROVISIONER_THREADS # value: "5" + # Uncomment these two settings to run the operator on the host network + # hostNetwork: true + # dnsPolicy: ClusterFirstWithHostNet + volumes: - name: rook-config emptyDir: {} diff --git a/deploy/examples/operator.yaml b/deploy/examples/operator.yaml index 3db3903a8..812b47665 100644 --- a/deploy/examples/operator.yaml +++ b/deploy/examples/operator.yaml @@ -681,8 +681,9 @@ spec: #- name: LIB_BUCKET_PROVISIONER_THREADS # value: "5" - # Uncomment it to run rook operator on the host network - #hostNetwork: true + # Uncomment these two settings to run the operator on the host network + # hostNetwork: true + # dnsPolicy: ClusterFirstWithHostNet volumes: - name: rook-config emptyDir: {}