docker-minecraft-server/examples/k8s/vanilla-deployment.yml

57 lines
1.1 KiB
YAML

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
readinessProbe:
exec:
command:
- mcstatus
- localhost
- ping
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe:
exec:
command:
- mcstatus
- localhost
- ping
initialDelaySeconds: 5
periodSeconds: 5
volumeMounts:
- name: mc-data
mountPath: /data
volumes:
- name: mc-data
emptyDir: {}