mirror of
https://github.com/JamesTurland/JimsGarage.git
synced 2024-12-04 05:40:30 +00:00
add minecraft
This commit is contained in:
parent
98fc682a86
commit
898b52b49d
4 changed files with 110 additions and 0 deletions
59
Minecraft/Kubernetes/deployment.yaml
Normal file
59
Minecraft/Kubernetes/deployment.yaml
Normal 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
|
24
Minecraft/Kubernetes/networkpolicy.yaml
Normal file
24
Minecraft/Kubernetes/networkpolicy.yaml
Normal 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"
|
22
Minecraft/docker-compose.yaml
Normal file
22
Minecraft/docker-compose.yaml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
version: '3.3'
|
||||||
|
services:
|
||||||
|
minecraft-server:
|
||||||
|
container_name: minecraft-server
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
ports:
|
||||||
|
- 25565:25565
|
||||||
|
environment:
|
||||||
|
- TYPE=FORGE
|
||||||
|
- EULA=TRUE
|
||||||
|
volumes:
|
||||||
|
- /home/ubuntu/docker/minecraft:/data
|
||||||
|
stdin_open: true
|
||||||
|
tty: true
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
macvlan4: # change name to whatever you like
|
||||||
|
ipv4_address: 192.168.4.20 # change to your IP in your vLAN subnet
|
||||||
|
|
||||||
|
networks:
|
||||||
|
macvlan4:
|
||||||
|
external: true
|
5
Minecraft/macvlan
Normal file
5
Minecraft/macvlan
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
docker network create -d macvlan \
|
||||||
|
--subnet=192.168.4.0/24 \
|
||||||
|
--gateway=192.168.4.1 \
|
||||||
|
-o parent=eth0.4 \
|
||||||
|
macvlan4
|
Loading…
Reference in a new issue