-
Notifications
You must be signed in to change notification settings - Fork 18
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 prop for setting service account name #136
Comments
My disgraceful but effective workaround: const orig = myCluster.addServiceAccount.bind(myCluster);
const patched = (id: string, props: eks.ServiceAccountProps) => {
const patchedProps = id === 'karpenter' ? { ...props, name: 'karpenter' } : props;
return orig(id, patchedProps);
};
// @ts-ignore
myCluster.addServiceAccount = patched; This allows me to make cdk-eks-karpenter/src/index.ts Lines 112 to 114 in c4179c0
this.serviceAccount = this.cluster.addServiceAccount('karpenter', {
namespace: this.namespace,
name: 'karpenter',
}); |
@plumdog thanks for the report! Would it make sense to just default the serivceAccountName to |
@andskli Yes, I think just defaulting to And I agree it makes sense to treat that as an implementation detail, rather than a breaking change. |
This is unset so defaults to the
id
of the resource, per https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.ServiceAccount.html#nameThis can get very long (I'm using CDK pipelines) and Kubernetes caps the length of the label at 63 characters.
Should add an option to allow me to set this.
I'm investigating whether I can handle this with CDK escape hatches.
The text was updated successfully, but these errors were encountered: