Skip to content

Instantly share code, notes, and snippets.

@vagmi
Created June 29, 2018 12:31
Show Gist options
  • Save vagmi/0b276fbc291ce5fa5b49270424386d77 to your computer and use it in GitHub Desktop.
Save vagmi/0b276fbc291ce5fa5b49270424386d77 to your computer and use it in GitHub Desktop.
A stateful set to deploy oklog
---
apiVersion: v1
kind: Service
metadata:
labels:
app: oklog
name: oklog
spec:
ports:
- name: api-default
port: 7650
targetPort: 7650
protocol: TCP
- name: ingest-fast
port: 7651
targetPort: 7651
- name: ingest-durable
port: 7652
targetPort: 7652
- name: ingest-bulk
port: 7653
targetPort: 7653
- name: cluster
port: 7659
targetPort: 7659
clusterIP: None
selector:
app: oklog
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: oklog-1
spec:
accessModes:
- ReadWriteOnce
storageClassName: standard
capacity:
storage: 1.5Gi
hostPath:
path: /data/pv001
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: oklog-2
spec:
accessModes:
- ReadWriteOnce
storageClassName: standard
capacity:
storage: 1.5Gi
hostPath:
path: /data/pv002
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: oklog-3
spec:
accessModes:
- ReadWriteOnce
storageClassName: standard
capacity:
storage: 1.5Gi
hostPath:
path: /data/pv003
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: oklog
labels:
app: oklog
spec:
replicas: 3
serviceName: oklog
selector:
matchLabels:
app: oklog
template:
metadata:
name: oklog
labels:
app: oklog
spec:
containers:
- name: oklog
image: oklog/oklog:v0.3.2
imagePullPolicy: Always
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- name: api
containerPort: 7650
- name: ingest-fast
containerPort: 7651
- name: ingest-durable
containerPort: 7652
- name: ingest-bulk
containerPort: 7653
- name: cluster
containerPort: 7659
args:
- ingeststore
- --debug
- --api=tcp://0.0.0.0:7650
- --ingest.fast=tcp://0.0.0.0:7651
- --ingest.durable=tcp://0.0.0.0:7652
- --ingest.bulk=tcp://0.0.0.0:7653
- --cluster=tcp://$(POD_IP):7659
- --peer=oklog-0.oklog
- --peer=oklog-1.oklog
- --peer=oklog-2.oklog
volumeMounts:
- name: oklog
mountPath: /data
volumeClaimTemplates:
- metadata:
name: oklog
spec:
accessModes:
- ReadWriteOnce
storageClassName: standard
resources:
requests:
storage: 1Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment