Skip to content
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

[Feature] eksctl roleOnly parameter for podIdentityAssociations #7775

Closed
ruzickap opened this issue May 18, 2024 · 2 comments · Fixed by #7784
Closed

[Feature] eksctl roleOnly parameter for podIdentityAssociations #7775

ruzickap opened this issue May 18, 2024 · 2 comments · Fixed by #7784
Labels
kind/feature New feature or request priority/important-soon Ideally to be resolved in time for the next release

Comments

@ruzickap
Copy link

What feature/behavior/change do you want? + Why do you want this feature?

I would like to create the Pod Identity Associations without creating service accounts (like it was before eksctl v0.177.0.

Reason: Most of the Helm charts do create service accounts by default...

It would be create if roleOnly parameter can be introduced to allow the user to decide if the SA will be created or not:

iam:
  withOIDC: true
  podIdentityAssociations:
    - namespace: aws-ebs-csi-driver
      serviceAccountName: ebs-csi-controller-sa
      roleName: eksctl-test-pia-aws-ebs-csi-driver
      roleOnly: true                                 ##### <<<<<<<
      wellKnownPolicies:
        ebsCSIController: true

Details:

What happened?

eksctl in version v0.177.0 creates service account when using the podIdentityAssociations.

This was not the case before this version...

How to reproduce it?

Example:

$ export AWS_DEFAULT_REGION="us-east-1"

$ gh release download v0.176.0 --repo eksctl-io/eksctl --pattern eksctl_Darwin_arm64.tar.gz --output - | sudo tar xz -C /tmp/

$ /tmp/eksctl version
0.176.0

$ cat > /tmp/eksctl-test.yaml << EOF
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  region: us-east-1
  name: test
accessConfig:
  authenticationMode: API_AND_CONFIG_MAP
iam:
  withOIDC: true
  podIdentityAssociations:
    - namespace: aws-ebs-csi-driver
      serviceAccountName: ebs-csi-controller-sa
      roleName: eksctl-test-pia-aws-ebs-csi-driver
      wellKnownPolicies:
        ebsCSIController: true
addons:
  - name: eks-pod-identity-agent
managedNodeGroups:
  - name: mng01-ng
    instanceType: t4g.medium
    desiredCapacity: 2
    minSize: 2
    maxSize: 5
    volumeSize: 20
EOF

$ export KUBECONFIG="/tmp/kubeconfig-test.conf"
$ /tmp/eksctl create cluster --config-file "/tmp/eksctl-test.yaml" --kubeconfig "${KUBECONFIG}"
2024-05-18 20:38:43 [ℹ]  eksctl version 0.176.0
2024-05-18 20:38:43 [ℹ]  using region us-east-1
...

$ kubectl get serviceaccount -A | grep ebs
<...empty output...>

$ kubectl get ns
NAME              STATUS   AGE
default           Active   13m
kube-node-lease   Active   13m
kube-public       Active   13m
kube-system       Active   13m

As you can see there is no namespace/service account created.

Details:

Thank you...

@ruzickap ruzickap added the kind/feature New feature or request label May 18, 2024
@cPu1
Copy link
Collaborator

cPu1 commented May 24, 2024

Given that creating a service account by default was not the initial behavior for pod identity, and it has broken Helm and Karpenter users relying on eksctl not creating a corresponding service account by default, we are going to introduce a new field podIdentityAssociation.createServiceAccount that defaults to false so that use cases like #7507 are still possible. We have added this to our backlog and will work on a fix soon.

@TiberiuGC
Copy link
Collaborator

A release is now out with the new podIdentityAssociation.createServiceAccount option.
https://github.com/eksctl-io/eksctl/releases/tag/v0.180.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request priority/important-soon Ideally to be resolved in time for the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants