Hi, I was trying to use aws IAM to access s3, but...
# random
z
Hi, I was trying to use aws IAM to access s3, but couldn’t get it working. I used the oidc assume role for the service account and passed the iam role as below, but the job was failing to start because it failed to locate the iam role info. What am I missing here?
Copy code
flinkConfiguration:
    taskmanager.numberOfTaskSlots: "2"
    state.checkpoints.dir: <s3://bucket>
    state.savepoints.dir: <s3://bucekt>
    fs.s3a.aws.credentials.provider: com.amazonaws.auth.WebIdentityTokenCredentialsProvider
    fs.s3a.aws.credentials.provider.role.arn: iam arn
  serviceAccount: flink
Copy code
Caused by: java.lang.NullPointerException: You must specify a value for roleArn and roleSessionName
	at com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider$Builder.<init>(STSAssumeRoleSessionCredentialsProvider.java:383) ~[?:?]
a
Is this in EKS? I added the following annotation to the
flink
service account with the IAM role ARN as the value.
<http://eks.amazonaws.com/role-arn|eks.amazonaws.com/role-arn>
z
Is this in EKS?
Yes.
How do you do that? The
flink
service account is created by the
k8s flink operator
.
How do you add additional annotation?
a
If you use helm to deploy the operator, you can set the following in the values file
Copy code
jobServiceAccount:
  annotations:
    <http://eks.amazonaws.com/role-arn|eks.amazonaws.com/role-arn>: arn:aws:iam::...
z
cool. thanks!
👍 1
we actually use argocd for deploying the helm chart.
Copy code
spec:
      destination:
        name: ''
        namespace: data
      project: k8s-flink-operator
      source:
        repoURL: <https://github.com/apache/flink-kubernetes-operator>
        targetRevision: release-1.4
        path: helm/flink-kubernetes-operator
        helm:
          skipCrds: true
          parameters:
          - name: "webhook.create"
            value: "false"
          - name: "image.repository"
            value: "apache/flink-kubernetes-operator"
a
I deploy from terraform with the following. You may need to escape the
.
characters in the annotation name in a similar manor.
Copy code
set {
    name  = "jobServiceAccount.annotations.eks\\.amazonaws\\.com/role-arn"
    value = "<role_arn_here>"
  }
👍 1