Merge "Ceph: mon should get Pods from namespace other than ceph"
This commit is contained in:
commit
2e2ac8c387
@ -30,9 +30,9 @@ function get_mon_config {
|
||||
while [[ -z "${MONMAP_ADD// }" && "${timeout}" -gt 0 ]]; do
|
||||
# Get the ceph mon pods (name and IP) from the Kubernetes API. Formatted as a set of monmap params
|
||||
if [[ ${K8S_HOST_NETWORK} -eq 0 ]]; then
|
||||
MONMAP_ADD=$(kubectl get pods --namespace=${CLUSTER} -l application=ceph -l component=mon -o template --template="{{`{{range .items}}`}}{{`{{if .status.podIP}}`}}--add {{`{{.metadata.name}}`}} {{`{{.status.podIP}}`}} {{`{{end}}`}} {{`{{end}}`}}")
|
||||
MONMAP_ADD=$(kubectl get pods --namespace=${NAMESPACE} -l application=ceph -l component=mon -o template --template="{{`{{range .items}}`}}{{`{{if .status.podIP}}`}}--add {{`{{.metadata.name}}`}} {{`{{.status.podIP}}`}} {{`{{end}}`}} {{`{{end}}`}}")
|
||||
else
|
||||
MONMAP_ADD=$(kubectl get pods --namespace=${CLUSTER} -l application=ceph -l component=mon -o template --template="{{`{{range .items}}`}}{{`{{if .status.podIP}}`}}--add {{`{{.spec.nodeName}}`}} {{`{{.status.podIP}}`}} {{`{{end}}`}} {{`{{end}}`}}")
|
||||
MONMAP_ADD=$(kubectl get pods --namespace=${NAMESPACE} -l application=ceph -l component=mon -o template --template="{{`{{range .items}}`}}{{`{{if .status.podIP}}`}}--add {{`{{.spec.nodeName}}`}} {{`{{.status.podIP}}`}} {{`{{end}}`}} {{`{{end}}`}}")
|
||||
fi
|
||||
(( timeout-- ))
|
||||
sleep 1
|
||||
|
@ -66,6 +66,11 @@ spec:
|
||||
value: "1"
|
||||
- name: MONMAP
|
||||
value: /var/lib/ceph/mon/monmap
|
||||
- name: NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.namespace
|
||||
- name: CEPH_DAEMON
|
||||
value: mon
|
||||
- name: CEPH_PUBLIC_NETWORK
|
||||
|
Loading…
Reference in New Issue
Block a user