From ffef0a5d921b97b5a05a544d2f25e4e1a960019b Mon Sep 17 00:00:00 2001 From: Sense T Date: Sat, 1 Oct 2022 09:09:30 +0000 Subject: [PATCH] a --- factorio/deployment.yaml | 48 +++++++++++++++++++++++++++++ factorio/kustomization.yaml | 23 ++++++++++++++ factorio/services.yaml | 33 ++++++++++++++++++++ headscale/server/daemonset.yaml | 36 ++++++++++++++++++++++ headscale/server/ingress.yaml | 25 +++++++++++++++ headscale/server/kustomization.yaml | 13 ++++++++ headscale/server/pvc.yaml | 10 ++++++ headscale/server/service.yaml | 15 +++++++++ ksp-dmpserver/deployment.yaml | 38 +++++++++++++++++++++++ ksp-dmpserver/kustomization.yaml | 13 ++++++++ ksp-dmpserver/service.yaml | 16 ++++++++++ ksp-forward/daemonset.yaml | 28 +++++++++++++++++ ksp-forward/kustomization.yaml | 6 ++++ ksp-lmpserver/deployment.yaml | 44 ++++++++++++++++++++++++++ ksp-lmpserver/kustomization.yaml | 9 ++++++ ksp-lmpserver/service.yaml | 16 ++++++++++ pac-server/deployment.yaml | 28 +++++++++++++++++ pac-server/kustomization.yaml | 13 ++++++++ pac-server/server.yaml | 15 +++++++++ 19 files changed, 429 insertions(+) create mode 100644 factorio/deployment.yaml create mode 100644 factorio/kustomization.yaml create mode 100644 factorio/services.yaml create mode 100644 headscale/server/daemonset.yaml create mode 100644 headscale/server/ingress.yaml create mode 100644 headscale/server/kustomization.yaml create mode 100644 headscale/server/pvc.yaml create mode 100644 headscale/server/service.yaml create mode 100644 ksp-dmpserver/deployment.yaml create mode 100644 ksp-dmpserver/kustomization.yaml create mode 100644 ksp-dmpserver/service.yaml create mode 100644 ksp-forward/daemonset.yaml create mode 100644 ksp-forward/kustomization.yaml create mode 100644 ksp-lmpserver/deployment.yaml create mode 100644 ksp-lmpserver/kustomization.yaml create mode 100644 ksp-lmpserver/service.yaml create mode 100644 pac-server/deployment.yaml create mode 100644 pac-server/kustomization.yaml create mode 100644 pac-server/server.yaml diff --git a/factorio/deployment.yaml b/factorio/deployment.yaml new file mode 100644 index 0000000..e55b808 --- /dev/null +++ b/factorio/deployment.yaml @@ -0,0 +1,48 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: factorio +spec: + selector: + matchLabels: + app: factorio + template: + metadata: + labels: + app: factorio + spec: + volumes: + - name: config + configMap: + name: factorio + - name: data + hostPath: + path: /data/factorio + containers: + - name: factorio + image: factoriotools/factorio + env: + - name: SAVE_NAME + value: server_krastorio_se + - name: LOAD_LATEST_SAVE + value: "false" + - name: GENERATE_NEW_SAVE + value: "false" + - name: CONFIG + value: /config + resources: + limits: + cpu: "2" + memory: "8Gi" + ports: + - containerPort: 34197 + protocol: UDP + name: factorio + - containerPort: 27015 + protocol: TCP + name: rcon + volumeMounts: + - mountPath: /factorio + name: data + - mountPath: /config + name: config diff --git a/factorio/kustomization.yaml b/factorio/kustomization.yaml new file mode 100644 index 0000000..6119869 --- /dev/null +++ b/factorio/kustomization.yaml @@ -0,0 +1,23 @@ +# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: game +resources: + - deployment.yaml + - services.yaml +configMapGenerator: + - name: factorio + files: + - config/rconpw + - config/server-adminlist.json + - config/server-banlist.json + - config/server-settings.json + - config/server-whitelist.json + - config/map-settings.json + - config/map-gen-settings.json +commonLabels: + app: factorio +images: + - name: factoriotools/factorio + newTag: 1.1.69 \ No newline at end of file diff --git a/factorio/services.yaml b/factorio/services.yaml new file mode 100644 index 0000000..fe9ac60 --- /dev/null +++ b/factorio/services.yaml @@ -0,0 +1,33 @@ +kind: Service +apiVersion: v1 +metadata: + name: factorio-game +spec: + selector: + app: factorio + type: LoadBalancer + ipFamilyPolicy: PreferDualStack + ipFamilies: + - IPv4 + - IPv6 + ports: + - port: 34197 + protocol: UDP + targetPort: factorio +--- +apiVersion: v1 +kind: Service +metadata: + name: factorio-rcon +spec: + ipFamilyPolicy: PreferDualStack + ipFamilies: + - IPv4 + - IPv6 + selector: + app: factorio + ports: + - port: 27015 + targetPort: rcon + protocol: TCP + diff --git a/headscale/server/daemonset.yaml b/headscale/server/daemonset.yaml new file mode 100644 index 0000000..32bc4ac --- /dev/null +++ b/headscale/server/daemonset.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: headscale +spec: + template: + metadata: + labels: + app: headscale + spec: + hostNetwork: true + volumes: + - name: data + persistentVolumeClaim: + claimName: headscale + - name: certs + secret: + secretName: wetofu-me-certs + - name: config + configMap: + name: headscale + containers: + - name: headscale + image: ghcr.io/juanfont/headscale + args: + - serve + volumeMounts: + - name: data + mountPath: /var/lib/headscale + - name: certs + mountPath: /certs + - name: config + mountPath: /etc/headscale + selector: + matchLabels: + app: headscale \ No newline at end of file diff --git a/headscale/server/ingress.yaml b/headscale/server/ingress.yaml new file mode 100644 index 0000000..6277e6a --- /dev/null +++ b/headscale/server/ingress.yaml @@ -0,0 +1,25 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: headscale + annotations: + cert-manager.io/cluster-issuer: letsencrypt + kubernetes.io/ingress.class: traefik + traefik.ingress.kubernetes.io/router.entrypoints: websecure + traefik.ingress.kubernetes.io/router.tls: 'true' +spec: + tls: + - hosts: + - '*.wetofu.me' + secretName: wetofu-me-certs + rules: + - host: hs.wetofu.me + http: + paths: + - path: / + pathType: ImplementationSpecific + backend: + service: + name: headscale + port: + number: 8080 diff --git a/headscale/server/kustomization.yaml b/headscale/server/kustomization.yaml new file mode 100644 index 0000000..5bd0697 --- /dev/null +++ b/headscale/server/kustomization.yaml @@ -0,0 +1,13 @@ +# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - daemonset.yaml + - pvc.yaml + - service.yaml + - ingress.yaml +configMapGenerator: + - name: headscale + files: + - config/config.yaml \ No newline at end of file diff --git a/headscale/server/pvc.yaml b/headscale/server/pvc.yaml new file mode 100644 index 0000000..ee7f84f --- /dev/null +++ b/headscale/server/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: headscale +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1G diff --git a/headscale/server/service.yaml b/headscale/server/service.yaml new file mode 100644 index 0000000..3abcf01 --- /dev/null +++ b/headscale/server/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: headscale +spec: + ipFamilyPolicy: PreferDualStack + ipFamilies: + - IPv4 + - IPv6 + ports: + - name: http + port: 8080 + targetPort: 8081 + selector: + app: headscale \ No newline at end of file diff --git a/ksp-dmpserver/deployment.yaml b/ksp-dmpserver/deployment.yaml new file mode 100644 index 0000000..a0ae1cb --- /dev/null +++ b/ksp-dmpserver/deployment.yaml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ksp-dmpserver +spec: + selector: + matchLabels: + app: ksp-dmpserver + template: + metadata: + labels: + app: ksp-dmpserver + spec: + volumes: + - name: data + hostPath: + path: /data/ksp-server + containers: + - name: ksp-dmpserver + image: ksp-dmpserver + resources: + limits: + cpu: '1' + memory: '512Mi' + ports: + - name: ksp + protocol: TCP + containerPort: 6702 + volumeMounts: + - name: data + mountPath: /opt/DMPServer/Config + subPath: Config + - name: data + mountPath: /opt/DMPServer/Plugins + subPath: Plugins + - name: data + mountPath: /opt/DMPServer/Universe + subPath: Universe \ No newline at end of file diff --git a/ksp-dmpserver/kustomization.yaml b/ksp-dmpserver/kustomization.yaml new file mode 100644 index 0000000..9ba7277 --- /dev/null +++ b/ksp-dmpserver/kustomization.yaml @@ -0,0 +1,13 @@ +# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - deployment.yaml + - service.yaml +images: + - name: ksp-dmpserver + newName: ghcr.io/midymidy-mc/ksp-dmpserver + newTag: v0.3.8.3 +namespace: game \ No newline at end of file diff --git a/ksp-dmpserver/service.yaml b/ksp-dmpserver/service.yaml new file mode 100644 index 0000000..d2387d8 --- /dev/null +++ b/ksp-dmpserver/service.yaml @@ -0,0 +1,16 @@ +kind: Service +apiVersion: v1 +metadata: + name: ksp-dmpserver +spec: + selector: + app: ksp-dmpserver + type: LoadBalancer + ipFamilyPolicy: PreferDualStack + ipFamilies: + - IPv4 + - IPv6 + ports: + - port: 6702 + protocol: TCP + targetPort: ksp \ No newline at end of file diff --git a/ksp-forward/daemonset.yaml b/ksp-forward/daemonset.yaml new file mode 100644 index 0000000..6935118 --- /dev/null +++ b/ksp-forward/daemonset.yaml @@ -0,0 +1,28 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: ksp-forwarder +spec: + selector: + matchLabels: + app: ksp-forwarder + template: + metadata: + labels: + app: ksp-forwarder + spec: + hostNetwork: true + containers: + - name: ksp-forwarder + image: alpine/socat:1.7.4.3-r0 + args: + - '-ls' + - UDP-LISTEN:8800,reuseaddr,fork + - UDP6:ksp.midymidy.tk:8800 + resources: + limits: + cpu: 100m + memory: 32Mi + requests: + cpu: 10m + memory: 8Mi diff --git a/ksp-forward/kustomization.yaml b/ksp-forward/kustomization.yaml new file mode 100644 index 0000000..f927845 --- /dev/null +++ b/ksp-forward/kustomization.yaml @@ -0,0 +1,6 @@ +# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - daemonset.yaml \ No newline at end of file diff --git a/ksp-lmpserver/deployment.yaml b/ksp-lmpserver/deployment.yaml new file mode 100644 index 0000000..672b9c0 --- /dev/null +++ b/ksp-lmpserver/deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ksp-lmpserver +spec: + selector: + matchLabels: + app: ksp-lmpserver + template: + metadata: + labels: + app: ksp-lmpserver + spec: + volumes: + - name: data + hostPath: + path: /data/ksp-lmpserver + containers: + - name: ksp-lmpserver + image: ghcr.io/lunamultiplayer/lunamultiplayer/server:master + imagePullPolicy: Always + stdin: true + tty: true + resources: + limits: + cpu: '1' + memory: '512Mi' + ports: + - name: ksp + protocol: UDP + containerPort: 8800 + - protocol: TCP + containerPort: 8900 + name: nport + volumeMounts: + - name: data + mountPath: /LMPServer/Config + subPath: Config + - name: data + mountPath: /LMPServer/Plugins + subPath: Plugins + - name: data + mountPath: /LMPServer/Universe + subPath: Universe \ No newline at end of file diff --git a/ksp-lmpserver/kustomization.yaml b/ksp-lmpserver/kustomization.yaml new file mode 100644 index 0000000..3e57c78 --- /dev/null +++ b/ksp-lmpserver/kustomization.yaml @@ -0,0 +1,9 @@ +# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - deployment.yaml + - service.yaml +namespace: game diff --git a/ksp-lmpserver/service.yaml b/ksp-lmpserver/service.yaml new file mode 100644 index 0000000..a2e6f5a --- /dev/null +++ b/ksp-lmpserver/service.yaml @@ -0,0 +1,16 @@ +kind: Service +apiVersion: v1 +metadata: + name: ksp-lmpserver +spec: + type: LoadBalancer + ipFamilyPolicy: PreferDualStack + ipFamilies: + - IPv4 + - IPv6 + selector: + app: ksp-lmpserver + ports: + - port: 8800 + protocol: UDP + targetPort: ksp \ No newline at end of file diff --git a/pac-server/deployment.yaml b/pac-server/deployment.yaml new file mode 100644 index 0000000..1e6bddc --- /dev/null +++ b/pac-server/deployment.yaml @@ -0,0 +1,28 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pac-server +spec: + selector: + matchLabels: + app: pac-server + template: + metadata: + labels: + app: pac-server + spec: + volumes: + - name: conf + configMap: + name: pac-config + defaultMode: 420 + containers: + - name: nginx + image: nginx + resources: + limits: + cpu: 500m + memory: 256Mi + volumeMounts: + - mountPath: /usr/share/nginx/html + name: conf \ No newline at end of file diff --git a/pac-server/kustomization.yaml b/pac-server/kustomization.yaml new file mode 100644 index 0000000..e278a05 --- /dev/null +++ b/pac-server/kustomization.yaml @@ -0,0 +1,13 @@ +# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json + +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - deployment.yaml + - server.yaml +configMapGenerator: + - name: pac-config + files: + - config/proxy.pac +commonLabels: + app: pac-server \ No newline at end of file diff --git a/pac-server/server.yaml b/pac-server/server.yaml new file mode 100644 index 0000000..3c6b81e --- /dev/null +++ b/pac-server/server.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: pac-server +spec: + selector: + app: pac-server + ports: + - port: 8089 + targetPort: 80 + type: LoadBalancer + ipFamilies: + - IPv4 + - IPv6 + ipFamilyPolicy: PreferDualStack \ No newline at end of file