-
Notifications
You must be signed in to change notification settings - Fork 40k
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 a kubectl create secret tls command #24719
Conversation
The public/private key pair must exist before hand. The public key certificate must be .PEM encoded and match the given private key.` | ||
|
||
secretForTLSExample = ` # You can create a TLS secret using: | ||
$ kubectl create secret tls tls-secret-name --cert=path to tls.cert --key=path to tls.key` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path/to/tls.cert
return fmt.Errorf("certificate must be specified.") | ||
} | ||
// TODO: Add more validation. | ||
// 1. Public/private key pair match. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this one as required for merge. We really want to be sure that what people give us for these isn't borked.
@Kargakis generators! |
whatcanyoudo |
The public/private key pair must exist before hand. The public key certificate must be .PEM encoded and match the given private key. | ||
|
||
``` | ||
kubectl create secret tls NAME --cert=path to cert file --key=path to key file [--dry-run] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest not using space in flag arguments. How about --cert=path/to/cert/file
or --cert=CERTFILE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Need to regenerate?
I'm now loading the key pair and throwing errors back, also added a unittest for the same. PTAL. |
The public/private key pair must exist before hand. The public key certificate must be .PEM encoded and match the given private key.` | ||
|
||
secretForTLSExample = ` # Create a new TLS secret named tls-secret with the given key pair: | ||
$ kubectl create secret tls tls-secret --cert=path/to/tls.cert --key=path/to/tls.key` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have stopped using the dollar sign in kubectl examples
I'd like to see a usage example in |
A couple more tests (noted in comments) and this lgtm. |
bb02fb9
to
c93aaac
Compare
PTAL, sorry for the huge delay in updating this. Got sidetracked with 1.3 stuff. |
@bprashanth I think it just needs an update to the help (some comments outstanding) and its ready. |
lgtm |
Forgot to git add file, inheriting LGTM |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit daa8e29. |
Automatic merge from submit-queue |
A somewhat hasty implementation that enables progress along: #20176 (comment), #24669, #20176 (comment) if associated parties have spare cycles. @kubernetes/kubectl
This change is