FEAT(crafty): add crafty minecraft server manager
- Crafty Controller 4 for managing Minecraft servers - Ingress at crafty0213.kro.kr - Longhorn PVCs for persistent storage - LoadBalancer service for Minecraft ports 25565-25569
This commit is contained in:
31
crafty/argocd.yaml
Normal file
31
crafty/argocd.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: crafty
|
||||
namespace: argocd
|
||||
finalizers:
|
||||
- resources-finalizer.argocd.argoproj.io
|
||||
spec:
|
||||
project: default
|
||||
sources:
|
||||
- repoURL: https://github.com/Mayne0213/applications.git
|
||||
targetRevision: main
|
||||
path: crafty
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: crafty
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
retry:
|
||||
limit: 5
|
||||
backoff:
|
||||
duration: 5s
|
||||
factor: 2
|
||||
maxDuration: 3m
|
||||
managedNamespaceMetadata:
|
||||
labels:
|
||||
goldilocks.fairwinds.com/enabled: 'true'
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
70
crafty/deployment.yaml
Normal file
70
crafty/deployment.yaml
Normal file
@@ -0,0 +1,70 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: crafty
|
||||
namespace: crafty
|
||||
labels:
|
||||
app: crafty
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: crafty
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: crafty
|
||||
spec:
|
||||
containers:
|
||||
- name: crafty
|
||||
image: registry.gitlab.com/crafty-controller/crafty-4:latest
|
||||
env:
|
||||
- name: TZ
|
||||
value: Asia/Seoul
|
||||
ports:
|
||||
- name: https
|
||||
containerPort: 8443
|
||||
protocol: TCP
|
||||
- name: dynmap
|
||||
containerPort: 8123
|
||||
protocol: TCP
|
||||
- name: bedrock
|
||||
containerPort: 19132
|
||||
protocol: UDP
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "2Gi"
|
||||
volumeMounts:
|
||||
- name: backups
|
||||
mountPath: /crafty/backups
|
||||
- name: logs
|
||||
mountPath: /crafty/logs
|
||||
- name: servers
|
||||
mountPath: /crafty/servers
|
||||
- name: config
|
||||
mountPath: /crafty/app/config
|
||||
- name: import
|
||||
mountPath: /crafty/import
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
volumes:
|
||||
- name: backups
|
||||
persistentVolumeClaim:
|
||||
claimName: crafty-backups
|
||||
- name: logs
|
||||
persistentVolumeClaim:
|
||||
claimName: crafty-logs
|
||||
- name: servers
|
||||
persistentVolumeClaim:
|
||||
claimName: crafty-servers
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: crafty-config
|
||||
- name: import
|
||||
persistentVolumeClaim:
|
||||
claimName: crafty-import
|
||||
25
crafty/ingress.yaml
Normal file
25
crafty/ingress.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: crafty-ingress
|
||||
namespace: crafty
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
tls:
|
||||
- hosts:
|
||||
- crafty0213.kro.kr
|
||||
secretName: crafty-tls
|
||||
rules:
|
||||
- host: crafty0213.kro.kr
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: crafty
|
||||
port:
|
||||
number: 8443
|
||||
8
crafty/kustomization.yaml
Normal file
8
crafty/kustomization.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- pvc.yaml
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
- ingress.yaml
|
||||
64
crafty/pvc.yaml
Normal file
64
crafty/pvc.yaml
Normal file
@@ -0,0 +1,64 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: crafty-backups
|
||||
namespace: crafty
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: crafty-logs
|
||||
namespace: crafty
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: crafty-servers
|
||||
namespace: crafty
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: crafty-config
|
||||
namespace: crafty
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: crafty-import
|
||||
namespace: crafty
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: longhorn
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
57
crafty/service.yaml
Normal file
57
crafty/service.yaml
Normal file
@@ -0,0 +1,57 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: crafty
|
||||
namespace: crafty
|
||||
labels:
|
||||
app: crafty
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: crafty
|
||||
ports:
|
||||
- name: https
|
||||
port: 8443
|
||||
targetPort: 8443
|
||||
protocol: TCP
|
||||
- name: dynmap
|
||||
port: 8123
|
||||
targetPort: 8123
|
||||
protocol: TCP
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: crafty-minecraft
|
||||
namespace: crafty
|
||||
labels:
|
||||
app: crafty
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
selector:
|
||||
app: crafty
|
||||
ports:
|
||||
- name: bedrock
|
||||
port: 19132
|
||||
targetPort: 19132
|
||||
protocol: UDP
|
||||
- name: minecraft-1
|
||||
port: 25565
|
||||
targetPort: 25565
|
||||
protocol: TCP
|
||||
- name: minecraft-2
|
||||
port: 25566
|
||||
targetPort: 25566
|
||||
protocol: TCP
|
||||
- name: minecraft-3
|
||||
port: 25567
|
||||
targetPort: 25567
|
||||
protocol: TCP
|
||||
- name: minecraft-4
|
||||
port: 25568
|
||||
targetPort: 25568
|
||||
protocol: TCP
|
||||
- name: minecraft-5
|
||||
port: 25569
|
||||
targetPort: 25569
|
||||
protocol: TCP
|
||||
Reference in New Issue
Block a user