58 lines
1.8 KiB
YAML
58 lines
1.8 KiB
YAML
---
|
|
- name: Minecraft Deployment
|
|
hosts: alpha-control-plane
|
|
become: true
|
|
tasks:
|
|
|
|
- name: Create a Deployment
|
|
kubernetes.core.k8s:
|
|
definition:
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: minecraft-deployment
|
|
namespace: default
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: minecraft
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: minecraft
|
|
spec:
|
|
containers:
|
|
- name: minecraft-container
|
|
image: itzg/minecraft-server
|
|
ports:
|
|
- containerPort: 24454
|
|
- containerPort: 25565
|
|
env:
|
|
- name: EULA
|
|
value: "TRUE"
|
|
- name: TYPE
|
|
value: FABRIC
|
|
- name: MODS
|
|
value: "https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/fabric,https://cdn.modrinth.com/data/bWrNNfkb/versions/D4KXqjtC/Floodgate-Fabric-2.2.3-SNAPSHOT%2Bbuild.28.jar,https://cdn.modrinth.com/data/9eGKb6K1/versions/COYWChTc/voicechat-fabric-1.21-2.5.18.jar"
|
|
|
|
- name: Expose Deployment as a Service
|
|
kubernetes.core.k8s:
|
|
definition:
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: minecraft-service
|
|
namespace: default
|
|
spec:
|
|
selector:
|
|
app: myapp
|
|
ports:
|
|
- port: 24454
|
|
protocol: UDP
|
|
name: minecraft-port-24454
|
|
- port: 25565
|
|
protocol: TCP
|
|
name: minecraft-port-25565
|
|
type: NodePort
|