forked from zhp8341/flink-streaming-platform-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1.3-taskmanager-session-deployment.yaml
98 lines (98 loc) · 2.77 KB
/
1.3-taskmanager-session-deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
apiVersion: apps/v1
kind: Deployment
metadata:
name: flink-taskmanager
namespace: bigdata-sync
spec:
replicas: 2
selector:
matchLabels:
app: flink-taskmanager
template:
metadata:
labels:
app: flink-taskmanager
spec:
initContainers:
- name: wait-jobmanager
image: busybox:latest
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- |
set -ex
until nc -zv flink-jobmanager 8081; do sleep 5; done
sleep 10
containers:
- name: taskmanager
image: flink:1.12.0-scala_2.11-java8
imagePullPolicy: IfNotPresent
args: ["taskmanager"]
# command:
# - sh
# - -c
# - "sleep 9999"
ports:
- containerPort: 6122
name: rpc
- containerPort: 6125
name: query-state
livenessProbe:
tcpSocket:
port: 6122
initialDelaySeconds: 30
periodSeconds: 60
volumeMounts:
- name: flink-config-volume
mountPath: /opt/flink/conf/
- mountPath: /opt/flink/lib
name: flink
subPath: lib
- name: logs-dir
mountPath: /opt/flink/log
# securityContext:
# runAsUser: 9999 # refers to user _flink_ from official flink image, change if necessary
- name: promtail
image: grafana/promtail:2.2.1
imagePullPolicy: IfNotPresent
args:
- -config.file=/etc/promtail/config.yaml
- -config.expand-env=true
env:
- name: TZ
value: Asia/Shanghai
- name: ENVIRONMENT_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: REPLICASET_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['app']
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
volumeMounts:
- mountPath: /mnt
name: logs-dir
- mountPath: /etc/promtail
name: promtail-config
volumes:
- name: flink-config-volume
configMap:
name: flink-config
items:
- key: flink-conf.yaml
path: flink-conf.yaml
- key: log4j-console.properties
path: log4j-console.properties
- name: flink
persistentVolumeClaim:
claimName: flink
- name: promtail-config
configMap:
name: loki-promtail
- name: logs-dir
emptyDir: {}