From 30ada6e0f2e4af149eeb4263d65a3a020fb190b7 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Sat, 7 Jun 2025 13:21:56 +1000 Subject: [PATCH] Pterodactyl++ --- .../Pterodactyl/_namespace-pterodactyl.yml | 4 + .../Pterodactyl/application-pterodactyl.yaml | 17 ++++ .../Pterodactyl/deployment-pterodactyl.yaml | 86 +++++++++++++++++++ .../Pterodactyl/ingressroute-pterodactyl.yaml | 17 ++++ ...entvolume-flexvolsmb-pterodactyl-data.yaml | 19 ++++ ...stentvolume-flexvolsmb-pterodactyl-db.yaml | 19 ++++ ...entvolume-flexvolsmb-pterodactyl-logs.yaml | 19 ++++ ...ntvolume-flexvolsmb-pterodactyl-proxy.yaml | 19 ++++ ...lumeclaim-flexvolsmb-pterodactyl-data.yaml | 12 +++ ...volumeclaim-flexvolsmb-pterodactyl-db.yaml | 12 +++ ...lumeclaim-flexvolsmb-pterodactyl-logs.yaml | 12 +++ ...umeclaim-flexvolsmb-pterodactyl-proxy.yaml | 12 +++ .../sealedsecret-flexvolsmb-credentials.yaml | 16 ++++ .../sealedsecret-pterodactyl-db-secret.yaml | 19 ++++ services/Pterodactyl/service-pterodactyl.yaml | 18 ++++ 15 files changed, 301 insertions(+) create mode 100644 services/Pterodactyl/_namespace-pterodactyl.yml create mode 100644 services/Pterodactyl/application-pterodactyl.yaml create mode 100644 services/Pterodactyl/deployment-pterodactyl.yaml create mode 100644 services/Pterodactyl/ingressroute-pterodactyl.yaml create mode 100644 services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-data.yaml create mode 100644 services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-db.yaml create mode 100644 services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-logs.yaml create mode 100644 services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-proxy.yaml create mode 100644 services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-data.yaml create mode 100644 services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-db.yaml create mode 100644 services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-logs.yaml create mode 100644 services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-proxy.yaml create mode 100644 services/Pterodactyl/sealedsecret-flexvolsmb-credentials.yaml create mode 100644 services/Pterodactyl/sealedsecret-pterodactyl-db-secret.yaml create mode 100644 services/Pterodactyl/service-pterodactyl.yaml diff --git a/services/Pterodactyl/_namespace-pterodactyl.yml b/services/Pterodactyl/_namespace-pterodactyl.yml new file mode 100644 index 0000000..00f4662 --- /dev/null +++ b/services/Pterodactyl/_namespace-pterodactyl.yml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: pterodactyl diff --git a/services/Pterodactyl/application-pterodactyl.yaml b/services/Pterodactyl/application-pterodactyl.yaml new file mode 100644 index 0000000..0d18ee4 --- /dev/null +++ b/services/Pterodactyl/application-pterodactyl.yaml @@ -0,0 +1,17 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: pterodactyl + namespace: argo-cd +spec: + destination: + namespace: pterodactyl + server: https://kubernetes.default.svc + project: default + source: + path: services/Pterodactyl + repoURL: https://code.spamasaurus.com/djpbessems/Kubernetes.K3s.installLog.git + targetRevision: HEAD + syncPolicy: + automated: + selfHeal: true diff --git a/services/Pterodactyl/deployment-pterodactyl.yaml b/services/Pterodactyl/deployment-pterodactyl.yaml new file mode 100644 index 0000000..039f833 --- /dev/null +++ b/services/Pterodactyl/deployment-pterodactyl.yaml @@ -0,0 +1,86 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pterodactyl + namespace: pterodactyl + labels: + app: pterodactyl +spec: + replicas: 1 + selector: + matchLabels: + app: pterodactyl + template: + metadata: + labels: + app: pterodactyl + spec: + containers: + - name: app + image: ghcr.io/pterodactyl/panel:latest + imagePullPolicy: Always + env: + - name: APP_URL + value: https://games.spamasaurus.com + - name: DB_HOST + value: pterodactyl.pterodactyl.svc.cluster.local + - name: DB_PORT + value: '3306' + - name: REDIS_HOST + value: pterodactyl.pterodactyl.svc.cluster.local + envFrom: + - secretRef: + name: pterodactyl-db-secret + ports: + - name: web + containerPort: 80 + volumeMounts: + - mountPath: /app/var + name: flexvolsmb-pterodactyl-data + - mountPath: /etc/nginx/http.d/ + name: flexvolsmb-pterodactyl-proxy + - mountPath: /app/storage/logs + name: flexvolsmb-pterodactyl-logs + - name: db + image: mariadb:10.5 + args: + - --default-authentication-plugin=mysql_native_password + env: + - name: MYSQL_DATABASE + value: panel + - name: MYSQL_USER + value: pterodactyl + envFrom: + - secretRef: + name: pterodactyl-db-secret + volumeMounts: + - name: flexvolsmb-pterodactyl-db + mountPath: var/lib/mysql + ports: + - name: db + containerPort: 3306 + # livenessProbe: + # exec: + # command: ["pg_isready" ,"-U" ,"$POSTGRES_USER", "-d" ,"$POSTGRES_DATABASE"] + - name: redis + image: redis:alpine + ports: + - name: redis + containerPort: 6379 + # volumeMounts: + # - name: flexvolsmb-pterodactyl-redis + # mountPath: /data + + volumes: + - name: flexvolsmb-pterodactyl-data + persistentVolumeClaim: + claimName: flexvolsmb-pterodactyl-data + - name: flexvolsmb-pterodactyl-proxy + persistentVolumeClaim: + claimName: flexvolsmb-pterodactyl-proxy + - name: flexvolsmb-pterodactyl-db + persistentVolumeClaim: + claimName: flexvolsmb-pterodactyl-db + - name: flexvolsmb-pterodactyl-logs + persistentVolumeClaim: + claimName: flexvolsmb-pterodactyl-logs diff --git a/services/Pterodactyl/ingressroute-pterodactyl.yaml b/services/Pterodactyl/ingressroute-pterodactyl.yaml new file mode 100644 index 0000000..485268b --- /dev/null +++ b/services/Pterodactyl/ingressroute-pterodactyl.yaml @@ -0,0 +1,17 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: pterodactyl + namespace: pterodactyl +spec: + entryPoints: + - websecure + routes: + - match: Host(`games.spamasaurus.com`) + kind: Rule + services: + - name: pterodactyl + port: 80 + middlewares: + - name: security-headers@file + # - name: compression@file diff --git a/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-data.yaml b/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-data.yaml new file mode 100644 index 0000000..5b60c19 --- /dev/null +++ b/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-data.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: flexvolsmb-pterodactyl-data + namespace: pterodactyl +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-pterodactyl-data + flexVolume: + driver: mount/smb + secretRef: + name: flexvolsmb-credentials + options: + opts: file_mode=0600,dir_mode=0700,uid=100,gid=101,iocharset=utf8,nobrl + server: 192.168.154.195 + share: /K3s.Volumes/pterodactyl/data diff --git a/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-db.yaml b/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-db.yaml new file mode 100644 index 0000000..1ab8857 --- /dev/null +++ b/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-db.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: flexvolsmb-pterodactyl-db + namespace: pterodactyl +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-pterodactyl-db + flexVolume: + driver: mount/smb + secretRef: + name: flexvolsmb-credentials + options: + opts: file_mode=0600,dir_mode=0700,uid=999,gid=999,iocharset=utf8,nobrl + server: 192.168.154.195 + share: /K3s.Volumes/pterodactyl/db diff --git a/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-logs.yaml b/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-logs.yaml new file mode 100644 index 0000000..9279a49 --- /dev/null +++ b/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-logs.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: flexvolsmb-pterodactyl-logs + namespace: pterodactyl +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-pterodactyl-logs + flexVolume: + driver: mount/smb + secretRef: + name: flexvolsmb-credentials + options: + opts: file_mode=0600,dir_mode=0700,uid=100,gid=101,iocharset=utf8,nobrl + server: 192.168.154.195 + share: /K3s.Volumes/pterodactyl/logs diff --git a/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-proxy.yaml b/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-proxy.yaml new file mode 100644 index 0000000..ef02565 --- /dev/null +++ b/services/Pterodactyl/persistentvolume-flexvolsmb-pterodactyl-proxy.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: flexvolsmb-pterodactyl-proxy + namespace: pterodactyl +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-pterodactyl-proxy + flexVolume: + driver: mount/smb + secretRef: + name: flexvolsmb-credentials + options: + opts: file_mode=0600,dir_mode=0700,uid=100,gid=101,iocharset=utf8,nobrl + server: 192.168.154.195 + share: /K3s.Volumes/pterodactyl/proxy diff --git a/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-data.yaml b/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-data.yaml new file mode 100644 index 0000000..e8ec952 --- /dev/null +++ b/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-data.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: flexvolsmb-pterodactyl-data + namespace: pterodactyl +spec: + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-pterodactyl-data + resources: + requests: + storage: 1Gi diff --git a/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-db.yaml b/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-db.yaml new file mode 100644 index 0000000..6167cb5 --- /dev/null +++ b/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-db.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: flexvolsmb-pterodactyl-db + namespace: pterodactyl +spec: + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-pterodactyl-db + resources: + requests: + storage: 1Gi diff --git a/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-logs.yaml b/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-logs.yaml new file mode 100644 index 0000000..ecf496b --- /dev/null +++ b/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-logs.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: flexvolsmb-pterodactyl-logs + namespace: pterodactyl +spec: + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-pterodactyl-logs + resources: + requests: + storage: 1Gi diff --git a/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-proxy.yaml b/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-proxy.yaml new file mode 100644 index 0000000..861666b --- /dev/null +++ b/services/Pterodactyl/persistentvolumeclaim-flexvolsmb-pterodactyl-proxy.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: flexvolsmb-pterodactyl-proxy + namespace: pterodactyl +spec: + accessModes: + - ReadWriteMany + storageClassName: flexvolsmb-pterodactyl-proxy + resources: + requests: + storage: 1Gi diff --git a/services/Pterodactyl/sealedsecret-flexvolsmb-credentials.yaml b/services/Pterodactyl/sealedsecret-flexvolsmb-credentials.yaml new file mode 100644 index 0000000..8d4745e --- /dev/null +++ b/services/Pterodactyl/sealedsecret-flexvolsmb-credentials.yaml @@ -0,0 +1,16 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + creationTimestamp: null + name: flexvolsmb-credentials + namespace: pterodactyl +spec: + encryptedData: + password: AgA1qF+SfJWK/3C6b/2koGQX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4FZ9uG2LY5kU7mOhcr71FLGcWiDAGpsPNUKJuyWPGfnwVanho9IR93eTot0oX33quf4gbYWiF19EyFX+ig6D7Rvf4svVkURa8UkwSa5vSbz+fKBVgwD5GB/XL/ZCTSldMEb7xVVGJ+p9vKRnIn0KyEjz60pEYXo0oRwlAAkhh2WLN3iRYP5NgpdX5J1ED40Gnz6yMqWyBzhVNRrFz+on4PGbEkhTvxmVQxJjbGzkh4sAcjrjqN2vlMNhXYNAGwBRDUvzJBJC4W1C8f6VZ7+1dVdXi3UQPo64coE+qAOH52ZyTXUXCcnhPLEZMgLNpdZ5pEEruhu2M5zVo5N1Pt9Fn36ie0WjIacz56VjpmZT8= + template: + metadata: + creationTimestamp: null + name: flexvolsmb-credentials + namespace: pterodactyl + type: mount/smb diff --git a/services/Pterodactyl/sealedsecret-pterodactyl-db-secret.yaml b/services/Pterodactyl/sealedsecret-pterodactyl-db-secret.yaml new file mode 100644 index 0000000..5f45360 --- /dev/null +++ b/services/Pterodactyl/sealedsecret-pterodactyl-db-secret.yaml @@ -0,0 +1,19 @@ +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + creationTimestamp: null + name: pterodactyl-db-secret + namespace: pterodactyl +spec: + encryptedData: + DB_PASSWORD: AgBPIDe8E4g5ue5RpQd1JSMOPevGn2vaQSttFx1GVhH8gYR7bBMXnTlpxtp6wkCM4Xpbsvc6I/eFMvEaIL5nkdD8Bv/R2OfWrHp5U0RNQwkRP5XyDwWSYSOlvAXh8aBAkiZCopv9P32QZl7EnOvx1wNexvhzaOolkSipMLBQ/T+Z6POI0EB1DaYYFgUEatjc10GwNIHOjAU3NKY3Ka3QoQXtIF5lkDlwz20jd/iKMCSJsi75eBIDhrHN5xsK8wenBMrSnxePTg0C+9L9bX17sqLZx7PQkrxRtNe+bWaFqD8tKnPC53IKYgagoK6S3YFgA5JMOTdcIoQwb9bKbH8Cg+/IBvToTcx7ofMq27Ed8cmvrn8yJeTazq1YzuWh1mfPLjTD3io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ROOT_PASSWORD: AgB6N26BSmytg/0yxLSnaQxTdhzqrYXTdqqPcno3D21gX+u2toMpH+8JPvSNn0tvr38SWgObepjgV1alSR1Ee6VFyhrWqg0SwPSpix7+aglMTKrUfGRazatNgxGG/5PJu4hMNaezvH5bCk5eGPEGVgFJhuwEPsdOusf3J+JsL0OW8Ly0v3t3Re44ADIAq9F9cCO/esT0gqMsrrVD61+ke5q4UrmsN0bcUDCA7rOp+M3gnA8KTXhFap0ZQbATx/7VMpGgRWlKHiHE4mNo+Kjcog0vCJlvLHOW+sguXH1S1LDrtfGmHvnTWu/FEw/MO4aXwzmSeK/BbxtdUjSizL9hwgil0tAoPjqtMJ3CQMlbHKrXjL3tNfAMlSPZt1jG6XeFQpTfem1WpxwbTmHPVgK/+Ps8b4kLF7dXAI8m1arK6QCqsZCiqo5ToSehDueAQUfjicWf/7i11YAgT6XhXBfKSBIBmS9Y4LOoakGBT5gctEEZi2i5pZaUSjuKjez/raw33LT6twOjeLpynO8KfOW1K9EGIUM9XDFc5LQciYAmeCHdU8nNSa1Pk/ZwKUPeG01V8NotvGJtV4pUl9POSY7x/hguEoz+n0w6nuIHAHBCoTo4iNu757wZDPn8QeJhTpYKJ2qR5gvYxoBOuLqaxr059X8TfakrLoCRxn5XTcyztXi63bR5/OWBRJ8ChPzhmSZZOfeS90Q3Tc4kpuIBDA== + template: + metadata: + creationTimestamp: null + labels: + app: pterodactyl + name: pterodactyl-db-secret + namespace: pterodactyl + type: Opaque diff --git a/services/Pterodactyl/service-pterodactyl.yaml b/services/Pterodactyl/service-pterodactyl.yaml new file mode 100644 index 0000000..5f16e27 --- /dev/null +++ b/services/Pterodactyl/service-pterodactyl.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: pterodactyl + namespace: pterodactyl +spec: + ports: + - protocol: TCP + name: web + port: 80 + - protocol: TCP + name: db + port: 3306 + - protocol: TCP + name: redis + port: 6379 + selector: + app: pterodactyl