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

Make ClusterID required for AWS. #49215

Merged
merged 1 commit into from
Aug 10, 2017

Conversation

rrati
Copy link

@rrati rrati commented Jul 19, 2017

What this PR does / why we need it:
Makes ClusterID required for AWS and provides a flag to run in un-tagged mode

fixes #48954

Release note:

A cluster using the AWS cloud provider will need to label existing nodes and resources with a ClusterID or the kube-controller-manager will not start.  To run without a ClusterID pass --allow-untagged-cloud=true to the kube-controller-manager on startup.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 19, 2017
@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jul 19, 2017
@rrati rrati force-pushed the aws-require-cluster-id branch from f5d3987 to dfd943a Compare July 19, 2017 17:54
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot left a comment

Choose a reason for hiding this comment

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

@spxtr: 12 new warning(s).

In response to this:

/lint

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -111,6 +111,10 @@ func (f *FakeCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []s
return nameservers, searches
}

func (f *FakeCloud) HasClusterID() bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported method FakeCloud.HasClusterID should have comment or be unexported. More info.

@@ -956,6 +956,11 @@ func (c *Cloud) Routes() (cloudprovider.Routes, bool) {
return c, true
}

// ClusterID returns true if the cluster has a clusterID
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: comment on exported method Cloud.HasClusterID should be of the form "HasClusterID ...". More info.

@@ -466,6 +466,11 @@ func (os *Rackspace) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []
return nameservers, searches
}

// ClusterID returns true if the cluster has a clusterID
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: comment on exported method Rackspace.HasClusterID should be of the form "HasClusterID ...". More info.

@@ -382,6 +382,11 @@ func (az *Cloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []stri
return nameservers, searches
}

// ClusterID returns true if the cluster has a clusterID
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: comment on exported method Cloud.HasClusterID should be of the form "HasClusterID ...". More info.

if s.AllowUntaggedCloud == true {
glog.Warning("Detected a cluster without a ClusterID. A ClusterID will be required in the future. Please tag your cluster to avoid any future issues.")
} else {
return ControllerContext{}, fmt.Errorf("No ClusterID Found. A ClusterID is required for the cloud provider to function properly. This check can be bypassed by setting the allow-untagged-cloud option")
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint errors: error strings should not be capitalized or end with punctuation or a newline. More info.

@@ -409,6 +409,11 @@ func (gce *GCECloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []
return nameservers, srchOut
}

// ClusterID returns true if the cluster has a clusterID
func (gce *GCECloud) HasClusterID() bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint naming: receiver name gce should be consistent with previous receiver name g for GCECloud. More info.

@@ -134,6 +134,11 @@ func (v *OVirtCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []
return nameservers, searches
}

// ClusterID returns true if the cluster has a clusterID
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: comment on exported method OVirtCloud.HasClusterID should be of the form "HasClusterID ...". More info.

@@ -120,6 +120,11 @@ func (cs *CSCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []st
return nameservers, searches
}

// ClusterID returns true if the cluster has a clusterID
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: comment on exported method CSCloud.HasClusterID should be of the form "HasClusterID ...". More info.

@@ -702,6 +702,11 @@ func (vs *VSphere) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []st
return nameservers, searches
}

// ClusterID returns true if the cluster has a clusterID
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: comment on exported method VSphere.HasClusterID should be of the form "HasClusterID ...". More info.

@@ -539,6 +539,11 @@ func (pc *PCCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []st
return nameservers, searches
}

// ClusterID returns true if the cluster has a clusterID
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: comment on exported method PCCloud.HasClusterID should be of the form "HasClusterID ...". More info.

@rrati rrati force-pushed the aws-require-cluster-id branch from dfd943a to eac5939 Compare July 19, 2017 19:50
@spxtr
Copy link
Contributor

spxtr commented Jul 19, 2017

/lint

Copy link
Contributor

@k8s-ci-robot k8s-ci-robot left a comment

Choose a reason for hiding this comment

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

@spxtr: 1 new warning(s).

In response to this:

/lint

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -409,6 +409,11 @@ func (gce *GCECloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []
return nameservers, srchOut
}

// HasClusterID returns true if the cluster has a clusterID
func (gce *GCECloud) HasClusterID() bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint naming: receiver name gce should be consistent with previous receiver name g for GCECloud. More info.

Copy link
Author

Choose a reason for hiding this comment

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

This is not correct. What I have is consistent with existing code

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. It's g at one part of the file and gce for the rest. Your code is fine here, feel free to ignore the lint message :)

Copy link
Member

Choose a reason for hiding this comment

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

Or fix the other part of the file.

Copy link
Author

Choose a reason for hiding this comment

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

I could rather do that cleanup as a part of a separate PR. It really isn't related to this PR.

@rrati
Copy link
Author

rrati commented Jul 20, 2017

@kubernetes/sig-aws-misc @justinsb

@rrati
Copy link
Author

rrati commented Jul 20, 2017

/test pull-kubernetes-e2e-gce-etcd3

