Skip to content

Commit

Permalink
Merge pull request #22 from alram/wip-mon-fix
Browse files Browse the repository at this point in the history
mon: make ceph-mon-check the exclusive monmap maintainer
  • Loading branch information
rootfs authored Oct 26, 2017
2 parents b67662c + 939a9fc commit 547dff5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
6 changes: 3 additions & 3 deletions ceph/ceph/templates/bin/_check_zombie_mons.py.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import subprocess
import json

MON_REGEX = r"^\d: ([0-9\.]*):\d+/\d* mon.([^ ]*)$"
# kubctl_command = 'kubectl get pods --namespace=${NAMESPACE} -l component=mon -l application=ceph -o template --template="{ {{"}}"}}range .items{{"}}"}} \\"{{"}}"}}.metadata.name{{"}}"}}\\": \\"{{"}}"}}.status.podIP{{"}}"}}\\" , {{"}}"}}end{{"}}"}} }"'
# kubctl_command = 'kubectl get pods --namespace=${NAMESPACE} -l application=ceph,component=mon -o template --template="{ {{"}}"}}range .items{{"{{"}} \\"{{"{{"}}.metadata.name{{"}}"}}\\": \\"{{"{{"}}.status.podIP{{"}}"}}\\" , {{"{{"}}end{{"}}"}} }"'
if int(os.getenv('K8S_HOST_NETWORK', 0)) > 0:
kubectl_command = 'kubectl get pods --namespace=${NAMESPACE} -l component=mon -l application=ceph -o template --template="{ {{"}}"}}range \$i, \$v := .items{{"}}"}} {{"}}"}} if \$i{{"}}"}} , {{"}}"}} end {{"}}"}} \\"{{"}}"}}\$v.spec.nodeName{{"}}"}}\\": \\"{{"}}"}}\$v.status.podIP{{"}}"}}\\" {{"}}"}}end{{"}}"}} }"'
kubectl_command = 'kubectl get pods --namespace=${NAMESPACE} -l application=ceph,component=mon -o template --template="{ {{"{{"}}range \$i, \$v := .items{{"}}"}} {{"{{"}} if \$i{{"}}"}} , {{"{{"}} end {{"}}"}} \\"{{"{{"}}\$v.spec.nodeName{{"}}"}}\\": \\"{{"{{"}}\$v.status.podIP{{"}}"}}\\" {{"{{"}}end{{"}}"}} }"'
else:
kubectl_command = 'kubectl get pods --namespace=${NAMESPACE} -l component=mon -l application=ceph -o template --template="{ {{"}}"}}range \$i, \$v := .items{{"}}"}} {{"}}"}} if \$i{{"}}"}} , {{"}}"}} end {{"}}"}} \\"{{"}}"}}\$v.metadata.name{{"}}"}}\\": \\"{{"}}"}}\$v.status.podIP{{"}}"}}\\" {{"}}"}}end{{"}}"}} }"'
kubectl_command = 'kubectl get pods --namespace=${NAMESPACE} -l application=ceph,component=mon -o template --template="{ {{"{{"}}range \$i, \$v := .items{{"}}"}} {{"{{"}} if \$i{{"}}"}} , {{"{{"}} end {{"}}"}} \\"{{"{{"}}\$v.metadata.name{{"}}"}}\\": \\"{{"{{"}}\$v.status.podIP{{"}}"}}\\" {{"{{"}}end{{"}}"}} }"'

monmap_command = "ceph --cluster=${CLUSTER} mon getmap > /tmp/monmap && monmaptool -f /tmp/monmap --print"

Expand Down
5 changes: 0 additions & 5 deletions ceph/ceph/templates/bin/_remove-mon.sh.tpl

This file was deleted.

2 changes: 1 addition & 1 deletion ceph/ceph/templates/bin/_watch_mon_health.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function watch_mon_health {
while [ true ]
do
log "checking for zombie mons"
/check_zombie_mons.py || true
CLUSTER=$CLUSTER /check_zombie_mons.py || true
log "sleep 30 sec"
sleep 30
done
Expand Down
5 changes: 0 additions & 5 deletions ceph/ceph/templates/daemonset-mon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ spec:
fieldPath: status.podIP
command:
- /start_mon.sh
lifecycle:
preStop:
exec:
command:
- /remove-mon.sh
ports:
- containerPort: 6789
livenessProbe:
Expand Down

0 comments on commit 547dff5

Please sign in to comment.