Hi all,
Currentlly I’m trying to figure out an automated way for maintenance tasks. I can evacuate via API. But how do I figure out that the host is completely evacuated? Currently I’m using the following code:
curl -s -u "${CATTLE_ACCESS_KEY}:${CATTLE_SECRET_KEY}" \
-H 'Accept: application/json' \
'https://rancher.office.sevenval.de/v2-beta/hosts/'"$host"'/instances' | \
jq '.data[] | select(.state != "exited" and .state != "removed") | select(.hostId | test("'"$host"'")) | select(.system | not) | { Name: .name , State: .state }'
When I evacuate a host the following happens:
- a lot of containers in the state
removing
andstopping
- only the agent container is shown, but in the UI I can still see some cotainers with a trash can symbol
- for a short time containers “reappear” with the state
purging
allthough the UI showed nothing
So I’m a bit puzzled as to what is the sign that an evacuation is “really” complete.
Any help would be much appreciated.
Cheers, Shorty