feat(homelab): deploy home-assistant, configure minecraft

This commit is contained in:
2025-12-26 20:53:48 -08:00
parent cab93a0968
commit 4771603175
9 changed files with 138 additions and 13 deletions

View File

@@ -9,6 +9,8 @@ repositories:
url: https://dl.gitea.com/charts url: https://dl.gitea.com/charts
- name: longhorn - name: longhorn
url: https://charts.longhorn.io url: https://charts.longhorn.io
- name: home-assistant
url: https://pajikos.github.io/home-assistant-helm-chart
releases: releases:
# Load Balancer # Load Balancer
@@ -54,9 +56,23 @@ releases:
defaultClassReplicaCount: 1 defaultClassReplicaCount: 1
# Minecraft # Minecraft
- name: minecraft-main # - name: minecraft-router
namespace: minecraft # namespace: minecraft
chart: minecraft-charts/minecraft # chart: minecraft-charts/mc-router
version: 5.0.0 # version: 1.4.0
# values:
# - values/minecraft/router.yaml
#
# - name: minecraft-main
# namespace: minecraft
# chart: minecraft-charts/minecraft
# version: 5.0.0
# values:
# - values/minecraft/main.yaml
- name: home-assistant
namespace: home
chart: home-assistant/home-assistant
version: 0.3.36
values: values:
- values/minecraft/main.yaml - values/home-assistant.yaml

View File

@@ -0,0 +1,17 @@
persistence:
enabled: true
resources:
requests:
cpu: 1
memory: 1Gi
limits:
cpu: 2
memory: 2Gi
configuration:
enabled: true
ingress:
enabled: false
external: true

View File

@@ -1,5 +1,5 @@
persistence: persistence:
config: config:
size: 4Gi size: 5Gi
media: media:
size: 2Gi size: 2Gi

View File

@@ -1,6 +1,9 @@
resources: resources:
requests:
cpu: 1
memory: 500Mi
limits: limits:
memory: 1Gi memory: 6Gi
cpu: 2500m cpu: 2500m
minecraftServer: minecraftServer:
@@ -9,9 +12,67 @@ minecraftServer:
version: "1.21.11" version: "1.21.11"
difficulty: hard difficulty: hard
motd: "A Minecraft Server." motd: "A Minecraft Server."
memory: 512M memory: 6G
persistence: persistence:
dataDir: dataDir:
enabled: true enabled: true
size: 2Gi Size: 4Gi
# extraVolumes:
# - volumeMounts:
# - name: backup-volume
# mountPath: /backup
# readOnly: true
# volumes:
# - name: backup-volume
# hostPath:
# path: /var/lib/minecraft
# type: DirectoryOrCreate
# initContainers:
# - name: world-restore
# image: busybox:latest
# command:
# - sh
# - -c
# - |
# set -e
#
# echo "=== Minecraft World Restore ==="
#
# BACKUP_FILE="/backup/main/latest.tar.gz"
#
# # Check if backup exists
# if [ ! -f "$BACKUP_FILE" ]; then
# echo "No backup found at $BACKUP_FILE"
# echo "Skipping restore, server will start with existing/new world"
# exit 0
# fi
#
# echo "✓ Backup found: $BACKUP_FILE"
# echo " Size: $(du -h $BACKUP_FILE | cut -f1)"
#
# # Check if world already exists
# if [ -f /data/world/level.dat ]; then
# echo "⚠ World already exists at /data/world/"
# echo " Replacing with backup..."
# rm -rf /data/world /data/world_nether /data/world_the_end
# fi
#
# # Extract backup
# echo "Extracting backup to /data/..."
# tar -xzf "$BACKUP_FILE" -C /data/
# echo "✓ Extraction complete"
#
# echo ""
# echo "=== Restore Complete ==="
# echo "Restored world size: $(du -sh /data/world 2>/dev/null | cut -f1 || echo 'unknown')"
# ls -lh /data/ | grep -E "^d" || true
# echo ""
# volumeMounts:
# - name: datadir
# mountPath: /data
# - name: backup-volume
# mountPath: /backup
# readOnly: true

View File

@@ -0,0 +1,13 @@
resources:
requests:
cpu: 100m
memory: 50Mi
limits:
cpu: 500m
memory: 128Mi
minecraftRouter:
mappings:
- externalHostname: "mc-rocket.duckdns.org"
host: "minecraft-main"
port: 25565

View File

@@ -6,7 +6,8 @@ resources:
- ./traefik/config.yaml - ./traefik/config.yaml
- ./cert-manager/config.yaml - ./cert-manager/config.yaml
- ./routes/media.yaml - ./routes/media.yaml
- ./routes/minecraft/main.yaml # - ./routes/minecraft.yaml
- ./routes/gitea/ssh.yaml - ./routes/gitea/ssh.yaml
- ./routes/gitea/http.yaml - ./routes/gitea/http.yaml
- ./routes/longhorn.yaml - ./routes/longhorn.yaml
- ./routes/home-assistant.yaml

View File

@@ -0,0 +1,15 @@
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: home-assistant
namespace: home
spec:
parentRefs:
- name: traefik-gateway
namespace: kube-system
hostnames:
- "home-assistant.lucalise.ca"
rules:
- backendRefs:
- name: home-assistant
port: 8080

View File

@@ -1,13 +1,13 @@
apiVersion: traefik.io/v1alpha1 apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP kind: IngressRouteTCP
metadata: metadata:
name: minecraft-main name: minecraft-router
namespace: minecraft namespace: minecraft
spec: spec:
entryPoints: entryPoints:
- minecraft-main - minecraft
routes: routes:
- match: HostSNI(`*`) - match: HostSNI(`*`)
services: services:
- name: minecraft-main - name: minecraft-router-mc-router
port: 25565 port: 25565

View File

@@ -22,6 +22,8 @@
192.168.18.31 media.lucalise.ca 192.168.18.31 media.lucalise.ca
192.168.18.31 git-new.lucalise.ca 192.168.18.31 git-new.lucalise.ca
192.168.18.31 storage.lucalise.ca 192.168.18.31 storage.lucalise.ca
192.168.18.31 home-assistant.lucalise.ca
192.168.18.31 mc-rocket.duckdns.org
''; '';
services.resolved = { services.resolved = {