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

feat: Add support for Pod Identity assocation on Karpenter sub-module #3031

Merged

Conversation

rodrigobersa
Copy link
Contributor

@rodrigobersa rodrigobersa commented May 8, 2024

Description

This update aims mainly to create the Pod Identity association for Karpenter, replacing IRSA.

Module changes

  • Create Pod Identity association on module/karpenter
  • Added a variable as a condition to create the association
  • Added outputs for Namespace and Service Account associated to Pod Identity

Example changes:

  • Moved from Fargate profiles to Managed Node Groups (Pod Identity is not supported on Fargate)
  • Added Pod Identity Agent addon deployment
  • Updated Karpenter chart version to v0.36.1
  • Removed unnecessary values from Karpenter Helm deployment

Motivation and Context

Pod Identity is now the recommended approach to provide access to Pods on Amazon EKS Cluster. Fargate profiles are very limited on Amazon EKS and may be avoided unless specific usecases.

Breaking Changes

No.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request
$ kubectl scale deploy inflate --replicas 10
$ kubectl get pods -A -o wide                 
NAMESPACE     NAME                           READY   STATUS    RESTARTS      AGE   IP            NODE                                        NOMINATED NODE   READINESS GATES
default       inflate-75d744d4c6-78c84       1/1     Running   0             17m   10.0.18.31    ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
default       inflate-75d744d4c6-85g76       1/1     Running   0             17m   10.0.17.35    ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
default       inflate-75d744d4c6-886wh       1/1     Running   0             17m   10.0.29.140   ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
default       inflate-75d744d4c6-jvgp5       1/1     Running   0             17m   10.0.31.137   ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
default       inflate-75d744d4c6-lxf5b       1/1     Running   0             17m   10.0.25.80    ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
default       inflate-75d744d4c6-nqwz8       1/1     Running   0             17m   10.0.24.159   ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
default       inflate-75d744d4c6-nrqnn       1/1     Running   0             17m   10.0.21.175   ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
default       inflate-75d744d4c6-sp4dx       1/1     Running   0             17m   10.0.17.192   ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
default       inflate-75d744d4c6-xqzd9       1/1     Running   0             17m   10.0.22.194   ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
default       inflate-75d744d4c6-xr6p5       1/1     Running   0             17m   10.0.25.86    ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
kube-system   aws-node-mnn7r                 2/2     Running   0             20m   10.0.3.23     ip-10-0-3-23.eu-west-1.compute.internal     <none>           <none>
kube-system   aws-node-rkmvm                 2/2     Running   0             16m   10.0.16.155   ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
kube-system   aws-node-s4slh                 2/2     Running   0             20m   10.0.41.2     ip-10-0-41-2.eu-west-1.compute.internal     <none>           <none>
kube-system   coredns-68bd859788-7rcfq       1/1     Running   0             25m   10.0.2.247    ip-10-0-3-23.eu-west-1.compute.internal     <none>           <none>
kube-system   coredns-68bd859788-l78hw       1/1     Running   0             25m   10.0.39.197   ip-10-0-41-2.eu-west-1.compute.internal     <none>           <none>
kube-system   eks-pod-identity-agent-gbx8l   1/1     Running   0             20m   10.0.41.2     ip-10-0-41-2.eu-west-1.compute.internal     <none>           <none>
kube-system   eks-pod-identity-agent-s7vt7   1/1     Running   0             16m   10.0.16.155   ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
kube-system   eks-pod-identity-agent-xwgqw   1/1     Running   0             20m   10.0.3.23     ip-10-0-3-23.eu-west-1.compute.internal     <none>           <none>
kube-system   karpenter-79f59bdfdc-9q5ff     1/1     Running   0             22m   10.0.36.20    ip-10-0-41-2.eu-west-1.compute.internal     <none>           <none>
kube-system   karpenter-79f59bdfdc-cxvhr     1/1     Running   1 (20m ago)   22m   10.0.5.160    ip-10-0-3-23.eu-west-1.compute.internal     <none>           <none>
kube-system   kube-proxy-7crbl               1/1     Running   0             21m   10.0.41.2     ip-10-0-41-2.eu-west-1.compute.internal     <none>           <none>
kube-system   kube-proxy-jtzds               1/1     Running   0             16m   10.0.16.155   ip-10-0-16-155.eu-west-1.compute.internal   <none>           <none>
kube-system   kube-proxy-sm42c               1/1     Running   0             21m   10.0.3.23     ip-10-0-3-23.eu-west-1.compute.internal     <none>           <none>

$ kubectl get nodes -L karpenter.sh/registered
NAME                                        STATUS   ROLES    AGE   VERSION               REGISTERED
ip-10-0-16-155.eu-west-1.compute.internal   Ready    <none>   17m   v1.29.3-eks-ae9a62a   true
ip-10-0-3-23.eu-west-1.compute.internal     Ready    <none>   21m   v1.29.3-eks-ae9a62a   
ip-10-0-41-2.eu-west-1.compute.internal     Ready    <none>   21m   v1.29.3-eks-ae9a62a  

@bryantbiggs bryantbiggs changed the title chore: Update Karpenter module and example feat: Add support for Pod Identity assocation on Karpenter sub-module May 9, 2024
@bryantbiggs bryantbiggs merged commit cfcaf27 into terraform-aws-modules:master May 9, 2024
19 checks passed
antonbabenko pushed a commit that referenced this pull request May 9, 2024
## [20.10.0](v20.9.0...v20.10.0) (2024-05-09)

### Features

* Add support for Pod Identity assocation on Karpenter sub-module ([#3031](#3031)) ([cfcaf27](cfcaf27))
@antonbabenko
Copy link
Member

This PR is included in version 20.10.0 🎉

Copy link

github-actions bot commented Jun 9, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants