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

Add kubeadm alpha certs certificate-key command #77848

Merged
merged 1 commit into from May 29, 2019

Conversation

yagonobre
Copy link
Member

@yagonobre yagonobre commented May 14, 2019

What type of PR is this?
/kind feature

What this PR does / why we need it:
Add kubeadm certificate-key command to generate secure random key to use on kubeadm init --experimental-upload-certs

Which issue(s) this PR fixes:
Does this PR introduce a user-facing change?:

Add `kubeadm alpha certs certificate-key` command to generate secure random key to use on `kubeadm init --experimental-upload-certs`

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 14, 2019
@k8s-ci-robot k8s-ci-robot requested review from liztio and luxas May 14, 2019 04:46
@k8s-ci-robot k8s-ci-robot added area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 14, 2019
@yagonobre
Copy link
Member Author

/assign @neolit123 @fabriziopandini

// NewCmdCertificateKey returns cobra.Command for certificate key generate
func NewCmdCertificateKey() *cobra.Command {
return &cobra.Command{
Use: "certificate-key",
Copy link
Member

Choose a reason for hiding this comment

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

hm, i wonder if we should just use the init phase for this.
adding a top level command would be fine if has more than one sub commands and multiple flags, but right now it would only serve this single purpose.

on the other hand we already have kubeadm token which covers existing functionality in init.

we also have the option here to have kubeadm certificate-key do multiple things:

  • only generate key
  • upload the certs & generate key (duplicates what the init phase does)

Copy link
Member

Choose a reason for hiding this comment

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

also, a problem related to UX that i've been seeing is that users want the new full join command when generating a new cert-key.

so they use token ... --print-join-command and combine it with the new cert key manually.

there are no good solutions for this unless we have a command that generates both a new bootstrap token + hash + cert key.

Copy link
Member Author

Choose a reason for hiding this comment

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

this command just generate a certificate-key, so user can only use it on init and init print the join command, we can print the init command but token generate just print the token.

Copy link
Member Author

Choose a reason for hiding this comment

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

due that the certificate-key can't be manually generate on a easy way, it would be nice to have a command for it, but I agree that a top level command only for this seems weird.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @neolit123 . My idea is that this is an utility for certificates and should go with the rest of the certs commands. Probably adding it under kubeadm alpha certs is a good idea.
@fabriziopandini @yagonobre @neolit123 WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

+1 to move to kubeadm alpha certs

Copy link
Member

Choose a reason for hiding this comment

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

+1

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 27, 2019
@yagonobre yagonobre force-pushed the certificate-key-command branch 2 times, most recently from f746458 to b6e6b46 Compare May 27, 2019 00:45
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 27, 2019
@yagonobre
Copy link
Member Author

@neolit123 @rosti updated!

Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

@yagonobre one minor comment about date but LGTM.
/approve

@@ -1,5 +1,5 @@
/*
Copyright 2018 The Kubernetes Authors.
Copyright 2019 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

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

apparently, the project does not change dates of old source files.
2018 should be kept here.

Copy link
Member Author

Choose a reason for hiding this comment

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

til

Copy link
Member Author

Choose a reason for hiding this comment

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

updated!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neolit123, yagonobre

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 27, 2019
@yagonobre yagonobre changed the title Add kubeadm certificate-key command Add kubeadm alpha phase certs certificate-key command May 27, 2019
Copy link
Contributor

@rosti rosti left a comment

Choose a reason for hiding this comment

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

Thanks @yagonobre !
Given that this is an alpha command ATM, it's late in the cycle and it's simple enough, I think that it's OK to merge it as is (although it needs a simple test case and some UX polishing upon graduation).
/lgtm
/hold
for the release note to be reflecting kubeadm alpha certs certificate-key instead of kubeadm certificate-key.

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels May 27, 2019
@yagonobre yagonobre changed the title Add kubeadm alpha phase certs certificate-key command Add kubeadm alpha certs certificate-key command May 27, 2019
@rosti
Copy link
Contributor

rosti commented May 27, 2019

Thanks @yagonobre !
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 27, 2019
@rosti
Copy link
Contributor

rosti commented May 27, 2019

/test pull-kubernetes-kubemark-e2e-gce-big

@neolit123
Copy link
Member

/retest

1 similar comment
@neolit123
Copy link
Member

/retest

@yagonobre
Copy link
Member Author

/test pull-kubernetes-kubemark-e2e-gce-big

@neolit123
Copy link
Member

/retest

1 similar comment
@neolit123
Copy link
Member

/retest

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

2 similar comments
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 6118b8a into kubernetes:master May 29, 2019
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. area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants