promenade/tools/g2/lib/etcd.sh
Mahmoudi, Ahmad (am495p) c302a083a6 Upgrade k8s from v1.17.3 to v1.18.6
This ps makes following changes to upgrade kubernetes from v1.17.3
to v1.18.6.
  - Updated all references to k8s images to 1.18.6
  - Updated command options and api object and versions based on
    k8s 1.18 release notes:
      https://kubernetes.io/docs/setup/release/notes/
  - Uplifted uwsgi to 2.0.19.1 to align with other airship
    components, and to bring in fixes and improvements.
  - Added build-essentials and python3-dev packages to pass the zull
    gate, which was looking for a c compiler.

Change-Id: I1160d1e6e2f02a0524043641b9296ea39edb301e
2020-08-19 15:56:45 +00:00

31 lines
689 B
Bash

etcdctl_cmd() {
CLUSTER=${1}
VM=${2}
shift 2
kubectl_cmd "${VM}" -n kube-system exec -t "${CLUSTER}-etcd-${VM}" -- etcdctl "${@}"
}
etcdctl_member_list() {
CLUSTER=${1}
VM=${2}
shift 2
etcdctl_cmd "${CLUSTER}" "${VM}" member list -w json | jq -r '.members[].name' | sort
}
etcdctl_member_remove() {
CLUSTER=${1}
VM=${2}
NODE=${3}
shift 3
MEMBER_ID=$(etcdctl_cmd "$CLUSTER" "${VM}" member list | awk -F', ' "/${NODE}/ "'{ print $1}')
if [[ -n $MEMBER_ID ]] ; then
etcdctl_cmd "${CLUSTER}" "${VM}" member remove "$MEMBER_ID"
else
log No members found in cluster "$CLUSTER" for node "$NODE"
fi
}