You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by GitBox <gi...@apache.org> on 2022/03/04 15:39:07 UTC
[GitHub] [flink-kubernetes-operator] mbalassi opened a new pull request #42: [FLINK-26308][FLINK-26471] Separate Flink job role from operator role
mbalassi opened a new pull request #42:
URL: https://github.com/apache/flink-kubernetes-operator/pull/42
This separates the Flink job role from the operator role, which fixes two issues:
1. That when the `operatorNamespace` is the same as one of the `watchNamespaces` the install fails due to attempted duplicated role creation which I introduced in #35.
2. That deleting the operator role affected jobs described in FLINK-26471.
@wangyang0918 has raised another issue with #35 [here](https://github.com/apache/flink-kubernetes-operator/pull/35#issuecomment-1058750206), that prior to 1.15 when using `watchNamespaces` unless the user explicitly sets
```
kubernetes.rest-service.exposed.type: ClusterIP
```
I would like to avoid overwriting the default Flink behavior in the operator, my suggestion is to present a warning to the user in the admission control validation and we might a line to the Readme / docs anyway.
Also while testing this change I have discovered that the webhook fails when we have multiple entries in `watchNamespaces`. I will fix these two issues in a separate PR early next week.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink-kubernetes-operator] mbalassi commented on a change in pull request #42: [FLINK-26308][FLINK-26471] Separate Flink job role from operator role
Posted by GitBox <gi...@apache.org>.
mbalassi commented on a change in pull request #42:
URL: https://github.com/apache/flink-kubernetes-operator/pull/42#discussion_r820695282
##########
File path: helm/flink-operator/templates/rbac.yaml
##########
@@ -132,7 +190,25 @@ roleRef:
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
- name: {{ template "flink-operator.serviceAccountName" . }}
+ name: {{ include "flink-operator.serviceAccountName" . }}
+ namespace: {{ .Values.operatorNamespace.name }}
+---
+apiVersion: rbac.authorization.k8s.io/v1
Review comment:
Fair point, given that we are trying to limit the footprint of the roles created I will create only role/rolebing in the operator namespace.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink-kubernetes-operator] wangyang0918 commented on a change in pull request #42: [FLINK-26308][FLINK-26471] Separate Flink job role from operator role
Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #42:
URL: https://github.com/apache/flink-kubernetes-operator/pull/42#discussion_r820367642
##########
File path: examples/basic-checkpoint-ha.yaml
##########
@@ -40,7 +40,7 @@ spec:
cpu: 1
podTemplate:
spec:
- serviceAccount: flink-operator
+ serviceAccount: flink
Review comment:
We could also update the serviceAccount in `e2e-tests/data/cr.yaml` to `flink`.
##########
File path: helm/flink-operator/templates/rbac.yaml
##########
@@ -132,7 +190,25 @@ roleRef:
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
- name: {{ template "flink-operator.serviceAccountName" . }}
+ name: {{ include "flink-operator.serviceAccountName" . }}
+ namespace: {{ .Values.operatorNamespace.name }}
+---
+apiVersion: rbac.authorization.k8s.io/v1
Review comment:
Given that watchNamespaces is not configured, I am thinking whether we really need to create the `ClusterRole` and `ClusterRoleBinding` for flink job. Maybe `Role` and `RoleBinding` is enough. If users want to create a FlinkDeployment in a different namespace with flink-k8s-operator, then they should create the `serviceAccount` `Role` `RoleBinding` manually.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink-kubernetes-operator] gyfora commented on a change in pull request #42: [FLINK-26308][FLINK-26471] Separate Flink job role from operator role
Posted by GitBox <gi...@apache.org>.
gyfora commented on a change in pull request #42:
URL: https://github.com/apache/flink-kubernetes-operator/pull/42#discussion_r820266305
##########
File path: helm/flink-operator/values.yaml
##########
@@ -36,11 +36,16 @@ rbac:
ingress:
create: false
-serviceAccount:
+operatorServiceAccount:
create: true
annotations: {}
name: "flink-operator"
+jobServiceAccount:
+ create: true
+ annotations: {"helm.sh/resource-policy": keep}
Review comment:
could this simply be?
```
annotations:
"helm.sh/resource-policy" : keep
```
##########
File path: examples/basic.yaml
##########
@@ -19,14 +19,14 @@
apiVersion: flink.apache.org/v1alpha1
kind: FlinkDeployment
metadata:
- namespace: default
+ namespace: flink-user
Review comment:
I think we should not change this in the example
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink-kubernetes-operator] mbalassi commented on pull request #42: [FLINK-26308][FLINK-26471] Separate Flink job role from operator role
Posted by GitBox <gi...@apache.org>.
mbalassi commented on pull request #42:
URL: https://github.com/apache/flink-kubernetes-operator/pull/42#issuecomment-1060702405
Thanks @wangyang0918 and @gyfora. I have addressed your comments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink-kubernetes-operator] mbalassi commented on pull request #42: [FLINK-26308][FLINK-26471] Separate Flink job role from operator role
Posted by GitBox <gi...@apache.org>.
mbalassi commented on pull request #42:
URL: https://github.com/apache/flink-kubernetes-operator/pull/42#issuecomment-1060765243
I added an admittedly ugly fix for the webhook not working for multiple namespaces. @wangyang0918 maybe you have a nicer approach for this. The summary is that when we pass the `watchNamespaces` array through the template the output looks as follows:
```
namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: In
values: [flink-user default]
```
Which creates a selector that cannot be matched, the correct value would be `["flink-user", "default"]`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink-kubernetes-operator] mbalassi commented on a change in pull request #42: [FLINK-26308][FLINK-26471] Separate Flink job role from operator role
Posted by GitBox <gi...@apache.org>.
mbalassi commented on a change in pull request #42:
URL: https://github.com/apache/flink-kubernetes-operator/pull/42#discussion_r820696210
##########
File path: examples/basic-checkpoint-ha.yaml
##########
@@ -40,7 +40,7 @@ spec:
cpu: 1
podTemplate:
spec:
- serviceAccount: flink-operator
+ serviceAccount: flink
Review comment:
Yes, great catch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink-kubernetes-operator] gyfora merged pull request #42: [FLINK-26308][FLINK-26471] Separate Flink job role from operator role
Posted by GitBox <gi...@apache.org>.
gyfora merged pull request #42:
URL: https://github.com/apache/flink-kubernetes-operator/pull/42
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org