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

[Federation][(Un)join-00] Implement federation/cluster resource generator. #35153

Merged

Conversation

madhusudancs
Copy link
Contributor

@madhusudancs madhusudancs commented Oct 19, 2016

Design Doc: PR #34484

cc @kubernetes/sig-cluster-federation @nikhiljindal


This change is Reviewable

@k8s-ci-robot
Copy link
Contributor

Jenkins verification failed for commit 69f4b8f. Full PR test history.

The magic incantation to run this job again is @k8s-bot verify test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@madhusudancs madhusudancs assigned nikhiljindal and unassigned ghost Oct 27, 2016
// Name of the cluster context (required)
Name string
// ServerAddress is the APIServer address of the Kubernetes cluster
// that is being registered (optional)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why optional? What happens when this is not specified? Is there a default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no default value, but it could be an empty string right?

Anyway, made it "required" here and added validation.

// that is being registered (optional)
ServerAddress string
// SecretName is the name of the secret that stores the credentials
// for the Kubernetes cluster that is being registered (optional)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question for what happens when not specified

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above.

Spec: federationapi.ClusterSpec{
ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{
{
ServerAddress: s.ServerAddress,
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont think ClientCIDR is optional

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

params: map[string]interface{}{
"name": "foo",
},
expected: &federationapi.Cluster{
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this is a valid cluster spec, that the apiserver will accept

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

func (s ClusterGeneratorV1Beta1) ParamNames() []GeneratorParam {
return []GeneratorParam{
{"name", true},
{"serverAddress", false},
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a command line flag? Should it be server-address in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It isn't a flag. There is no direct kubectl create user for this generator right now. But there could be one in the future and they might define a flag with that name. So making it look like a flag to be safe.

Copy link
Contributor Author

@madhusudancs madhusudancs left a comment

Choose a reason for hiding this comment

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

@nikhiljindal addressed the comments. PTAL.

func (s ClusterGeneratorV1Beta1) ParamNames() []GeneratorParam {
return []GeneratorParam{
{"name", true},
{"serverAddress", false},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It isn't a flag. There is no direct kubectl create user for this generator right now. But there could be one in the future and they might define a flag with that name. So making it look like a flag to be safe.

// Name of the cluster context (required)
Name string
// ServerAddress is the APIServer address of the Kubernetes cluster
// that is being registered (optional)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no default value, but it could be an empty string right?

Anyway, made it "required" here and added validation.

// that is being registered (optional)
ServerAddress string
// SecretName is the name of the secret that stores the credentials
// for the Kubernetes cluster that is being registered (optional)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above.

Spec: federationapi.ClusterSpec{
ServerAddressByClientCIDRs: []federationapi.ServerAddressByClientCIDR{
{
ServerAddress: s.ServerAddress,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

params: map[string]interface{}{
"name": "foo",
},
expected: &federationapi.Cluster{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

return fmt.Errorf("name must be specified")
}
if len(s.ClientCIDR) == 0 {
return fmt.Errorf("client CIDR must be specified")
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use "0.0.0.0/0" as the default CIDR (matches everything)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My original plan was to do this defaulting in the caller. It doesn't hurt to default at both the places. So done.

return fmt.Errorf("server address must be specified")
}
if len(s.SecretName) == 0 {
return fmt.Errorf("secret name must be specified")
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use cluster name as default secret name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above. Done.

return []GeneratorParam{
{"name", true},
{"client-cidr", false},
{"server-address", false},
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldnt the second parameter be true here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@nikhiljindal
Copy link
Contributor

I think cluster name and server-address should only be required. secretName and clientCIDR can be optional. Looks good otherwise

Copy link
Contributor Author

@madhusudancs madhusudancs left a comment

Choose a reason for hiding this comment

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

@nikhiljindal addressed the comments. PTAL.

return []GeneratorParam{
{"name", true},
{"client-cidr", false},
{"server-address", false},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

return fmt.Errorf("name must be specified")
}
if len(s.ClientCIDR) == 0 {
return fmt.Errorf("client CIDR must be specified")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My original plan was to do this defaulting in the caller. It doesn't hurt to default at both the places. So done.

return fmt.Errorf("server address must be specified")
}
if len(s.SecretName) == 0 {
return fmt.Errorf("secret name must be specified")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above. Done.

@k8s-ci-robot
Copy link
Contributor

Jenkins GKE smoke e2e failed for commit b9c4a8142b26d324447c1e388ee283ad20b41f13. Full PR test history.

The magic incantation to run this job again is @k8s-bot cvm gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins GCI GCE e2e failed for commit b9c4a8142b26d324447c1e388ee283ad20b41f13. Full PR test history.

The magic incantation to run this job again is @k8s-bot gci gce e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-ci-robot
Copy link
Contributor

Jenkins Kubemark GCE e2e failed for commit b9c4a8142b26d324447c1e388ee283ad20b41f13. Full PR test history.

The magic incantation to run this job again is @k8s-bot kubemark e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@ghost ghost added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 31, 2016
@nikhiljindal
Copy link
Contributor

Thx for addressing the comments.
LGTM.
Please squash commits.

@madhusudancs
Copy link
Contributor Author

@nikhiljindal squashed the commits and rebased. Thank you very much for a thorough review.

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 1, 2016
@madhusudancs madhusudancs added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 1, 2016
@k8s-ci-robot
Copy link
Contributor

Jenkins GCE Node e2e failed for commit 1712a19. Full PR test history.

The magic incantation to run this job again is @k8s-bot node e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@madhusudancs
Copy link
Contributor Author

@k8s-bot node e2e test this

@madhusudancs
Copy link
Contributor Author

@k8s-bot node e2e test this

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-ci-robot
Copy link
Contributor

Jenkins unit/integration failed for commit 1712a19. Full PR test history.

The magic incantation to run this job again is @k8s-bot unit test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@madhusudancs
Copy link
Contributor Author

@k8s-bot unit test this

4 similar comments
@madhusudancs
Copy link
Contributor Author

@k8s-bot unit test this

@madhusudancs
Copy link
Contributor Author

@k8s-bot unit test this

@madhusudancs
Copy link
Contributor Author

@k8s-bot unit test this

@nikhiljindal
Copy link
Contributor

@k8s-bot unit test this

@madhusudancs
Copy link
Contributor Author

@k8s-oncall pinging k8s-bot doesn't seem to work. Any idea what's going on?

@saad-ali
Copy link
Member

saad-ali commented Nov 1, 2016

@k8s-bot unit test this

@saad-ali
Copy link
Member

saad-ali commented Nov 1, 2016

@kubernetes/test-infra-admins Any ideas why k8s-bot is not responding?

@saad-ali
Copy link
Member

saad-ali commented Nov 1, 2016

@k8s-bot unit test this, Issue #35898

@saad-ali
Copy link
Member

saad-ali commented Nov 1, 2016

Manually merging to unblock--failing unit test is due to #35898. All other tests are green.

@saad-ali saad-ali merged commit edab99b into kubernetes:master Nov 1, 2016
@madhusudancs
Copy link
Contributor Author

@saad-ali thanks!

@ixdy
Copy link
Member

ixdy commented Nov 1, 2016

it looks like the tests were run several times (per https://k8s-gubernator.appspot.com/pr/35153), but I don't know why it didn't update the commit status here. @spxtr any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants