mirror of https://github.com/k3s-io/k3s
108 lines
3.0 KiB
YAML
108 lines
3.0 KiB
YAML
apiVersion: apps/v1alpha1
|
|
kind: PetSet
|
|
metadata:
|
|
name: zoo
|
|
spec:
|
|
serviceName: "zk"
|
|
replicas: 3
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: zk
|
|
annotations:
|
|
pod.alpha.kubernetes.io/initialized: "true"
|
|
pod.alpha.kubernetes.io/init-containers: '[
|
|
{
|
|
"name": "install",
|
|
"image": "gcr.io/google_containers/zookeeper-install-3.5.0-alpha:e2e",
|
|
"imagePullPolicy": "Always",
|
|
"args": ["--install-into=/opt", "--work-dir=/work-dir"],
|
|
"volumeMounts": [
|
|
{
|
|
"name": "opt",
|
|
"mountPath": "/opt/"
|
|
},
|
|
{
|
|
"name": "workdir",
|
|
"mountPath": "/work-dir"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "bootstrap",
|
|
"image": "java:openjdk-8-jre",
|
|
"command": ["/work-dir/peer-finder"],
|
|
"args": ["-on-start=\"/work-dir/on-start.sh\"", "-service=zk"],
|
|
"env": [
|
|
{
|
|
"name": "POD_NAMESPACE",
|
|
"valueFrom": {
|
|
"fieldRef": {
|
|
"apiVersion": "v1",
|
|
"fieldPath": "metadata.namespace"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"volumeMounts": [
|
|
{
|
|
"name": "opt",
|
|
"mountPath": "/opt"
|
|
},
|
|
{
|
|
"name": "workdir",
|
|
"mountPath": "/work-dir"
|
|
},
|
|
{
|
|
"name": "datadir",
|
|
"mountPath": "/tmp/zookeeper"
|
|
}
|
|
]
|
|
}
|
|
]'
|
|
spec:
|
|
terminationGracePeriodSeconds: 0
|
|
containers:
|
|
- name: zk
|
|
image: java:openjdk-8-jre
|
|
ports:
|
|
- containerPort: 2888
|
|
name: peer
|
|
- containerPort: 3888
|
|
name: leader-election
|
|
command:
|
|
- /opt/zookeeper/bin/zkServer.sh
|
|
args:
|
|
- start-foreground
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- "/opt/zookeeper/bin/zkCli.sh ls /"
|
|
initialDelaySeconds: 15
|
|
timeoutSeconds: 5
|
|
volumeMounts:
|
|
- name: datadir
|
|
mountPath: /tmp/zookeeper
|
|
- name: opt
|
|
mountPath: /opt
|
|
# Mount the work-dir just for debugging
|
|
- name: workdir
|
|
mountPath: /work-dir
|
|
volumes:
|
|
- name: opt
|
|
emptyDir: {}
|
|
- name: workdir
|
|
emptyDir: {}
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: datadir
|
|
annotations:
|
|
volume.alpha.kubernetes.io/storage-class: anything
|
|
spec:
|
|
accessModes: [ "ReadWriteOnce" ]
|
|
resources:
|
|
requests:
|
|
storage: 1Gi
|