add minecraft

This commit is contained in:
James Turland
2023-11-23 15:50:51 +00:00
parent 98fc682a86
commit 898b52b49d
4 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: minecraft
app.kubernetes.io/instance: minecraft
name: minecraft
namespace: minecraft
spec:
replicas: 1
selector:
matchLabels:
app: minecraft
template:
metadata:
labels:
app: minecraft
spec:
nodeSelector:
worker: "true"
containers:
- env:
- name: EULA
value: "TRUE"
image: itzg/minecraft-server
name: minecraft-server
ports:
- containerPort: 25565
resources: {}
stdin: true
tty: true
volumeMounts:
- mountPath: /data
name: minecraft
restartPolicy: Always
volumes:
- name: minecraft
persistentVolumeClaim:
claimName: minecraft
---
apiVersion: v1
kind: Service
metadata:
labels:
app: minecraft
name: minecraft
namespace: minecraft
spec:
ports:
- name: minecraft-tcp
port: 25565
protocol: TCP
targetPort: 25565
selector:
app: minecraft
externalTrafficPolicy: Local
loadBalancerIP: 192.168.200.19
type: LoadBalancer

View File

@@ -0,0 +1,24 @@
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: allow-internet-only
namespace: minecraft
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
- ipBlock:
cidr: "0.0.0.0/0"
except:
- "10.0.0.0/8"
- "172.16.0.0/12"
- "192.168.0.0/16"
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: "kube-system"
- podSelector:
matchLabels:
k8s-app: "kube-dns"