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

AWS Pod identity: Required to explicitly set the serviceAccount in the workload #4767

Closed
Tracked by #4795
JorTurFer opened this issue Jul 3, 2023 · 0 comments · Fixed by #4768
Closed
Tracked by #4795

AWS Pod identity: Required to explicitly set the serviceAccount in the workload #4767

JorTurFer opened this issue Jul 3, 2023 · 0 comments · Fixed by #4768
Labels
bug Something isn't working

Comments

@JorTurFer
Copy link
Member

Report

Currently, we are checking the workload serviceAccount and we use it to recover the serviceAccount for getting the annotations:

if podIdentity.Provider == kedav1alpha1.PodIdentityProviderAwsEKS {
serviceAccountName := podTemplateSpec.Spec.ServiceAccountName
serviceAccount := &corev1.ServiceAccount{}
err := client.Get(ctx, types.NamespacedName{Name: serviceAccountName, Namespace: namespace}, serviceAccount)
if err != nil {
return nil, kedav1alpha1.AuthPodIdentity{Provider: kedav1alpha1.PodIdentityProviderNone},
fmt.Errorf("error getting service account: '%s', error: %w", serviceAccountName, err)
}
authParams["awsRoleArn"] = serviceAccount.Annotations[kedav1alpha1.PodIdentityAnnotationEKS]
} else if podIdentity.Provider == kedav1alpha1.PodIdentityProviderAwsKiam {

The problem is that currently, this code requires that the service account is explicitly set, which isn't good.

Expected Behavior

Use default service account if it's not provided

Actual Behavior

failure

Steps to Reproduce the Problem

Logs from KEDA operator

example

KEDA Version

None

Kubernetes Version

None

Platform

None

Scaler Details

No response

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant