Skip to content

Instantly share code, notes, and snippets.

Created January 24, 2018 12:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save KashifSaadat/b7dcb1a284caaa6f61b6d5a118aaa08b to your computer and use it in GitHub Desktop.
Supporting new AWS Availability Zones in kops - ETCD Config Updates
# Stop the kubelet & protokube services, preventing automatic updates to the etcd config or the containers from restarting
systemctl stop kubelet && systemctl stop protokube
# Terminate any running etcd containers
docker kill $(docker ps | grep "etcd" | awk '{print $1}')
# Update the etcd configurations, setting ETCD_INITIAL_CLUSTER_STATE to existing
sed -i -e "s/value\: new/value: existing/g" /etc/kubernetes/manifests/etcd.manifest
sed -i -e "s/value\: new/value: existing/g" /etc/kubernetes/manifests/etcd-events.manifest
# Grab the etcd main & events volume paths
ETCD_MAIN_VOL_PATH="`cat /etc/kubernetes/manifests/etcd.manifest | sed -n 's/^\s*path: \(\/mnt\/master-vol-[a-zA-Z0-9\/\-]*\)$/\1/p'`/member"
ETCD_EVENTS_VOL_PATH="`cat /etc/kubernetes/manifests/etcd-events.manifest | sed -n 's/^\s*path: \(\/mnt\/master-vol-[a-zA-Z0-9\/\-]*\)$/\1/p'`/member"
# Drop existing etcd data within these paths, they will replicate data from existing members in the cluster
# Start the kubelet service up again
systemctl start kubelet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment