-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Enable service account signing key rotation #34029
Enable service account signing key rotation #34029
Conversation
@erictune PTAL |
41f7639
to
ffa2593
Compare
@@ -70,9 +70,10 @@ func (s *APIServer) AddFlags(fs *pflag.FlagSet) { | |||
fs.DurationVar(&s.EventTTL, "event-ttl", s.EventTTL, | |||
"Amount of time to retain events. Default is 1h.") | |||
|
|||
fs.StringVar(&s.ServiceAccountKeyFile, "service-account-key-file", s.ServiceAccountKeyFile, ""+ | |||
fs.StringArrayVar(&s.ServiceAccountKeyFiles, "service-account-key-file", s.ServiceAccountKeyFiles, ""+ |
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.
How does this translate into which keys actually sign the token? I've been trying to hunt down that code path but haven't been able to find it.
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.
only a single key signs the token, and that private key is given to the controller manager:
kube-controller-manager --help 2>&1 | grep service-account
--service-account-private-key-file string
Filename containing a PEM-encoded private RSA or ECDSA key used to sign service account tokens.
01eb918
to
6d382f1
Compare
6d382f1
to
e6bcba6
Compare
e6bcba6
to
3c92eb7
Compare
Jenkins GCI GCE e2e failed for commit 3c92eb7. Full PR test history. The magic incantation to run this job again is |
@k8s-bot gci gce e2e test this |
@alex-mohr @roberthbailey |
@liggitt can you write a few sentences reminding what the overall steps are for rotation? |
I would like to understand the steps as well, and what in my mind is:
am I right? |
correct, updated the PR description |
LGTM |
Filed kubernetes/website#1421 to get this procedure documented. |
Automatic merge from submit-queue |
fixes #21007
This PR enables the apiserver authenticator to verify service account tokens signed by different private keys. This can be done two different ways:
--service-account-key-file=keys.pem
)--service-account-key-file current-key.pem --service-account-key-file=old-key.pem
)This is part of enabling signing key rotation:
--service-account-lookup
must be enabled on the apiserver.This change is