Skip to content

Instantly share code, notes, and snippets.

@grampelberg
Created July 26, 2017 21:25
Show Gist options
  • Save grampelberg/f23a330ee5bccb48ac4f02b695d8ab05 to your computer and use it in GitHub Desktop.
Save grampelberg/f23a330ee5bccb48ac4f02b695d8ab05 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: bk
labels:
component: bk
spec:
serviceName: bk
replicas: 1
template:
metadata:
labels:
component: bk
spec:
containers:
- name: bk
image: streamlio/pulsar:latest
resources:
requests:
cpu: 10m
command: ["sh", "-c"]
args:
- >
bin/apply-config-from-env.py conf/bookkeeper.conf;
bin/bookkeeper shell metaformat --nonInteractive || true;
bin/pulsar bookie
ports:
- containerPort: 3181
envFrom:
- configMapRef:
name: bk-config
# TODO: add a readinessProbe
livenessProbe:
exec:
command:
- /bin/bash
- -c
- >
/pulsar/bin/bookkeeper shell listbookies -rw \
| grep $(nslookup $HOSTNAME.bk \
| tail -n 2 \
| awk '{ print $2 }')
initialDelaySeconds: 5
timeoutSeconds: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment