Skip to main content

Minecraft

Quelle joie pour moi de déployer un serveur minecraft dans K8S !

En prérequits à ce tuto :

Déploiement & service minecraft :

cat <<EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-world
  namespace: default
spec:
  replicas: 2
  selector:
    matchLabels:
      app: hello-world
  template:
    metadata:
      labels:
        app: hello-world
    spec:
      containers:
        - name: hello
          image: hashicorp/http-echo:latest
          args:
            - "-text=Hello from Cilium VIP 👋"
            - "-listen=:8080"
          ports:
            - containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: hello-world
  namespace: default
  labels:
    expose: "true"
  annotations:
    lbipam.cilium.io/ips: "192.168.1.2"   # IP fixe dans le pool
spec:
  type: LoadBalancer
  selector:
    app: hello-world
  ports:
    - port: 80
      targetPort: 8080
EOF