-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
"kops update cluster" panics while creating JWKS for OIDC #14174
Comments
It turns out that the
|
If I add the following guard condition to if item.Certificate == nil || item.Certificate.Subject.CommonName != "service-account" {
continue
} Does that preserve all the items that this method was expecting to consume? |
Note that the kops get keypairs subcommand fails similarly, due to assuming that every key set item contains an X.509 certificate.
|
@seh Would you like to continue to iterate on the fix? |
Yes, though it would help to hear whether or not these entries that lack certificates are valid. Can kOps use them for anything? Should I ignore them as if they were distrusted? |
Ignore them as distrusted, but list them and make them deletable, I would say. |
I guess I didn't research far back enough in the history of the keystore code. kOps can't use a private key without a certificate for anything unless/until it generates a corresponding certificate. (Though for service-account keypairs the only part of the certificate it uses is the public key.) These days all code paths that create a key also create a corresponding certificate. I would agree that keys without certificates should be ignored as if distrusted. |
As this is not a regression or something that breaks things for a lot of users, I removed the blocks-next label. |
1. What
kops
version are you running?Client version: 1.24.1 (git-v1.24.1)
2. What Kubernetes version are you running?
Starting with version 1.19.9, upgrading to version 1.21.14.
3. What cloud provider are you using?
AWS
4. What commands did you run? What is the simplest way to reproduce this issue?
5. What happened after the commands executed?
It appears that kops update cluster fails when it panics preparing for publishing OIDC Discovery documents to an S3 bucket:
It appears to be failing on this line in file pkg/model/issuerdiscovery.go, trying to access a public key in memory.
6. What did you expect to happen?
kops update cluster would publish all the OIDC Discovery documents to S3, and continue on with the rest of its tasks.
7. Please provide your cluster manifest.
cluster.yaml file
8. Please run the commands with most verbose logging by adding the
-v 10
flag.Paste the logs into this report, or in a gist and provide the gist link here.
Here is the kops update cluster output at verbosity level ten, just before the failure:
Earlier, I see this pertinent log message:
Note that at present, the aforementioned S3 bucket exists, but there is no existing object with the path my-cluster/openid/v1/jwks.
9. Anything else do we need to know?
I have been able to upgrade clusters and activate the "spec.serviceAccountIssuerDiscovery.enableAWSOIDCProvider" field's behavior successfully with earlier versions of kOps, which wrote the S3 object as necessary. This version of kOps appears to be failing before it can create this S3 object. kOps was able to create the my-cluster/.well-known/openid-configuration object in the same bucket.
See #13353 for what looks to be an earlier report of a similar defect.
See the prior discussion in the "kops-users" channel of the "Kubernetes" Slack workspace.
/kind bug
The text was updated successfully, but these errors were encountered: