Skip to content

Commit 770b610

Browse files
committedOct 31, 2024·
add instruction to run jobs in other ns
1 parent bd92aec commit 770b610

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed
 

‎README.md

+7
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ If you choose to do this make sure you update the `data-generator.yaml` file for
6969
The steps to run each example are described in their own README.
7070
Make sure you have already [installed Apache Kafka, Apache Flink and Apicurio Registry](#installing-apache-kafka-apache-flink-and-apicurio-registry).
7171
72+
### Running an example in other namespace
73+
74+
By default, we assume all the jobs are running in `flink` namespace, but it is also possible to run jobs in other namespaces.
75+
Please see [here](flink-role/README.md) for more information.
76+
77+
### Viewing the Apicurio Registry UI
78+
7279
The source topics for the example will contain Avro records.
7380
You can view the Apicurio Registry UI by running `kubectl port-forward service/apicurio-registry-service 8080 -n flink` and visiting http://localhost:8080/ui in a browser.
7481

‎flink-role/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Run Flink jobs in other namespace
2+
3+
Flink operator by default will watch all namespaces in the kubernetes cluster, but to run Flink jobs in a namespace
4+
other than the operator namespace, users are responsible for creating a flink service account in that namespace.
5+
6+
```shell
7+
kubectl apply -f flink-role/flink-role.yaml -n NAMESPACE
8+
```
9+
10+
After creating the service account in the NAMESPACE, you can follow each example to deploy FlinkDeployment CR to
11+
the NAMESPACE to run the jobs. For example:
12+
```shell
13+
kubectl apply -f recommendation-app/flink-deployment.yaml -n NAMESPACE
14+
```

‎flink-role/flink-role.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
labels:
5+
app.kubernetes.io/name: flink-kubernetes-operator
6+
app.kubernetes.io/version: 1.10.0
7+
name: flink
8+
---
9+
apiVersion: rbac.authorization.k8s.io/v1
10+
kind: Role
11+
metadata:
12+
labels:
13+
app.kubernetes.io/name: flink-kubernetes-operator
14+
app.kubernetes.io/version: 1.10.0
15+
name: flink
16+
rules:
17+
- apiGroups:
18+
- ""
19+
resources:
20+
- pods
21+
- configmaps
22+
verbs:
23+
- '*'
24+
- apiGroups:
25+
- apps
26+
resources:
27+
- deployments
28+
verbs:
29+
- '*'
30+
---
31+
apiVersion: rbac.authorization.k8s.io/v1
32+
kind: RoleBinding
33+
metadata:
34+
labels:
35+
app.kubernetes.io/name: flink-kubernetes-operator
36+
app.kubernetes.io/version: 1.10.0
37+
name: flink-role-binding
38+
roleRef:
39+
apiGroup: rbac.authorization.k8s.io
40+
kind: Role
41+
name: flink
42+
subjects:
43+
- kind: ServiceAccount
44+
name: flink

0 commit comments

Comments
 (0)
Please sign in to comment.