Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix master regex when running multiple clusters #58561

Merged
merged 1 commit into from
Jan 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}(-...)?"
Copy link
Contributor

@resouer resouer Jan 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use kubernetes-staging in your own env? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point :) Had I known I was gonna run into this issue I would have totally done that! I'm just hoping this will help someone else down the line.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this change. What's the motivation of it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote a little bit about it in the PR description above, but basically, I'm running a production cluster and staging cluster and I have GCE instances named kubernetes-master-001, kubernetes-master-002, etc and more GCE instances named staging-kubernetes-master-001, staging-kubernetes-master-002, etc.

When running kube-up.sh to create another production master, the INITIAL_ETCD_CLUSTER contains the production and staging instances when it should only be production instances. As a result, etcd fails to startup with an errors like member count unequal -> the api server fails to startup -> nothing else works and the newly created master is broken.

This change makes sure that the INITIAL_ETCD_CLUSTER only contains the production master instances.

}

# Sets REPLICA_NAME to a unique name for a master replica that will match
Expand Down