Closed jicowan closed 1 year ago
Similar to issue #40
Hi Jicowan, Thanks for reaching out. Let me check on it by reproducing the issue.
There are automated tests with IRSA: https://github.com/cert-manager/aws-privateca-issuer/actions/runs/5596273966/job/15158311416#step:18:1 which passed 3 days ago.
If this turns out to be a reproducible issue, worth taking a look there to see why those tests aren't catching the issue.
Were you using a subordinate CA? I don't know why that would matter, but maybe...
Hi, On initial look at your role trust policy
"StringEquals": {
"oidc.eks.<region>.amazonaws.com/id/9D5D6851D8B6072929E0E4D984DD9D97:sub": "system:serviceaccount:cert-manager-aws-privateca-issuer:cert-manager",
"oidc.eks.<region>.amazonaws.com/id/9D5D6851D8B6072929E0E4D984DD9D97:aud": "sts.amazonaws.com"
}
Doesn't seem to match
"StringEquals": {
"${OIDC_URL}:sub": "system:serviceaccount:aws-privateca-issuer:aws-privateca-issuer-sa"
}
Could you change it to the latter and see if that helps.
i used eksctl to create the role & service account. You think it's formatting the trust policy incorrectly?
Mind sharing the eksctl commands? Notice they aren't in the reproduction steps.
eksctl create iamserviceaccount \
--cluster=fargate-karpenter \
--namespace=cert-manager \
--name=cert-manager-aws-privateca-issuer \
--attach-policy-arn=arn:aws:iam::<account>:policy/AWSPCAIssuerIAMPolicy \
--override-existing-serviceaccounts \
--region <region> \
--approve
It's failing here https://github.com/cert-manager/aws-privateca-issuer/blob/65bce2a5a64dbc6be0c32b84a3596fc25385c0c0/pkg/controllers/genericissuer_controller.go#L71-L96 but I'm not sure why. The IRSA env variables are being injected. The AWS SDK should use those to authenticate.
I had the wrong service account name in the trust policy, ugh.
Glad you were able to figure that out.
Describe the expected outcome
I am trying to request a certificate from the AWS Private CA. I've configured a subordinate CA to issue client (SSL) certificates. I expect to see an Certificate object in Kubernetes after applying the following:
Describe the actual outcome
When I try requesting a certificate, I see the following error in the log:
I confirmed that my ServiceAccount is referencing the appropriate role ARN and I can see that the IRSA environment variables are being injected into the container for the private CA issuer. I am using public.ecr.aws/k1n1h4h4/cert-manager-aws-privateca-issuer:v1.2.5.
Role trust policy:
Steps to reproduce
Install cert-manager Install private ca issuer Configure IRSA and update service account to reference role ARN Create a AWSPCAClusterIssuer Create a Certificate
Relevant log output