Skip to content

Instantly share code, notes, and snippets.

@ll911
Last active February 22, 2019 22:43
Show Gist options
  • Save ll911/1cf00217dae59d746c5f517df8d8d272 to your computer and use it in GitHub Desktop.
Save ll911/1cf00217dae59d746c5f517df8d8d272 to your computer and use it in GitHub Desktop.
scylla-statefulset.yaml
apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
name: scylla
labels:
app: scylla
spec:
serviceName: scylla
replicas: 3
selector:
matchLabels:
app: scylla
template:
metadata:
labels:
app: scylla
spec:
containers:
- name: scylla
image: scylladb/scylla:3.0.3
imagePullPolicy: IfNotPresent
args: ["--seeds", "scylla-0.scylla.default.svc.cluster.local"]
ports:
- containerPort: 7000
name: intra-node
- containerPort: 7001
name: tls-intra-node
- containerPort: 7199
name: jmx
- containerPort: 9042
name: cql
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 500m
memory: 1Gi
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "PID=$(pidof scylla) && kill $PID && while ps -p $PID > /dev/null; do sleep 1; done"]
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
readinessProbe:
exec:
command:
- /bin/bash
- -c
- exec
- /opt/ready-probe.sh
initialDelaySeconds: 15
timeoutSeconds: 5
volumeMounts:
- name: scylla-data
mountPath: /var/lib/scylla
- name: scylla-ready-probe
mountPath: /opt/ready-probe.sh
subPath: ready-probe.sh
volumes:
- name: scylla-ready-probe
configMap:
name: scylla
volumeClaimTemplates:
- metadata:
name: scylla-data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment