-
Notifications
You must be signed in to change notification settings - Fork 404
Controller cannot find aws config Missing credentials in config #287
Comments
I believe the Edit for future readers, my assumption here was wrong. |
I forgot to mention that each node in k8s (that is essentially ec2) has policy that allows to read ssm and aws secrets. "1. Granting your nodes explicit access to your secrets using the node instance role (easy for experimentation, not recommended)" I dont know if that changes anything. Cheers |
I disabled instance profile IAM roles for the pods https://docs.aws.amazon.com/eks/latest/userguide/restrict-ec2-credential-access.html and am using IAM roles for service accounts, but the controller insists on using the instance profile.
I can see the credentials being there as The secret no longer has the Could it be that IAM roles for service account does not work at all? |
In my case, I tested earlier by allowing the instance profile to assume the role mentioned in |
Is it possible this is related to #254 for Fargate/WebIdentity support? Looks like similar errors relating to not being able to reach the EC2 metadata API (which isn't available on Fargate instances). If so; this fix is merged to master now, waiting on a release :) |
Hey everyone, I'm confused if the issue is solved and have the impression it isn't solved. As far as I understand in #254 it was mentioned that it is solved, which relates to the comment from the first of July. In #442 it looks like #254 was reverted. I deployed external secret with the docker image godaddy/kubernetes-external-secrets:5.2.0 Still the issue is for me:
Also the environment variables are set fine (I think)
Any ideas? |
Its correct it was reverted as it broke other things and wasn't needed. Make sure security context is properly set. |
I saws your comment and my use case is slightly different. In you example you assume a role to access the external secret. In my case the IRSA role is allowed to directly access the external secret. This was working fine in a EKS with EC2 instances. The documentation says: "Additionally, you can specify a roleArn which will be assumed before retrieving the secret." I understand it isn't a requirement. The security context is right. Here is my helm chart yaml. customResourceManagerDisabled: false
crds:
create: false
env:
AWS_REGION: eu-central-1
AWS_DEFAULT_REGION: eu-central-1
POLLER_INTERVAL_MILLISECONDS: 60000
LOG_LEVEL: info
LOG_MESSAGE_KEY: 'msg'
METRICS_PORT: 3001
VAULT_ADDR: http://127.0.0.1:8200
rbac:
create: true
serviceAccount:
create: true
annotations: {
eks.amazonaws.com/role-arn: arn:aws:iam::REMOVED:role/REMOVED
}
name: REMOVED
replicaCount: 1
image:
repository: REMOVED.dkr.ecr.eu-central-1.amazonaws.com/godaddy/kubernetes-external-secrets
tag: 5.2.0
pullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
podAnnotations: {}
podLabels: {}
dnsConfig: {}
securityContext:
runAsNonRoot: false
fsGroup: 65534
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
serviceMonitor:
enabled: false
interval: "30s"
namespace: I'll try later to see if the assume role for a secret may change the behavior. |
I still vote for a flag to allow explicitly using WebIdentity 🤷♂️ :) maybe a try/catch to use web identity if assume role fails and the web identity file is present? |
I think my issue lies somewhere else. In the AWS console I get the message, that my Role for the pod was Not accessed in the tracking period. I installed the aws cli in the pod and get the following error: aws sts get-caller-identity An error occurred (AccessDenied) when calling the AssumeRoleWithWebIdentity operation: Not authorized to perform sts:AssumeRoleWithWebIdentity I need to find out why this isn't working and hopefully the issue will then solve itself. |
I found the issue. In my trust relationship of the role I had the condition key oidc.eks.eu-central-1.amazonaws.com/id/...:aud configured but it needs to be oidc.eks.eu-central-1.amazonaws.com/id/...:sub Thank you for your efforts. From my point of view it looks like the flag allow explicitly using WebIdentity isn't required, as it is working out of the box |
Ok cool, I'll go back in my box 😄 |
I've installed controller with:
helm install hello-name --set env.AWS_REGION=eu-west-1 --set securityContext.fsGroup=65534 --set serviceAccount.annotations."eks.amazonaws.com/role-arn"='arn:aws:iam::AWS-ACCOUNT:role/ROLE-NAME' external-secrets/kubernetes-external-secrets
kubeclt apply this file
secret.yaml:
when I kubectl describe pod
still got this issue:
The text was updated successfully, but these errors were encountered: