From f9e43f3a6f1b3518630bc9829001a82cdaf24794 Mon Sep 17 00:00:00 2001 From: Jesse Shieh Date: Fri, 19 Jan 2018 18:44:52 -0800 Subject: [PATCH] Fix master regex when running multiple clusters I'm running two Kubernetes clusters on GCE. One for production and one for staging. The instance prefix I use for production is `kubernetes` and for staging it's `staging-kubernetes`. This caused a problem when running `kube-up.sh` for production because when it tries to find all instances which match `kubernetes(-...)?` it finds both the production and staging instances. This probably results in multiple problems, but the most noticeable one for me was that I`NITIAL_ETCD_CLUSTER` was incorrect and so etcd wouldn't start up correctly so the api server doesn't start up correctly so nothing else starts up. I tested this manually and it seems to work for me, but I didn't write an automated test. --- cluster/gce/util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 812babe1234..05627104062 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -1868,7 +1868,7 @@ function get-master-replicas-count() { # Prints regexp for full master machine name. In a cluster with replicated master, # VM names may either be MASTER_NAME or MASTER_NAME with a suffix for a replica. function get-replica-name-regexp() { - echo "${MASTER_NAME}(-...)?" + echo "^${MASTER_NAME}(-...)?" } # Sets REPLICA_NAME to a unique name for a master replica that will match