Commit ff0546da authored by CJ Cullen's avatar CJ Cullen

Merge pull request #10133 from mbforbes/gkeLivingUpgrade

GKE upgrade tests
parents 483ba4e9 434f9687
...@@ -44,6 +44,7 @@ function usage() { ...@@ -44,6 +44,7 @@ function usage() {
echo "(... Fetching current release versions ...)" echo "(... Fetching current release versions ...)"
echo "" echo ""
# NOTE: IF YOU CHANGE THE FOLLOWING LIST, ALSO UPDATE test/e2e/cluster_upgrade.go
local latest_release local latest_release
local latest_stable local latest_stable
local latest_ci local latest_ci
...@@ -53,7 +54,7 @@ function usage() { ...@@ -53,7 +54,7 @@ function usage() {
latest_ci=$(gsutil cat gs://kubernetes-release/ci/latest.txt) latest_ci=$(gsutil cat gs://kubernetes-release/ci/latest.txt)
echo "To upgrade to:" echo "To upgrade to:"
echo " latest stable: ${0} ${latest_stable}" echo " latest stable: ${0} ${latest_stable}"
echo " latest release: ${0} ${latest_release}" echo " latest release: ${0} ${latest_release}"
echo " latest ci: ${0} ${latest_ci}" echo " latest ci: ${0} ${latest_ci}"
} }
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
# Specifically, the following environment variables are assumed: # Specifically, the following environment variables are assumed:
# - CLUSTER_NAME (the name of the cluster) # - CLUSTER_NAME (the name of the cluster)
MASTER_NAME="k8s-${CLUSTER_NAME}-master"
ZONE="${ZONE:-us-central1-f}" ZONE="${ZONE:-us-central1-f}"
NUM_MINIONS="${NUM_MINIONS:-2}" NUM_MINIONS="${NUM_MINIONS:-2}"
CLUSTER_API_VERSION="${CLUSTER_API_VERSION:-}" CLUSTER_API_VERSION="${CLUSTER_API_VERSION:-}"
......
...@@ -97,6 +97,7 @@ export PATH=$(dirname "${e2e_test}"):"${PATH}" ...@@ -97,6 +97,7 @@ export PATH=$(dirname "${e2e_test}"):"${PATH}"
--provider="${KUBERNETES_PROVIDER}" \ --provider="${KUBERNETES_PROVIDER}" \
--gce-project="${PROJECT:-}" \ --gce-project="${PROJECT:-}" \
--gce-zone="${ZONE:-}" \ --gce-zone="${ZONE:-}" \
--gke-cluster="${CLUSTER_NAME:-}" \
--kube-master="${KUBE_MASTER:-}" \ --kube-master="${KUBE_MASTER:-}" \
--cluster-tag="${CLUSTER_ID:-}" \ --cluster-tag="${CLUSTER_ID:-}" \
--repo-root="${KUBE_VERSION_ROOT}" \ --repo-root="${KUBE_VERSION_ROOT}" \
......
...@@ -89,6 +89,7 @@ func init() { ...@@ -89,6 +89,7 @@ func init() {
flag.StringVar(&cloudConfig.MasterName, "kube-master", "", "Name of the kubernetes master. Only required if provider is gce or gke") flag.StringVar(&cloudConfig.MasterName, "kube-master", "", "Name of the kubernetes master. Only required if provider is gce or gke")
flag.StringVar(&cloudConfig.ProjectID, "gce-project", "", "The GCE project being used, if applicable") flag.StringVar(&cloudConfig.ProjectID, "gce-project", "", "The GCE project being used, if applicable")
flag.StringVar(&cloudConfig.Zone, "gce-zone", "", "GCE zone being used, if applicable") flag.StringVar(&cloudConfig.Zone, "gce-zone", "", "GCE zone being used, if applicable")
flag.StringVar(&cloudConfig.Cluster, "gke-cluster", "", "GKE name of cluster being used, if applicable")
flag.StringVar(&cloudConfig.NodeInstanceGroup, "node-instance-group", "", "Name of the managed instance group for nodes. Valid only for gce") flag.StringVar(&cloudConfig.NodeInstanceGroup, "node-instance-group", "", "Name of the managed instance group for nodes. Valid only for gce")
flag.IntVar(&cloudConfig.NumNodes, "num-nodes", -1, "Number of nodes in the cluster") flag.IntVar(&cloudConfig.NumNodes, "num-nodes", -1, "Number of nodes in the cluster")
......
...@@ -251,6 +251,7 @@ func migTemplate() (string, error) { ...@@ -251,6 +251,7 @@ func migTemplate() (string, error) {
var errLast error var errLast error
var templ string var templ string
key := "instanceTemplate" key := "instanceTemplate"
// TODO(mbforbes): Refactor this to use cluster_upgrade.go:retryCmd(...)
if wait.Poll(poll, singleCallTimeout, func() (bool, error) { if wait.Poll(poll, singleCallTimeout, func() (bool, error) {
// TODO(mbforbes): make this hit the compute API directly instead of // TODO(mbforbes): make this hit the compute API directly instead of
// shelling out to gcloud. // shelling out to gcloud.
...@@ -289,6 +290,7 @@ func migRollingUpdateStart(templ string, nt time.Duration) (string, error) { ...@@ -289,6 +290,7 @@ func migRollingUpdateStart(templ string, nt time.Duration) (string, error) {
var errLast error var errLast error
var id string var id string
prefix, suffix := "Started [", "]." prefix, suffix := "Started [", "]."
// TODO(mbforbes): Refactor this to use cluster_upgrade.go:retryCmd(...)
if err := wait.Poll(poll, singleCallTimeout, func() (bool, error) { if err := wait.Poll(poll, singleCallTimeout, func() (bool, error) {
// TODO(mbforbes): make this hit the compute API directly instead of // TODO(mbforbes): make this hit the compute API directly instead of
// shelling out to gcloud. // shelling out to gcloud.
...@@ -345,6 +347,7 @@ func migRollingUpdatePoll(id string, nt time.Duration) error { ...@@ -345,6 +347,7 @@ func migRollingUpdatePoll(id string, nt time.Duration) error {
start, timeout := time.Now(), nt*time.Duration(testContext.CloudConfig.NumNodes) start, timeout := time.Now(), nt*time.Duration(testContext.CloudConfig.NumNodes)
var errLast error var errLast error
Logf("Waiting up to %v for MIG rolling update to complete.", timeout) Logf("Waiting up to %v for MIG rolling update to complete.", timeout)
// TODO(mbforbes): Refactor this to use cluster_upgrade.go:retryCmd(...)
if wait.Poll(restartPoll, timeout, func() (bool, error) { if wait.Poll(restartPoll, timeout, func() (bool, error) {
o, err := exec.Command("gcloud", "preview", "rolling-updates", o, err := exec.Command("gcloud", "preview", "rolling-updates",
fmt.Sprintf("--project=%s", testContext.CloudConfig.ProjectID), fmt.Sprintf("--project=%s", testContext.CloudConfig.ProjectID),
......
...@@ -87,6 +87,7 @@ const ( ...@@ -87,6 +87,7 @@ const (
type CloudConfig struct { type CloudConfig struct {
ProjectID string ProjectID string
Zone string Zone string
Cluster string
MasterName string MasterName string
NodeInstanceGroup string NodeInstanceGroup string
NumNodes int NumNodes int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment