-
Notifications
You must be signed in to change notification settings - Fork 8
/
bookie.yaml
118 lines (109 loc) · 3.58 KB
/
bookie.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
apiVersion: v1
kind: ConfigMap
metadata:
name: bookie-config
data:
PULSAR_MEM: "\" -Xms64m -Xmx256m -XX:MaxDirectMemorySize=256m\""
dbStorage_writeCacheMaxSizeMb: "32" # Write cache size (direct memory)
dbStorage_readAheadCacheMaxSizeMb: "32" # Read cache size (direct memory)
zkServers: zk-cs
statsProviderClass: org.apache.bookkeeper.stats.prometheus.PrometheusMetricsProvider
---
## BookKeeper servers need to access the local disks and the pods
## cannot be moved across different nodes.
## For this reason, we run BK as a daemon set, one for each node in the
## cluster, unless restricted by label selectors
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: bookie
labels:
app: pulsar
component: bookkeeper
spec:
template:
metadata:
labels:
app: pulsar
component: bookkeeper
# Specify cluster to allow aggregation by cluster in
# the metrics
cluster: local
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8000"
spec:
containers:
- name: bookie
image: apachepulsar/pulsar-all:latest
command: ["sh", "-c"]
args:
- >
bin/apply-config-from-env.py conf/bookkeeper.conf &&
bin/apply-config-from-env.py conf/pulsar_env.sh &&
bin/pulsar bookie
ports:
- containerPort: 3181
hostPort: 3181
name: client
- containerPort: 8000
hostPort: 8000
name: monitoring
envFrom:
- configMapRef:
name: bookie-config
env:
- name: advertisedAddress
valueFrom:
fieldRef:
fieldPath: status.hostIP
volumeMounts:
- name: journal-disk
mountPath: /pulsar/data/bookkeeper/journal
- name: ledgers-disk
mountPath: /pulsar/data/bookkeeper/ledgers
# bin/bookkeeper shell bookiesanity
initContainers:
# The first time, initialize BK metadata in zookeeper
# Otherwise ignore error if it's already there
- name: bookie-metaformat
image: apachepulsar/pulsar-all:latest
command: ["sh", "-c"]
args:
- >
bin/apply-config-from-env.py conf/bookkeeper.conf &&
bin/bookkeeper shell metaformat --nonInteractive || true;
envFrom:
- configMapRef:
name: bookie-config
volumes:
# Mount local disks
- name: journal-disk
hostPath:
path: /mnt/disks/ssd0
- name: ledgers-disk
hostPath:
path: /mnt/disks/ssd1
---
##
## Define the Bookie headless service
## In practice, in this case, it is only useful to have a view of
## all the bookie pods that are present
##
apiVersion: v1
kind: Service
metadata:
name: bookkeeper
labels:
app: pulsar
component: bookkeeper
spec:
ports:
- port: 3181
name: server
- port: 8000
name: monitoring
clusterIP: None
selector:
app: pulsar
component: bookkeeper