commit ba947998b21064a09b21f6f564f1be95c4fde9be Author: Tanguy Herbron Date: Tue May 27 13:34:09 2025 +0200 feat: Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..f5b4340 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Minecraft + diff --git a/manifests/deployment.yaml b/manifests/deployment.yaml new file mode 100644 index 0000000..09c15b3 --- /dev/null +++ b/manifests/deployment.yaml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: minecraft + namespace: minecraft +spec: + replicas: 1 + selector: + matchLabels: + app: minecraft + template: + metadata: + labels: + app: minecraft + spec: + hostname: minecraft + subdomain: minecraft + containers: + - name: minecraft + image: itzg/minecraft-server + ports: + - containerPort: 8123 + - containerPort: 25565 + - containerPort: 25585 + name: metrics + env: + - name: MEMORY + value: 8G + - name: VERSION + value: "1.21.5" + - name: EULA + value: "true" + - name: TYPE + value: "FABRIC" + - name: MODRINTH_ALLOWED_VERSION_TYPE + value: "beta" + - name: MODRINTH_PROJECTS + value: "fabric-api,lithium,distanthorizons,fabricexporter,spark,chunky,chunky-player-pause" + - name: CURSEFORGE_FILES + value: "carpet:6347645,carpet-extra:6359324" + - name: CF_API_KEY + value: "" + - name: MODS + value: "https://git.halis.io/athens-school/Minecraft/raw/branch/master/mods/Dynmap-3.7-SNAPSHOT-fabric-1.21.5.jar" + volumeMounts: + - mountPath: "/data" + name: minecraft-data + resources: + + volumes: + - name: minecraft-data + persistentVolumeClaim: + claimName: minecraft-pvc diff --git a/manifests/ingress.yaml b/manifests/ingress.yaml new file mode 100644 index 0000000..206dfd8 --- /dev/null +++ b/manifests/ingress.yaml @@ -0,0 +1,26 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: minecraft-ingress + namespace: minecraft + annotations: + cert-manager.io/cluster-issuer: letsencrypt-production + kubernetes.io/ingress.class: nginx-external + acme.cert-manager.io/http01-edit-in-place: "true" +spec: + tls: + - hosts: + - mc.halis.io + secretName: mc-halis-io-tls + ingressClassName: nginx-external + rules: + - host: mc.halis.io + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: minecraft-svc + port: + number: 8123 diff --git a/manifests/kustomization.yaml b/manifests/kustomization.yaml new file mode 100644 index 0000000..92f5731 --- /dev/null +++ b/manifests/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - namespace.yaml + - service.yaml + - servicemonitor.yaml + - ingress.yaml + - internal-ingress.yaml + - pvc.yaml + - deployment.yaml diff --git a/manifests/namespace.yaml b/manifests/namespace.yaml new file mode 100644 index 0000000..4ad4f70 --- /dev/null +++ b/manifests/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: minecraft diff --git a/manifests/pvc.yaml b/manifests/pvc.yaml new file mode 100644 index 0000000..97f5222 --- /dev/null +++ b/manifests/pvc.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: minecraft-pvc + namespace: minecraft + labels: + recurring-job.longhorn.io/source: enabled + recurring-job-group.longhorn.io/standard-pvc: enabled +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 50Gi + storageClassName: redundant-storage-class diff --git a/manifests/service.yaml b/manifests/service.yaml new file mode 100644 index 0000000..7329f91 --- /dev/null +++ b/manifests/service.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Service +metadata: + name: minecraft-svc + namespace: minecraft + labels: + app.kubernetes.io/name: minecraft +spec: + ports: + - name: minecraft-tcp + port: 25565 + protocol: TCP + targetPort: 25565 + - name: minecraft-udp + port: 25565 + protocol: UDP + targetPort: 25565 + - name: metrics + port: 25585 + protocol: TCP + targetPort: 25585 + - name: dynmap + port: 8123 + protocol: TCP + targetPort: 8123 + selector: + app: minecraft diff --git a/manifests/servicemonitor.yaml b/manifests/servicemonitor.yaml new file mode 100644 index 0000000..50c9679 --- /dev/null +++ b/manifests/servicemonitor.yaml @@ -0,0 +1,14 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: minecraft + namespace: minecraft + labels: + team: core +spec: + selector: + matchLabels: + app.kubernetes.io/name: minecraft + endpoints: + - port: metrics + path: / diff --git a/mods/Dynmap-3.7-SNAPSHOT-fabric-1.21.5.jar b/mods/Dynmap-3.7-SNAPSHOT-fabric-1.21.5.jar new file mode 100755 index 0000000..92ec31e Binary files /dev/null and b/mods/Dynmap-3.7-SNAPSHOT-fabric-1.21.5.jar differ