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

Add support for Pod Identity Association #376

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

psivananda
Copy link

@psivananda psivananda commented Jul 12, 2024

Issue #, if available: Closes #300

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@psivananda psivananda requested a review from a team as a code owner July 12, 2024 04:06
@@ -1,7 +1,7 @@
image:
repository: public.ecr.aws/aws-secrets-manager/secrets-store-csi-driver-provider-aws
pullPolicy: IfNotPresent
tag: 1.0.r2-72-gfb78a36-2024.05.29.23.03
tag: 0.3.9-st
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tag corresponds to the docker image version id, we push this image and update the chart information accordingly. Can you remove this from your diff?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simonmarty removed tag and .DS_STORE

.DS_Store Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exclude this from the diff

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@psivananda psivananda requested a review from simonmarty July 13, 2024 23:44
klog.Errorf("Need IAM role for service account %s (namespace: %s) - %s", p.svcAcc, p.nameSpace, docURL)
return nil, fmt.Errorf("An IAM role must be associated with service account %s (namespace: %s)", p.svcAcc, p.nameSpace)
}
// if len(roleArn) <= 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to delete this?

Copy link
Author

@psivananda psivananda Jul 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes ..otherwise we need to have some other condition to know this pod use IRSA or PIA
Current logic is if role-arn annotations in ServiceAcccount is empty then assume its PIA else IRSA

let me know if you have any other suggestion to differentiate between IRSA and PIA

image

@@ -1,6 +1,6 @@
apiVersion: v2
name: secrets-store-csi-driver-provider-aws
version: 0.3.9
version: 0.3.9-st
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave version numbers as-is. We'll take care of updating those.

@@ -41,3 +40,4 @@ securityContext:
allowPrivilegeEscalation: false

useFipsEndpoint: false
clusterName: xxxx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why xxxx instead of an empty key?

server/server.go Outdated
@@ -248,7 +242,6 @@ func (s *CSIDriverProviderServer) Version(ctx context.Context, req *v1alpha1.Ver
// then describing the node to get the region label.
//
// See also: https://pkg.go.dev/k8s.io/client-go/kubernetes/typed/core/v1
//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these formatting changes serve a practical purpose (legitimately asking)? If the existing formatting is messing up generated docs or whatnot, it's fair to update them. It would be better to do it in a separate PR and focus this one on Pod Identity Association support.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format changes fixed

@simonmarty simonmarty changed the title 300 : Support for PIA Add support for Pod Identity Association Jul 16, 2024
@psivananda psivananda requested a review from simonmarty July 17, 2024 02:43
@simonmarty simonmarty marked this pull request as draft July 23, 2024 20:53
@psivananda psivananda marked this pull request as ready for review July 24, 2024 13:59
@goyalya
Copy link

goyalya commented Aug 16, 2024

Thank you submitting the changes. We are conducting initial investigation on this feature request and will share updates soon.

}, metav1.CreateOptions{})
if err != nil {
return nil, err
if ctx.Value("roleArn") != nil && ctx.Value("roleArn").(string) == "" { // get token for Pod Identity Assosciation
Copy link

@bnazanb bnazanb Aug 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are conditions correct? if roleArn NOT = nil? What about the case where there is no annotation at all?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes ..if no role-arn then assume its Pod Identity otherwise we need to have a placeholder to inform drvier that this is using IRSA or PIA

if err != nil {
return nil, err
if len(*roleArn) <= 0 {
klog.Info("RoleArn is empty so assuming it's Pod Identity and Getting session for Pod Idendity Role for podname - ", podName)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: Idendity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pod Identity Association not recognised by secrets store CSI driver
5 participants