-
Notifications
You must be signed in to change notification settings - Fork 20
/
40-statefulset.yml
66 lines (64 loc) · 1.97 KB
/
40-statefulset.yml
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
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: nifi
namespace: data
labels:
app: nifi
spec:
replicas: 2
revisionHistoryLimit: 1
selector:
matchLabels:
app: nifi
serviceName: nifi
template:
metadata:
labels:
app: nifi
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: "app"
operator: In
values:
- "nifi"
topologyKey: "kubernetes.io/hostname"
containers:
- name: nifi
imagePullPolicy: IfNotPresent
image: apache/nifi:1.9.2
command:
- bash
- -ce
- |
FQDN=$(hostname -f)
PROP_FILE=${NIFI_HOME}/conf/nifi.properties
p_repl () {
echo "setting ${1}=${2}"
sed -i -e "s|^$1=.*$|$1=$2|" ${PROP_FILE}
}
p_repl nifi.remote.input.host ${FQDN}
p_repl nifi.cluster.is.node true
p_repl nifi.cluster.node.protocol.port 6007
p_repl nifi.cluster.node.address ${FQDN}
p_repl nifi.cluster.protocol.is.secure false
p_repl nifi.security.user.authorizer managed-authorizer
p_repl nifi.web.http.host ${FQDN}
p_repl nifi.web.http.port 8080
p_repl nifi.zookeeper.connect.string ${NIFI_ZOOKEEPER_CONNECT_STRING}
p_repl nifi.cluster.flow.election.max.wait.time "1 mins"
tail -F "${NIFI_HOME}/logs/nifi-app.log" & exec bin/nifi.sh run
env:
- name: NIFI_ZOOKEEPER_CONNECT_STRING
value: "zookeeper-headless:2181"
ports:
- containerPort: 8080
name: http
protocol: TCP
- containerPort: 6007
name: cluster
protocol: TCP