[ceph-mon] Skip monmap endpoint check for missing mons
This change adds a condition to ensure that an IP address was obtained for a ceph-mon kubernetes endpoint before building the expected endpoint string and checking it against the monmap. If an IP address isn't available, the check is skipped for that mon. Change-Id: I45a2e2987b5ef0c27b0bb765f7967fcce1af62e4
This commit is contained in:
parent
66fedd5d39
commit
718db3682e
@ -15,6 +15,6 @@ apiVersion: v1
|
|||||||
appVersion: v1.0.0
|
appVersion: v1.0.0
|
||||||
description: OpenStack-Helm Ceph Mon
|
description: OpenStack-Helm Ceph Mon
|
||||||
name: ceph-mon
|
name: ceph-mon
|
||||||
version: 0.1.16
|
version: 0.1.17
|
||||||
home: https://github.com/ceph/ceph
|
home: https://github.com/ceph/ceph
|
||||||
...
|
...
|
||||||
|
@ -41,11 +41,15 @@ function check_mon_addrs {
|
|||||||
for mon in ${mon_hostnames}; do
|
for mon in ${mon_hostnames}; do
|
||||||
local mon_endpoint=$(echo "${mon_dump}" | awk "/${mon}/{print \$2}")
|
local mon_endpoint=$(echo "${mon_dump}" | awk "/${mon}/{print \$2}")
|
||||||
local mon_ip=$(jq -r ".subsets[0].addresses[] | select(.nodeName == \"${mon}\") | .ip" <<< ${mon_endpoints})
|
local mon_ip=$(jq -r ".subsets[0].addresses[] | select(.nodeName == \"${mon}\") | .ip" <<< ${mon_endpoints})
|
||||||
local desired_endpoint=$(printf '[v1:%s:%s/0,v2:%s:%s/0]' ${mon_ip} ${v1_port} ${mon_ip} ${v2_port})
|
|
||||||
|
|
||||||
if [[ "${mon_endpoint}" != "${desired_endpoint}" ]]; then
|
# Skip this mon if it doesn't appear in the list of kubernetes endpoints
|
||||||
echo "endpoint for ${mon} is ${mon_endpoint}, setting it to ${desired_endpoint}"
|
if [[ -n "${mon_ip}" ]]; then
|
||||||
ceph mon set-addrs ${mon} ${desired_endpoint}
|
local desired_endpoint=$(printf '[v1:%s:%s/0,v2:%s:%s/0]' ${mon_ip} ${v1_port} ${mon_ip} ${v2_port})
|
||||||
|
|
||||||
|
if [[ "${mon_endpoint}" != "${desired_endpoint}" ]]; then
|
||||||
|
echo "endpoint for ${mon} is ${mon_endpoint}, setting it to ${desired_endpoint}"
|
||||||
|
ceph mon set-addrs ${mon} ${desired_endpoint}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@ -17,4 +17,5 @@ ceph-mon:
|
|||||||
- 0.1.14 Update htk requirements
|
- 0.1.14 Update htk requirements
|
||||||
- 0.1.15 Prevent mon-check from removing mons when down temporarily
|
- 0.1.15 Prevent mon-check from removing mons when down temporarily
|
||||||
- 0.1.16 Correct Ceph Mon Check Ports
|
- 0.1.16 Correct Ceph Mon Check Ports
|
||||||
|
- 0.1.17 Skip monmap endpoint check for missing mons
|
||||||
...
|
...
|
||||||
|
Loading…
Reference in New Issue
Block a user