Hi! I've been trying to start up flink with the ku...
# troubleshooting
s
Hi! I've been trying to start up flink with the kubernetes operator but I'm struggling with the service account. Is it possible to use one that is not named
flink
in a
FlinkDeployment
? I have two service accounts pointing to the same role. The one named
flink
works just fine but the one with a different names runs into a
403
issue when trying to query the kubernetes api. (I've attached the error log in the thread). Thanks a lot for your help!
Untitled
c
Hi Sebastia, Sure it's possible. Here is what I have in my k8-config.yaml --- apiVersion: v1 kind: ServiceAccount metadata: name: flink-serviceaccount namespace: flink --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: flink-cluster-role rules: - apiGroups: [""] resources: ["configmaps", "pods", "services", "persistentvolumeclaims","endpoints"] verbs: ["get", "watch", "list", "create", "delete", "update","patch"] - apiGroups: ["apps"] resources: ["deployments"] verbs: ["get", "watch", "list"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: flink-cluster-rolebinding subjects: - kind: ServiceAccount name: default namespace: flink roleRef: kind: ClusterRole name: flink-cluster-role apiGroup: rbac.authorization.k8s.io
p
As @Chad Theis said, the name of the service account does not make a difference.
s
Thanks a lot for your help! Is it possible to use different service accounts for each job? I’ve tried using a replacing it in the
jobServiceAccount
and in the
FlinkDefinition
to something besides
flink
and it worked, but my goal would be to be able to make each
FlinkDeployment
use a different service account so we can limit the resources it can access.
p
Thanks a lot for your help! Is it possible to use different service accounts for each job?
Sure thing.
but my goal would be to be able to make each
FlinkDeployment
use a different service account so we can limit the resources it can access
You can do that. It's nice because you can control what each deployment is doing. Are you facing any challenge there?