2018-05-18 21:21:44 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: mc-vanilla
|
|
|
|
spec:
|
|
|
|
type: NodePort
|
|
|
|
ports:
|
|
|
|
- port: 25565
|
|
|
|
nodePort: 30000
|
|
|
|
selector:
|
|
|
|
app: mc-vanilla
|
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: mc-vanilla
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: mc-vanilla
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: mc-vanilla
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- image: itzg/minecraft-server
|
|
|
|
name: mc-vanilla
|
|
|
|
env:
|
|
|
|
# Use secret in real usage
|
|
|
|
- name: EULA
|
|
|
|
value: "true"
|
|
|
|
ports:
|
|
|
|
- containerPort: 25565
|
|
|
|
name: main
|
2019-08-02 18:21:47 +00:00
|
|
|
readinessProbe:
|
|
|
|
exec:
|
2022-07-09 22:30:08 +00:00
|
|
|
command: [ "/usr/local/bin/mc-monitor", "status", "--host", "localhost" ]
|
|
|
|
# Give it i + p * f seconds to be ready, so 120 seconds
|
|
|
|
initialDelaySeconds: 20
|
2019-08-02 18:21:47 +00:00
|
|
|
periodSeconds: 5
|
2022-07-09 22:30:08 +00:00
|
|
|
failureThreshold: 20
|
|
|
|
# Monitor ongoing liveness
|
2019-08-02 18:21:47 +00:00
|
|
|
livenessProbe:
|
|
|
|
exec:
|
2022-07-09 22:30:08 +00:00
|
|
|
command: ["/usr/local/bin/mc-monitor", "status", "--host", "localhost"]
|
|
|
|
initialDelaySeconds: 120
|
|
|
|
periodSeconds: 60
|
2018-05-18 21:21:44 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: mc-data
|
|
|
|
mountPath: /data
|
|
|
|
volumes:
|
|
|
|
- name: mc-data
|
|
|
|
emptyDir: {}
|