Added Undocumented Minecraft example.

This commit is contained in:
savagebidoof 2023-07-01 16:05:10 +02:00
parent 78f09bdc08
commit f5b24a9a17
7 changed files with 135 additions and 0 deletions

View File

@ -0,0 +1,24 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: minecraft-config
namespace: default
labels:
app: minecraft
data:
EULA: "TRUE"
MEMORY: 1G
TYPE: "FOLIA"
FORCE_REDOWNLOAD: "FALSE"
VERSION: "1.19.4"
MOTD: "My minecraft world!"
ONLINE_MODE: "FALSE"
ENABLE_QUERY: "TRUE"
ENABLE_RCON: "FALSE"
ALLOW_NETHER: "FALSE"
GENERATE_STRUCTURES: "FALSE"
SNOOPER_ENABLED: "FALSE"
SPAWN_ANIMALS: "FALSE"
SPAWN_MONSTERS: "FALSE"
SPAWN_NPCS: "FALSE"
ENABLE_AUTOPAUSE: "TRUE"

View File

@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: minecraft-1
namespace: default
labels:
app: minecraft
spec:
replicas: 1
selector:
matchLabels:
app: minecraft
template:
metadata:
labels:
app: minecraft
spec:
containers:
- name: minecraft
image: itzg/minecraft-server
resources:
requests:
cpu: "100m"
imagePullPolicy: IfNotPresent #Always
ports:
- containerPort: 25565
envFrom:
- configMapRef:
name: minecraft-config
env:
- name: MOTD
value: "World 1 Server"

View File

@ -0,0 +1,15 @@
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: minecraft-gateway
namespace: default
spec:
selector:
istio: games
servers:
- port:
number: 25565
name: tcp-1
protocol: TCP
hosts:
- "*"

View File

@ -0,0 +1,27 @@
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
name: ingress
spec:
profile: empty # Do not install CRDs or the control plane
components:
ingressGateways:
- name: ingress-games-gateway
namespace: istio-system
enabled: true
label:
# Set a unique label for the gateway. This is required to ensure Gateways
# can select this workload
istio: games
k8s:
service:
ports:
- port: 25565
targetPort: 25565
name: minecraft-port
protocol: TCP
values:
gateways:
istio-ingressgateway:
# Enable gateway injection
injectionTemplate: gateway

View File

@ -0,0 +1 @@
https://github.com/itzg/docker-minecraft-server/#server-configuration

View File

@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: minecraft
namespace: default
labels:
app: minecraft
world: "1"
spec:
ports:
- port: 25565
name: tcp-minecraft
protocol: TCP
# nodePort: 30000
selector:
app: minecraft
world: "1"
# type: NodePort

View File

@ -0,0 +1,18 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: minecraft-1
namespace: default
spec:
hosts:
- "*"
gateways:
- minecraft-gateway
tcp:
- match:
- port: 25565
route:
- destination:
host: minecraft.default.svc.cluster.local
port:
number: 25565