-
Notifications
You must be signed in to change notification settings - Fork 11
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
Set up pod identity association in E2E tests #329
Conversation
namespace = "default" | ||
) | ||
|
||
func NewPodIdentityAddon(cluster, name, roleArn string) PodIdentityAddon { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the addon always the same? If so, why does the caller need to provide? This constructor is already exclusive for the pod identity addon, so i think it encapsulate de knowlege of the addon name and hide that detail from the caller
Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good suggestion. I will add it to my part3 PR.
}, | ||
} | ||
|
||
if _, err := k8s.CoreV1().ServiceAccounts(namespace).Create(ctx, serviceAccount, metav1.CreateOptions{}); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we probably should probably retry this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep it this way for now. I'd like to understand what errors we may have and what errors are retryable.
Issue #, if available:
This is part 2 of setting up E2E tests for pod identity. Part 1 PR
Description of changes:
This PR covers pod identity association setup.
(Since this PR already contains enough changes, I will create another PR to actually deploy pods and verify EKS Pod Identity volume is correctly attached.)
I followed this public document to set up pod identity association.
In summary, the following is required in order to set up pod identity association.
The creation of service account and pod identity association can only be done after the EKS cluster is provisioned successfully. We can put this into either
Here I choose to put it into creation of pod identity add-on. The reason for it is we don't need to check or set up this association in every
OS/auth provider
combination. It should be a one-time setup for the whole EKS cluster.The creation of IAM role of pod identity can be put into
nodeadm-stack.ts
to provision one IAM role for allkube/CNI
combinationsetup-cfn.yaml
to provision one IAM role for allOS/Auth provider
under onekube/CNI
combinationOS/Auth provider
Option 3 is not applicable for two reasons.
OS/Auth provider
Option 1 and 2 are both working but I choose option 2 because it makes more sense as the role is tied to one cluster, which the lifecycle is managed by CloudFormation.
Testing (if applicable):
Documentation added/planned (if applicable):
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.