v0.0.1
This commit is contained in:
124
tasks/deploy-production.yml
Normal file
124
tasks/deploy-production.yml
Normal file
@@ -0,0 +1,124 @@
|
||||
---
|
||||
# tasks file for deploy-production.yml
|
||||
- name: Create persistent volume for gondwanamc production
|
||||
k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: pv-gondwanamc-production
|
||||
spec:
|
||||
capacity:
|
||||
storage: 8Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: standard
|
||||
hostPath:
|
||||
path: /data/store-0/pv-gondwanamc-production
|
||||
nodeAffinity:
|
||||
required:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/hostname
|
||||
operator: In
|
||||
values:
|
||||
- alpha-worker-0
|
||||
|
||||
- name: Unpack gondwanamc world data to the production persistent volume
|
||||
unpack:
|
||||
src: Gondwana.tar.gz
|
||||
dest: /data/store-0/pv-gondwanamc-production
|
||||
copy: true
|
||||
|
||||
- name: Copy server properties to production persistent volume
|
||||
copy:
|
||||
src: server.properties
|
||||
dest: /data/store-0/pv-gondwanamc-production
|
||||
|
||||
- name: Copy whitelist to production persistent volume
|
||||
copy:
|
||||
src: whitelist.json
|
||||
dest: /data/store-0/pv-gondwanamc-production
|
||||
|
||||
- name: Create persistent volume claim for gondwanamc production volume
|
||||
k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: pv-claim-gondwanamc-production
|
||||
namespace: production
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 8Gi
|
||||
storageClassName: standard
|
||||
volumeName: pv-gondwanamc-production
|
||||
|
||||
- name: Create a production Deployment
|
||||
k8s:
|
||||
definition:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: minecraft-deployment
|
||||
namespace: production
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: gondwanamc.com
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: gondwanamc.com
|
||||
spec:
|
||||
containers:
|
||||
- name: openminecraft
|
||||
image: itzg/minecraft-server
|
||||
volumeMounts:
|
||||
- name: pv-gondwanamc-production
|
||||
mountPath: /data
|
||||
ports:
|
||||
- containerPort: 25565
|
||||
- containerPort: 24454
|
||||
env:
|
||||
- name: EULA
|
||||
value: "TRUE"
|
||||
- name: TYPE
|
||||
value: "FABRIC"
|
||||
- name: MODS
|
||||
value: "https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/fabric,https://cdn.modrinth.com/data/bWrNNfkb/versions/D4KXqjtC/Floodgate-Fabric-2.2.3-SNAPSHOT%2Bbuild.28.jar,https://www.curseforge.com/api/v1/mods/306612/files/5510851/download,https://www.curseforge.com/api/v1/mods/416089/files/5500955/download"
|
||||
- name: MEMORY
|
||||
value: "16G"
|
||||
volumes:
|
||||
- name: pv-gondwanamc-production
|
||||
persistentVolumeClaim:
|
||||
claimName: pv-claim-gondwanamc-production
|
||||
|
||||
- name: Expose Deployment as a Service in production
|
||||
k8s:
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: service-gondwanamc-com
|
||||
namespace: production
|
||||
spec:
|
||||
selector:
|
||||
app: gondwanamc.com
|
||||
ports:
|
||||
- port: 24454
|
||||
protocol: TCP
|
||||
name: minecraft-port-24454
|
||||
nodePort: "{{ nodePorts[gondwanamc-24454] }}"
|
||||
- port: 25565
|
||||
protocol: TCP
|
||||
name: minecraft-port-25565
|
||||
nodePort: "{{ nodePorts[gondwanamc-25565] }}"
|
||||
type: NodePort
|
||||
104
tasks/deploy-testing.yml
Normal file
104
tasks/deploy-testing.yml
Normal file
@@ -0,0 +1,104 @@
|
||||
---
|
||||
# tasks file for ericomeehan.minecraft.eom.dev
|
||||
- name: Create persistent volume for gondwanamc testing
|
||||
k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: pv-gondwanamc-testing
|
||||
spec:
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: standard
|
||||
hostPath:
|
||||
path: /data/store-0/pv-gondwanamc-testing
|
||||
nodeAffinity:
|
||||
required:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/hostname
|
||||
operator: In
|
||||
values:
|
||||
- alpha-worker-0
|
||||
|
||||
- name: Create persistent volume claim for gondwanamc testing volume
|
||||
k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: pv-claim-gondwanamc-testing
|
||||
namespace: testing
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storageClassName: standard
|
||||
volumeName: pv-gondwanamc-testing
|
||||
|
||||
- name: Create a testing Deployment
|
||||
k8s:
|
||||
definition:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: minecraft-deployment
|
||||
namespace: testing
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: gondwanamc.com
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: gondwanamc.com
|
||||
spec:
|
||||
containers:
|
||||
- name: openminecraft
|
||||
image: itzg/minecraft-server
|
||||
volumeMounts:
|
||||
- name: pv-gondwanamc-testing
|
||||
mountPath: /data
|
||||
ports:
|
||||
- containerPort: 25565
|
||||
- containerPort: 24454
|
||||
env:
|
||||
- name: EULA
|
||||
value: "TRUE"
|
||||
- name: TYPE
|
||||
value: "FABRIC"
|
||||
- name: MODS
|
||||
value: "https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/fabric,https://cdn.modrinth.com/data/bWrNNfkb/versions/D4KXqjtC/Floodgate-Fabric-2.2.3-SNAPSHOT%2Bbuild.28.jar,https://www.curseforge.com/api/v1/mods/306612/files/5510851/download,https://www.curseforge.com/api/v1/mods/416089/files/5500955/download"
|
||||
volumes:
|
||||
- name: pv-gondwanamc-testing
|
||||
persistentVolumeClaim:
|
||||
claimName: pv-claim-gondwanamc-testing
|
||||
|
||||
- name: Expose Deployment as a Service in testing
|
||||
k8s:
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: service-gondwanamc-com
|
||||
namespace: testing
|
||||
spec:
|
||||
selector:
|
||||
app: gondwanamc.com
|
||||
ports:
|
||||
- port: 24454
|
||||
protocol: TCP
|
||||
name: minecraft-port-24454
|
||||
- port: 25565
|
||||
protocol: TCP
|
||||
name: minecraft-port-25565
|
||||
type: ClusterIP
|
||||
117
tasks/main.yml
Normal file
117
tasks/main.yml
Normal file
@@ -0,0 +1,117 @@
|
||||
---
|
||||
# tasks file for ericomeehan.gondwana
|
||||
# TODO: Create configmaps for configurations
|
||||
- name: Create gondwana namespace
|
||||
k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: "gondwana-{{ target_namespace }}"
|
||||
|
||||
- name: Create persistent volume for gondwana
|
||||
k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: gondwana-mc-pv
|
||||
spec:
|
||||
capacity:
|
||||
storage: 32Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: standard
|
||||
hostPath:
|
||||
path: "/data/store-0/gondwana/mc"
|
||||
nodeAffinity:
|
||||
required:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/hostname
|
||||
operator: In
|
||||
values:
|
||||
- alpha-worker-0
|
||||
|
||||
- name: Create persistent volume claim for gondwana volume
|
||||
k8s:
|
||||
state: present
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mc-pvc
|
||||
namespace: "gondwana-{{ target_namespace }}"
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 8Gi
|
||||
storageClassName: standard
|
||||
volumeName: gondwana-mc-pv
|
||||
|
||||
- name: Create a Deployment
|
||||
k8s:
|
||||
definition:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mc-deploy
|
||||
namespace: "gondwana-{{ target_namespace }}"
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mc
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mc
|
||||
spec:
|
||||
containers:
|
||||
- name: minecraft
|
||||
image: itzg/minecraft-server
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
ports:
|
||||
- containerPort: 25565
|
||||
- containerPort: 24454
|
||||
protocol: UDP
|
||||
env:
|
||||
- name: EULA
|
||||
value: "TRUE"
|
||||
- name: TYPE
|
||||
value: "FABRIC"
|
||||
- name: MODS
|
||||
value: "https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/fabric,https://cdn.modrinth.com/data/bWrNNfkb/versions/D4KXqjtC/Floodgate-Fabric-2.2.3-SNAPSHOT%2Bbuild.28.jar,https://www.curseforge.com/api/v1/mods/306612/files/5510851/download,https://www.curseforge.com/api/v1/mods/416089/files/5500955/download"
|
||||
- name: MEMORY
|
||||
value: "8G"
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: mc-pvc
|
||||
|
||||
- name: Expose Deployment as a Service
|
||||
k8s:
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mc-svc
|
||||
namespace: "gondwana-{{ target_namespace }}"
|
||||
spec:
|
||||
selector:
|
||||
app: mc
|
||||
ports:
|
||||
- port: 24454
|
||||
protocol: UDP
|
||||
name: mc-port-24454
|
||||
- port: 25565
|
||||
protocol: TCP
|
||||
name: mc-port-25565
|
||||
type: NodePort
|
||||
Reference in New Issue
Block a user