@@ -134,6 +134,7 @@ func (s *CMServer) AddFlags(fs *pflag.FlagSet, allControllers []string, disabled
fs.BoolVar(&s.UseServiceAccountCredentials, "use-service-account-credentials", s.UseServiceAccountCredentials, "If true, use individual service account credentials for each controller.")
fs.StringVar(&s.CloudProvider, "cloud-provider", s.CloudProvider, "The provider for cloud services. Empty string for no provider.")
fs.StringVar(&s.CloudConfigFile, "cloud-config", s.CloudConfigFile, "The path to the cloud provider configuration file. Empty string for no configuration file.")
fs.BoolVar(&s.AllowUntaggedCloud, "allow-untagged-cloud", false, "Allow the cluster to run without the cluster-id on cloud instances. This is a legacy mode of operation and a cluster-id will be required in the future.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we mark this flag as deprecated immediately?

Copy link
Member

Choose a reason for hiding this comment

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

This flag seems pointless if it defaults to false. People either have to change their config to pass --allow-untagged-cloud or change their config to pass clusterID. If you are going to break compatibility, just force people to get to where they need to go. By allowing them to pass --allow-untagged-cloud and later removing the flag, aren't you just breaking compatibility twice?

Copy link
Author

Choose a reason for hiding this comment

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

Whether to set the default to false or true is still being discussed in the AWS sig. However, imo, setting the flag to false forces the issue immediately and gives users time to do the labeling before the option goes away. The intent is for this option to only exist for a few releases. Having it default to false will inform the user while still allowing for an easy change to function in the old, but broken, behavior while they plan to do the required labeling.

Copy link
Author

Choose a reason for hiding this comment

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

@roberthbailey I believe that is the plan, but would prefer aws-sig members weigh in.

Copy link
Member

Choose a reason for hiding this comment

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

The thought behind the flag is that changing your infrastructure deployment tool to add the tags may be non-trivial.

So we are forcing people to add the tag, but we're also giving them a reasonable path to upgrade if they can't easily add that to their deployment tool.

I agree we can mark the flag deprecated right away.

Copy link
Author

Choose a reason for hiding this comment

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

I marked the new flag as deprecated

@@ -30,6 +30,7 @@ import (
type CloudProviderOptions struct {
CloudConfigFile string
CloudProvider string
AllowUntagged bool
Copy link
Member

Choose a reason for hiding this comment

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

May be missing something, but is this one used?

Copy link
Author

Choose a reason for hiding this comment

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

Nope, this shouldn't be there. I'll remove

@justinsb
Copy link
Member

justinsb commented Aug 4, 2017

Looks good from an AWS perspective.

@rrati rrati force-pushed the aws-require-cluster-id branch 2 times, most recently from 2660f72 to 458ad97 Compare August 7, 2017 16:42
@rrati
Copy link
Author

rrati commented Aug 8, 2017

/test pull-kubernetes-e2e-gce-etcd3

@rrati
Copy link
Author

rrati commented Aug 8, 2017

/test pull-kubernetes-verify

1 similar comment
@rrati
Copy link
Author

rrati commented Aug 9, 2017

/test pull-kubernetes-verify

@rrati
Copy link
Author

rrati commented Aug 9, 2017

@roberthbailey @mikedanese PTAL

@roberthbailey roberthbailey removed their assignment Aug 9, 2017
@mikedanese
Copy link
Member

This needs a release note action required.

@mikedanese mikedanese added release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Aug 9, 2017
@rrati
Copy link
Author

rrati commented Aug 9, 2017

@mikedanese There is a release note in the original PR text. It hasn't been showing up for some reason

@mikedanese
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 9, 2017
@deads2k
Copy link
Contributor

deads2k commented Aug 9, 2017

/approve

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, mikedanese, rrati

Associated issue: 48954

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 9, 2017
@rrati rrati force-pushed the aws-require-cluster-id branch from 458ad97 to 926f070 Compare August 10, 2017 13:42
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 10, 2017
@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@rrati
Copy link
Author

rrati commented Aug 10, 2017

@mikedanese Please re-lgtm

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit e9ab489 into kubernetes:master Aug 10, 2017
openshift-merge-robot added a commit to openshift/origin that referenced this pull request Sep 21, 2017
Automatic merge from submit-queue (batch tested with PRs 16443, 16331)

Require cluster id for AWS

Backporting of:

kubernetes/kubernetes#48612
kubernetes/kubernetes#49215

Plus changes in master-controller startup to look for the flag to allow untagged clouds or exit.
@mikedanese
Copy link
Member

Can we remove HasClusterID from cloudprovider interface once we've finished the deprecation of untagged cloud for aws?

dims pushed a commit to dims/kubernetes that referenced this pull request Feb 8, 2018
Automatic merge from submit-queue

Make ClusterID required for AWS.

**What this PR does / why we need it**:
Makes ClusterID required for AWS and provides a flag to run in un-tagged mode

fixes kubernetes#48954 


**Release note**:
```release-note
A cluster using the AWS cloud provider will need to label existing nodes and resources with a ClusterID or the kube-controller-manager will not start.  To run without a ClusterID pass --allow-untagged-cloud=true to the kube-controller-manager on startup.
```
@andrewsykim
Copy link
Member

Sorry to be commenting on a really old PR, but I don't think we followed up and deprecated the necessary flags. I'm not even sure what the state of ClusterID is at this point. Is it safe to remove the --allow-untagged-cloud flag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the cluster-id tag required for aws
9 participants