Skip to content

Commit

Permalink
test agones setup
Browse files Browse the repository at this point in the history
  • Loading branch information
spiceratops committed Nov 10, 2024
1 parent 9b50010 commit 3352643
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 34 deletions.
4 changes: 2 additions & 2 deletions kubernetes/apps/gaming/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resources:
- ./namespace.yaml
- ./_pvc/ks.yaml
- ./romm/ks.yaml
# - ./agones/ks.yaml
# - ./shulker/ks.yaml
- ./agones/ks.yaml
- ./shulker/ks.yaml
- ./satisfactory/ks.yaml
# - ./ownfoil/ks.yaml
67 changes: 36 additions & 31 deletions kubernetes/apps/gaming/shulker/cluster/cobblemon.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
---
apiVersion: shulkermc.io/v1alpha1
kind: MinecraftServerFleet
kind: MinecraftServer
metadata:
name: minecraft-cobblemon
spec:
clusterRef:
name: minecraft-cluster
replicas: 1
template:
spec:
clusterRef:
name: minecraft-cluster
tags:
- minecraft-cobblemon
version:
channel: Paper
name: "1.20.1"
config:
serverProperties:
enforce-whitelist: "true"
max-players: "8"
gamemode: "survival"
difficulty: "easy"
podOverrides:
resources:
requests:
memory: 2000Mi
cpu: 100m
limits:
memory: 4000Mi
env:
- name: MOD_PLATFORM
value: MODRINTH
- name: MODRINTH_MODPACK
value: https://modrinth.com/modpack/cobblemon-fabric/version/1.5
- name: JVM_XX_OPTS
value: "-XX:MaxRAMPercentage=75"
tags:
- minecraft-cobblemon
version:
channel: Paper
name: "1.20.1"
config:
serverProperties:
enforce-whitelist: "true"
max-players: "8"
gamemode: "survival"
difficulty: "easy"
podOverrides:
volumeMounts:
- name: cobblemon
mountPath: /mnt/path
volumes:
- name: cobblemon
persistentVolumeClaim:
claimName: minecraft-cobblemon
resources:
requests:
memory: 2000Mi
cpu: 100m
limits:
memory: 4000Mi
env:
- name: MOD_PLATFORM
value: MODRINTH
- name: MODRINTH_MODPACK
value: https://modrinth.com/modpack/cobblemon-fabric/version/1.5.2
- name: JVM_XX_OPTS
value: "-XX:MaxRAMPercentage=75"
image:
imagePullSecrets: []
name: "itzg/minecraft-server:java17@sha256:c0fde979d35a726e17fdafafc6e4ef1b50aa711e576bc76c9de4f2e916577177"
1 change: 1 addition & 0 deletions kubernetes/apps/gaming/shulker/cluster/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: gaming
resources:
- ./volsync.yaml
- ./cluster.yaml
- ./proxy.yaml
- ./lobby.yaml
Expand Down
16 changes: 16 additions & 0 deletions kubernetes/apps/gaming/shulker/cluster/lobby.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ spec:
spec:
clusterRef:
name: minecraft-cluster
podOverrides:
volumeMounts:
- name: lobby
mountPath: /mnt/path
volumes:
- name: lobby
persistentVolumeClaim:
claimName: minecraft-lobby
env:
- name: DIFFICULTY
value: "easy"
- name: ENABLE_WHITELIST
value: "true"
image:
imagePullSecrets: []
name: "itzg/minecraft-server:java17@sha256:c0fde979d35a726e17fdafafc6e4ef1b50aa711e576bc76c9de4f2e916577177"
tags:
- minecraft-lobby
version:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/apps/gaming/shulker/cluster/proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ spec:
replicas: 1
service:
type: LoadBalancer
externalTrafficPolicy: Local
annotations:
io.cilium/lb-ipam-ips: "${MINECRAFT_LB_IP}"
coredns.io/hostname: minecraft.${PRIVATE_DOMAIN}
service.beta.kubernetes.io/scw-loadbalancer-proxy-protocol-v2: "true"
service.beta.kubernetes.io/scw-loadbalancer-use-hostname: "true"
reloader.stakater.com/auto: "true"
Expand Down
170 changes: 170 additions & 0 deletions kubernetes/apps/gaming/shulker/cluster/volsync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: minecraft-cobblemon-restic
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword-connect
target:
name: minecraft-cobblemon-restic-secret
creationPolicy: Owner
template:
engineVersion: v2
data:
RESTIC_REPOSITORY: "{{ .REPOSITORY_TEMPLATE }}/minecraft-cobblemon"
RESTIC_PASSWORD: "{{ .RESTIC_PASSWORD }}"
AWS_ACCESS_KEY_ID: "{{ .AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "{{ .AWS_SECRET_ACCESS_KEY }}"
dataFrom:
- extract:
key: volsync-restic-template
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: minecraft-cobblemon
spec:
accessModes: ["ReadWriteOnce"]
dataSourceRef:
kind: ReplicationDestination
apiGroup: volsync.backube
name: minecraft-cobblemon-rdst
resources:
requests:
storage: 5Gi
storageClassName: ${CLUSTER_STORAGE_BLOCK}
---
apiVersion: volsync.backube/v1alpha1
kind: ReplicationDestination
metadata:
name: minecraft-cobblemon-rdst
spec:
trigger:
manual: restore-once
restic:
repository: minecraft-cobblemon-restic-secret
copyMethod: Snapshot
accessModes: ["ReadWriteOnce"]
storageClassName: ${CLUSTER_STORAGE_BLOCK}
volumeSnapshotClassName: ${CLUSTER_SNAPSHOT_BLOCK}
cacheAccessModes: ["ReadWriteOnce"]
cacheCapacity: 8Gi
cacheStorageClassName: ${CLUSTER_STORAGE_HOSTPATH}
moverSecurityContext:
runAsUser: 568
runAsGroup: 568
fsGroup: 568
capacity: 5Gi # must match the PersistentVolumeClaim `.resources.requests.storage` size above
---
apiVersion: volsync.backube/v1alpha1
kind: ReplicationSource
metadata:
name: minecraft-cobblemon-rsrc
spec:
sourcePVC: minecraft-cobblemon
trigger:
schedule: "15 */8 * * *"
restic:
pruneIntervalDays: 10
repository: minecraft-cobblemon-restic-secret
copyMethod: Snapshot
accessModes: ["ReadWriteOnce"]
storageClassName: ${CLUSTER_STORAGE_BLOCK}
volumeSnapshotClassName: ${CLUSTER_SNAPSHOT_BLOCK}
cacheAccessModes: ["ReadWriteOnce"]
cacheCapacity: 8Gi
cacheStorageClassName: ${CLUSTER_STORAGE_HOSTPATH}
moverSecurityContext:
runAsUser: 568
runAsGroup: 568
fsGroup: 568
retain:
daily: 10
within: 3d
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: minecraft-lobby-restic
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword-connect
target:
name: minecraft-lobby-restic-secret
creationPolicy: Owner
template:
engineVersion: v2
data:
RESTIC_REPOSITORY: "{{ .REPOSITORY_TEMPLATE }}/minecraft-lobby"
RESTIC_PASSWORD: "{{ .RESTIC_PASSWORD }}"
AWS_ACCESS_KEY_ID: "{{ .AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "{{ .AWS_SECRET_ACCESS_KEY }}"
dataFrom:
- extract:
key: volsync-restic-template
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: minecraft-lobby
spec:
accessModes: ["ReadWriteOnce"]
dataSourceRef:
kind: ReplicationDestination
apiGroup: volsync.backube
name: minecraft-lobby-rdst
resources:
requests:
storage: 5Gi
storageClassName: ${CLUSTER_STORAGE_BLOCK}
---
apiVersion: volsync.backube/v1alpha1
kind: ReplicationDestination
metadata:
name: minecraft-lobby-rdst
spec:
trigger:
manual: restore-once
restic:
repository: minecraft-lobby-restic-secret
copyMethod: Snapshot
accessModes: ["ReadWriteOnce"]
storageClassName: ${CLUSTER_STORAGE_BLOCK}
volumeSnapshotClassName: ${CLUSTER_SNAPSHOT_BLOCK}
cacheAccessModes: ["ReadWriteOnce"]
cacheCapacity: 8Gi
cacheStorageClassName: ${CLUSTER_STORAGE_HOSTPATH}
moverSecurityContext:
runAsUser: 568
runAsGroup: 568
fsGroup: 568
capacity: 5Gi # must match the PersistentVolumeClaim `.resources.requests.storage` size above
---
apiVersion: volsync.backube/v1alpha1
kind: ReplicationSource
metadata:
name: minecraft-lobby-rsrc
spec:
sourcePVC: minecraft-lobby
trigger:
schedule: "15 */8 * * *"
restic:
pruneIntervalDays: 10
repository: minecraft-lobby-restic-secret
copyMethod: Snapshot
accessModes: ["ReadWriteOnce"]
storageClassName: ${CLUSTER_STORAGE_BLOCK}
volumeSnapshotClassName: ${CLUSTER_SNAPSHOT_BLOCK}
cacheAccessModes: ["ReadWriteOnce"]
cacheCapacity: 8Gi
cacheStorageClassName: ${CLUSTER_STORAGE_HOSTPATH}
moverSecurityContext:
runAsUser: 568
runAsGroup: 568
fsGroup: 568
retain:
daily: 10
within: 3d

0 comments on commit 3352643

Please sign in to comment.