Include multiple certs in aws-iam-authenticator trust bundle

This commit is contained in:
John Gardiner Myers 2021-06-20 17:15:50 -07:00
parent e64c9c2c45
commit fc94505a76
1 changed files with 2 additions and 1 deletions

View File

@ -201,7 +201,7 @@ func (b *KubeAPIServerBuilder) writeAuthenticationConfig(c *fi.ModelBuilderConte
b.Cluster.Spec.KubeAPIServer.AuthenticationTokenWebhookConfigFile = fi.String(PathAuthnConfig)
{
caCertificate, err := b.NodeupModelContext.KeyStore.FindCert(fi.CertificateIDCA)
caCertificate, _, err := b.NodeupModelContext.KeyStore.FindPrimaryKeypair(fi.CertificateIDCA)
if err != nil {
return fmt.Errorf("error fetching AWS IAM Authentication CA certificate from keystore: %v", err)
}
@ -217,6 +217,7 @@ func (b *KubeAPIServerBuilder) writeAuthenticationConfig(c *fi.ModelBuilderConte
User: "kube-apiserver",
}
// Since we're talking to localhost, we don't need the entire certificate bundle.
cluster.CertificateAuthorityData, err = caCertificate.AsBytes()
if err != nil {
return fmt.Errorf("error encoding AWS IAM Authentication CA certificate: %v", err)