From d0bbb941fd17851a91696cfe1e31233cc5ff868a Mon Sep 17 00:00:00 2001 From: Dan Gillespie Date: Mon, 27 Mar 2017 05:34:51 +0000 Subject: [PATCH 1/3] added prompt warning if etcd3 media type isn't set during upgrade --- cluster/gce/upgrade.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cluster/gce/upgrade.sh b/cluster/gce/upgrade.sh index 39afa69cc4b..c138d8f9e01 100755 --- a/cluster/gce/upgrade.sh +++ b/cluster/gce/upgrade.sh @@ -447,6 +447,27 @@ if [[ "${master_upgrade}" == "false" ]] && [[ "${node_upgrade}" == "false" ]]; t exit 1 fi +# prompt if etcd storage media type isn't set +if [[ -z "${STORAGE_MEDIA_TYPE:-}" ]]; then + if [ -t 0 ] && [ -t 1 ]; then + echo "The default etcd storage media type in 1.6 has changed from application/json to application/vnd.kubernetes.protobuf." + echo "" + echo "ETCD2 DOES NOT SUPPORT PROTOBUF: If you wish to have to ability to downgrade to etcd2 later application/json must be used." + echo "" + echo "To enable using json, before running this script set:" + echo "export STORAGE_MEDIA_TYPE=application/json" + echo "" + echo "It's HIGHLY recommended that etcd be backed up before this step!!" + read -p "Would you like to continue? [y/N] " confirm + if [[ "${confirm}" != "y" ]]; then + exit 1 + fi + else + echo "STORAGE_MEDIA_TYPE must be specified when run non-interactively." >&2 + exit 1 + fi +fi + print-node-version-info "Pre-Upgrade" if [[ "${local_binaries}" == "false" ]]; then From 031dd569acad10ceb027f04d065aab61d424488e Mon Sep 17 00:00:00 2001 From: Dan Gillespie Date: Mon, 27 Mar 2017 16:07:25 +0100 Subject: [PATCH 2/3] etcd upgrade warning: add docs link, fixed etcd2 behavior, print non-interactive --- cluster/gce/upgrade.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/cluster/gce/upgrade.sh b/cluster/gce/upgrade.sh index c138d8f9e01..0edfa238883 100755 --- a/cluster/gce/upgrade.sh +++ b/cluster/gce/upgrade.sh @@ -447,18 +447,20 @@ if [[ "${master_upgrade}" == "false" ]] && [[ "${node_upgrade}" == "false" ]]; t exit 1 fi -# prompt if etcd storage media type isn't set -if [[ -z "${STORAGE_MEDIA_TYPE:-}" ]]; then +# prompt if etcd storage media type isn't set unless using etcd2 when doing master upgrade +if [[ -z "${STORAGE_MEDIA_TYPE:-}" ]] && [[ "${STORAGE_BACKEND:-}" != "etcd2" ]] && [[ "${master_upgrade}" == "true" ]]; then + echo "The default etcd storage media type in 1.6 has changed from application/json to application/vnd.kubernetes.protobuf." + echo "Documentation about the change can be found at https://kubernetes.io/docs/admin/etcd_upgrade." + echo "" + echo "ETCD2 DOES NOT SUPPORT PROTOBUF: If you wish to have to ability to downgrade to etcd2 later application/json must be used." + echo "" + echo "To enable using json, before running this script set:" + echo "export STORAGE_MEDIA_TYPE=application/json" + echo "" + echo "It's HIGHLY recommended that etcd be backed up before this step!!" + echo "" if [ -t 0 ] && [ -t 1 ]; then - echo "The default etcd storage media type in 1.6 has changed from application/json to application/vnd.kubernetes.protobuf." - echo "" - echo "ETCD2 DOES NOT SUPPORT PROTOBUF: If you wish to have to ability to downgrade to etcd2 later application/json must be used." - echo "" - echo "To enable using json, before running this script set:" - echo "export STORAGE_MEDIA_TYPE=application/json" - echo "" - echo "It's HIGHLY recommended that etcd be backed up before this step!!" - read -p "Would you like to continue? [y/N] " confirm + read -p "Would you like to continue with the new default, and lose the ability to downgrade to etcd2? [y/N] " confirm if [[ "${confirm}" != "y" ]]; then exit 1 fi From d7a552c1885b867f14cd42d963baa525cdc05f13 Mon Sep 17 00:00:00 2001 From: Dan Gillespie Date: Mon, 27 Mar 2017 16:46:38 +0100 Subject: [PATCH 3/3] in storage media upgrade prompt, provide config for using protobuf --- cluster/gce/upgrade.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cluster/gce/upgrade.sh b/cluster/gce/upgrade.sh index 0edfa238883..4060e7803bc 100755 --- a/cluster/gce/upgrade.sh +++ b/cluster/gce/upgrade.sh @@ -454,17 +454,20 @@ if [[ -z "${STORAGE_MEDIA_TYPE:-}" ]] && [[ "${STORAGE_BACKEND:-}" != "etcd2" ]] echo "" echo "ETCD2 DOES NOT SUPPORT PROTOBUF: If you wish to have to ability to downgrade to etcd2 later application/json must be used." echo "" + echo "It's HIGHLY recommended that etcd be backed up before this step!!" + echo "" echo "To enable using json, before running this script set:" echo "export STORAGE_MEDIA_TYPE=application/json" echo "" - echo "It's HIGHLY recommended that etcd be backed up before this step!!" - echo "" if [ -t 0 ] && [ -t 1 ]; then read -p "Would you like to continue with the new default, and lose the ability to downgrade to etcd2? [y/N] " confirm if [[ "${confirm}" != "y" ]]; then exit 1 fi else + echo "To enable using protobuf, before running this script set:" + echo "export STORAGE_MEDIA_TYPE=application/vnd.kubernetes.protobuf" + echo "" echo "STORAGE_MEDIA_TYPE must be specified when run non-interactively." >&2 exit 1 fi