From 59e17dcdf5e810b09dfa883a470501b387d153ba Mon Sep 17 00:00:00 2001 From: ruslanloman Date: Thu, 26 Sep 2019 18:58:01 +0300 Subject: [PATCH] ceph: Allow to run rook operator on host network There is use case when need to run rook operator on host network since ceph mon is not accessible from kubernetes pod network. Signed-off-by: ruslanloman --- cluster/charts/rook-ceph/templates/deployment.yaml | 3 +++ cluster/charts/rook-ceph/values.yaml | 3 +++ cluster/examples/kubernetes/ceph/operator.yaml | 2 ++ 3 files changed, 8 insertions(+) diff --git a/cluster/charts/rook-ceph/templates/deployment.yaml b/cluster/charts/rook-ceph/templates/deployment.yaml index 880082f10..b970f5dc7 100644 --- a/cluster/charts/rook-ceph/templates/deployment.yaml +++ b/cluster/charts/rook-ceph/templates/deployment.yaml @@ -210,6 +210,9 @@ spec: {{- end }} resources: {{ toYaml .Values.resources | indent 10 }} +{{- if .Values.useOperatorHostNetwork }} + hostNetwork: true +{{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} diff --git a/cluster/charts/rook-ceph/values.yaml b/cluster/charts/rook-ceph/values.yaml index 8019ee171..c0c3d38dd 100644 --- a/cluster/charts/rook-ceph/values.yaml +++ b/cluster/charts/rook-ceph/values.yaml @@ -88,6 +88,9 @@ csi: enableFlexDriver: false enableDiscoveryDaemon: true +## if true, run rook operator on the host network +# useOperatorHostNetwork: true + ## Rook Agent configuration ## toleration: NoSchedule, PreferNoSchedule or NoExecute ## tolerationKey: Set this to the specific key of the taint to tolerate diff --git a/cluster/examples/kubernetes/ceph/operator.yaml b/cluster/examples/kubernetes/ceph/operator.yaml index 020a525ff..3087c3225 100644 --- a/cluster/examples/kubernetes/ceph/operator.yaml +++ b/cluster/examples/kubernetes/ceph/operator.yaml @@ -244,6 +244,8 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + # Uncomment it to run rook operator on the host network + #hostNetwork: true volumes: - name: rook-config emptyDir: {}