From 95c7fa79f3ee33675a0d03fc9d3d6d96231703a8 Mon Sep 17 00:00:00 2001 From: ducoterra Date: Fri, 27 Nov 2020 15:30:43 -0500 Subject: [PATCH] merge templates --- docker-compose.yaml | 2 +- {minecraft => helm}/.helmignore | 0 {pubcraft => helm}/Chart.yaml | 2 +- helm/templates/configmap.yaml | 8 +++ {testcraft => helm}/templates/deploy.yaml | 8 +-- {pubcraft => helm}/templates/pvc.yaml | 1 - {minecraft => helm}/templates/service.yaml | 0 helm/values.yaml | 79 ++++++++++++++++++++++ minecraft/Chart.yaml | 23 ------- minecraft/templates/configmap.yaml | 45 ------------ minecraft/templates/deploy.yaml | 50 -------------- minecraft/templates/pvc.yaml | 13 ---- minecraft/values.yaml | 3 - pubcraft/.helmignore | 23 ------- pubcraft/templates/configmap.yaml | 45 ------------ pubcraft/templates/deploy.yaml | 50 -------------- pubcraft/templates/service.yaml | 12 ---- pubcraft/values.yaml | 2 - testcraft/.helmignore | 23 ------- testcraft/Chart.yaml | 23 ------- testcraft/templates/configmap.yaml | 45 ------------ testcraft/templates/pvc.yaml | 13 ---- testcraft/templates/service.yaml | 12 ---- testcraft/values.yaml | 2 - values-minecraft.yaml | 42 ++++++++++++ values-pubcraft.yaml | 42 ++++++++++++ values-testcraft.yaml | 42 ++++++++++++ 27 files changed, 219 insertions(+), 391 deletions(-) rename {minecraft => helm}/.helmignore (100%) rename {pubcraft => helm}/Chart.yaml (98%) create mode 100644 helm/templates/configmap.yaml rename {testcraft => helm}/templates/deploy.yaml (84%) rename {pubcraft => helm}/templates/pvc.yaml (89%) rename {minecraft => helm}/templates/service.yaml (100%) create mode 100644 helm/values.yaml delete mode 100644 minecraft/Chart.yaml delete mode 100644 minecraft/templates/configmap.yaml delete mode 100644 minecraft/templates/deploy.yaml delete mode 100644 minecraft/templates/pvc.yaml delete mode 100644 minecraft/values.yaml delete mode 100644 pubcraft/.helmignore delete mode 100644 pubcraft/templates/configmap.yaml delete mode 100644 pubcraft/templates/deploy.yaml delete mode 100644 pubcraft/templates/service.yaml delete mode 100644 pubcraft/values.yaml delete mode 100644 testcraft/.helmignore delete mode 100644 testcraft/Chart.yaml delete mode 100644 testcraft/templates/configmap.yaml delete mode 100644 testcraft/templates/pvc.yaml delete mode 100644 testcraft/templates/service.yaml delete mode 100644 testcraft/values.yaml create mode 100644 values-minecraft.yaml create mode 100644 values-pubcraft.yaml create mode 100644 values-testcraft.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml index dc027f6..d69e7d8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,4 +3,4 @@ version: '3' services: minecraft: build: . - image: hub.ducoterra.net/ducoterra/minecraft:1.16.1_3 \ No newline at end of file + image: hub.ducoterra.net/ducoterra/minecraft:1.16.4 \ No newline at end of file diff --git a/minecraft/.helmignore b/helm/.helmignore similarity index 100% rename from minecraft/.helmignore rename to helm/.helmignore diff --git a/pubcraft/Chart.yaml b/helm/Chart.yaml similarity index 98% rename from pubcraft/Chart.yaml rename to helm/Chart.yaml index 52c1320..cf7bc40 100644 --- a/pubcraft/Chart.yaml +++ b/helm/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: charts +name: helm description: A Helm chart for Kubernetes # A chart can be either an 'application' or a 'library' chart. diff --git a/helm/templates/configmap.yaml b/helm/templates/configmap.yaml new file mode 100644 index 0000000..43a784a --- /dev/null +++ b/helm/templates/configmap.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }} +data: + eula.txt: | + eula=true + server.properties: {{ toYaml .Values.server_props | indent 2 }} \ No newline at end of file diff --git a/testcraft/templates/deploy.yaml b/helm/templates/deploy.yaml similarity index 84% rename from testcraft/templates/deploy.yaml rename to helm/templates/deploy.yaml index d89bfdb..d838d91 100644 --- a/testcraft/templates/deploy.yaml +++ b/helm/templates/deploy.yaml @@ -29,15 +29,15 @@ spec: stdin: true env: - name: MAX_RAM - value: "4" + value: {{ .Values.max_ram | quote }} - name: MIN_RAM - value: "1" + value: {{ .Values.min_ram | quote }} resources: requests: - memory: "2Gi" + memory: {{ .Values.min_ram }}Gi cpu: 250m limits: - memory: "8Gi" + memory: {{ .Values.max_ram }}Gi cpu: "4" volumes: - name: data diff --git a/pubcraft/templates/pvc.yaml b/helm/templates/pvc.yaml similarity index 89% rename from pubcraft/templates/pvc.yaml rename to helm/templates/pvc.yaml index c0bccd5..e825a00 100644 --- a/pubcraft/templates/pvc.yaml +++ b/helm/templates/pvc.yaml @@ -5,7 +5,6 @@ metadata: annotations: "helm.sh/resource-policy": keep spec: - storageClassName: nvme accessModes: - ReadWriteOnce resources: diff --git a/minecraft/templates/service.yaml b/helm/templates/service.yaml similarity index 100% rename from minecraft/templates/service.yaml rename to helm/templates/service.yaml diff --git a/helm/values.yaml b/helm/values.yaml new file mode 100644 index 0000000..5c23cc8 --- /dev/null +++ b/helm/values.yaml @@ -0,0 +1,79 @@ +# Default values for helm. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/minecraft/Chart.yaml b/minecraft/Chart.yaml deleted file mode 100644 index 730623c..0000000 --- a/minecraft/Chart.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v2 -name: minecraft -description: Personal Minecraft Server - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.16 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 1.16 diff --git a/minecraft/templates/configmap.yaml b/minecraft/templates/configmap.yaml deleted file mode 100644 index bb0da57..0000000 --- a/minecraft/templates/configmap.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Release.Name }} -data: - eula.txt: | - eula=true - server.properties: | - max-tick-time=60000 - generator-settings= - force-gamemode=false - allow-nether=true - gamemode=0 - broadcast-console-to-ops=true - enable-query=false - player-idle-timeout=0 - difficulty=3 - spawn-monsters=true - op-permission-level=4 - pvp=true - snooper-enabled=true - level-type=default - hardcore=false - enable-command-block=false - max-players=20 - network-compression-threshold=256 - resource-pack-sha1= - max-world-size=29999984 - server-port=25565 - server-ip= - spawn-npcs=true - allow-flight=true - level-name=world - view-distance=32 - resource-pack= - spawn-animals=true - white-list=true - generate-structures=true - online-mode=true - max-build-height=256 - level-seed= - prevent-proxy-connections=false - use-native-transport=true - motd=This is gonna be interesting - enable-rcon=false \ No newline at end of file diff --git a/minecraft/templates/deploy.yaml b/minecraft/templates/deploy.yaml deleted file mode 100644 index 2eef7f9..0000000 --- a/minecraft/templates/deploy.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Release.Name }} -spec: - selector: - matchLabels: - app: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ .Release.Name }} - spec: - containers: - - name: {{ .Release.Name }} - image: {{ .Values.image }}:{{ .Values.tag }} - ports: - - containerPort: 25565 - volumeMounts: - - mountPath: /mc_data - name: data - - name: properties - mountPath: /mc_data/server.properties - subPath: server.properties - - name: properties - mountPath: /mc_data/eula.txt - subPath: eula.txt - tty: true - stdin: true - env: - - name: MAX_RAM - value: "4" - - name: MIN_RAM - value: "1" - - name: THREADS - value: "4" - resources: - requests: - memory: "2Gi" - cpu: 250m - limits: - memory: "8Gi" - cpu: "4" - volumes: - - name: data - persistentVolumeClaim: - claimName: {{ .Release.Name }} - - name: properties - configMap: - name: {{ .Release.Name }} \ No newline at end of file diff --git a/minecraft/templates/pvc.yaml b/minecraft/templates/pvc.yaml deleted file mode 100644 index c0bccd5..0000000 --- a/minecraft/templates/pvc.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .Release.Name }} - annotations: - "helm.sh/resource-policy": keep -spec: - storageClassName: nvme - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 32Gi \ No newline at end of file diff --git a/minecraft/values.yaml b/minecraft/values.yaml deleted file mode 100644 index 7fdb787..0000000 --- a/minecraft/values.yaml +++ /dev/null @@ -1,3 +0,0 @@ -image: hub.ducoterra.net/ducoterra/minecraft -tag: 1.16.1_2 -port: 25565 \ No newline at end of file diff --git a/pubcraft/.helmignore b/pubcraft/.helmignore deleted file mode 100644 index 0e8a0eb..0000000 --- a/pubcraft/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/pubcraft/templates/configmap.yaml b/pubcraft/templates/configmap.yaml deleted file mode 100644 index bb0da57..0000000 --- a/pubcraft/templates/configmap.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Release.Name }} -data: - eula.txt: | - eula=true - server.properties: | - max-tick-time=60000 - generator-settings= - force-gamemode=false - allow-nether=true - gamemode=0 - broadcast-console-to-ops=true - enable-query=false - player-idle-timeout=0 - difficulty=3 - spawn-monsters=true - op-permission-level=4 - pvp=true - snooper-enabled=true - level-type=default - hardcore=false - enable-command-block=false - max-players=20 - network-compression-threshold=256 - resource-pack-sha1= - max-world-size=29999984 - server-port=25565 - server-ip= - spawn-npcs=true - allow-flight=true - level-name=world - view-distance=32 - resource-pack= - spawn-animals=true - white-list=true - generate-structures=true - online-mode=true - max-build-height=256 - level-seed= - prevent-proxy-connections=false - use-native-transport=true - motd=This is gonna be interesting - enable-rcon=false \ No newline at end of file diff --git a/pubcraft/templates/deploy.yaml b/pubcraft/templates/deploy.yaml deleted file mode 100644 index e55fce7..0000000 --- a/pubcraft/templates/deploy.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Release.Name }} -spec: - selector: - matchLabels: - app: {{ .Release.Name }} - template: - metadata: - labels: - app: {{ .Release.Name }} - spec: - containers: - - name: {{ .Release.Name }} - image: {{ .Values.image }} - ports: - - containerPort: 25565 - volumeMounts: - - mountPath: /mc_data - name: data - - name: properties - mountPath: /mc_data/server.properties - subPath: server.properties - - name: properties - mountPath: /mc_data/eula.txt - subPath: eula.txt - tty: true - stdin: true - env: - - name: MAX_RAM - value: "4" - - name: MIN_RAM - value: "1" - - name: THREADS - value: "4" - resources: - requests: - memory: "2Gi" - cpu: 250m - limits: - memory: "8Gi" - cpu: "4" - volumes: - - name: data - persistentVolumeClaim: - claimName: {{ .Release.Name }} - - name: properties - configMap: - name: {{ .Release.Name }} \ No newline at end of file diff --git a/pubcraft/templates/service.yaml b/pubcraft/templates/service.yaml deleted file mode 100644 index eade03e..0000000 --- a/pubcraft/templates/service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Release.Name }} -spec: - selector: - app: {{ .Release.Name }} - ports: - - port: {{ .Values.port }} - targetPort: 25565 - name: {{ .Release.Name }} - type: LoadBalancer \ No newline at end of file diff --git a/pubcraft/values.yaml b/pubcraft/values.yaml deleted file mode 100644 index c928899..0000000 --- a/pubcraft/values.yaml +++ /dev/null @@ -1,2 +0,0 @@ -image: hub.ducoterra.net/ducoterra/minecraft:1.16.1_2 -port: 20100 \ No newline at end of file diff --git a/testcraft/.helmignore b/testcraft/.helmignore deleted file mode 100644 index 0e8a0eb..0000000 --- a/testcraft/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/testcraft/Chart.yaml b/testcraft/Chart.yaml deleted file mode 100644 index 52c1320..0000000 --- a/testcraft/Chart.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v2 -name: charts -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 1.16.0 diff --git a/testcraft/templates/configmap.yaml b/testcraft/templates/configmap.yaml deleted file mode 100644 index b132e07..0000000 --- a/testcraft/templates/configmap.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Release.Name }} -data: - eula.txt: | - eula=true - server.properties: | - max-tick-time=60000 - generator-settings= - force-gamemode=false - allow-nether=true - gamemode=0 - broadcast-console-to-ops=true - enable-query=false - player-idle-timeout=0 - difficulty=3 - spawn-monsters=true - op-permission-level=4 - pvp=true - snooper-enabled=true - level-type=amplified - hardcore=false - enable-command-block=false - max-players=20 - network-compression-threshold=256 - resource-pack-sha1= - max-world-size=29999984 - server-port=25565 - server-ip= - spawn-npcs=true - allow-flight=true - level-name=world - view-distance=32 - resource-pack= - spawn-animals=true - white-list=true - generate-structures=true - online-mode=true - max-build-height=512 - level-seed= - prevent-proxy-connections=false - use-native-transport=true - motd=This is gonna be interesting - enable-rcon=false \ No newline at end of file diff --git a/testcraft/templates/pvc.yaml b/testcraft/templates/pvc.yaml deleted file mode 100644 index c0bccd5..0000000 --- a/testcraft/templates/pvc.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .Release.Name }} - annotations: - "helm.sh/resource-policy": keep -spec: - storageClassName: nvme - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 32Gi \ No newline at end of file diff --git a/testcraft/templates/service.yaml b/testcraft/templates/service.yaml deleted file mode 100644 index eade03e..0000000 --- a/testcraft/templates/service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Release.Name }} -spec: - selector: - app: {{ .Release.Name }} - ports: - - port: {{ .Values.port }} - targetPort: 25565 - name: {{ .Release.Name }} - type: LoadBalancer \ No newline at end of file diff --git a/testcraft/values.yaml b/testcraft/values.yaml deleted file mode 100644 index 7b1c687..0000000 --- a/testcraft/values.yaml +++ /dev/null @@ -1,2 +0,0 @@ -image: hub.ducoterra.net/ducoterra/minecraft:1.16.1_3 -port: 25566 \ No newline at end of file diff --git a/values-minecraft.yaml b/values-minecraft.yaml new file mode 100644 index 0000000..d608687 --- /dev/null +++ b/values-minecraft.yaml @@ -0,0 +1,42 @@ +image: hub.ducoterra.net/ducoterra/minecraft:1.16.4 +port: 25565 +max_ram: 8 +min_ram: 1 +server_props: | + max-tick-time=60000 + generator-settings= + force-gamemode=false + allow-nether=true + gamemode=0 + broadcast-console-to-ops=true + enable-query=false + player-idle-timeout=0 + difficulty=3 + spawn-monsters=true + op-permission-level=4 + pvp=true + snooper-enabled=true + level-type=default + hardcore=false + enable-command-block=false + max-players=20 + network-compression-threshold=256 + resource-pack-sha1= + max-world-size=29999984 + server-port=25565 + server-ip= + spawn-npcs=true + allow-flight=true + level-name=world + view-distance=32 + resource-pack= + spawn-animals=true + white-list=true + generate-structures=true + online-mode=true + max-build-height=256 + level-seed= + prevent-proxy-connections=false + use-native-transport=true + motd=This is gonna be interesting + enable-rcon=false \ No newline at end of file diff --git a/values-pubcraft.yaml b/values-pubcraft.yaml new file mode 100644 index 0000000..6285ae9 --- /dev/null +++ b/values-pubcraft.yaml @@ -0,0 +1,42 @@ +image: hub.ducoterra.net/ducoterra/minecraft:1.16.4 +port: 20100 +max_ram: 8 +min_ram: 1 +server_props: | + max-tick-time=60000 + generator-settings= + force-gamemode=false + allow-nether=true + gamemode=0 + broadcast-console-to-ops=true + enable-query=false + player-idle-timeout=0 + difficulty=3 + spawn-monsters=true + op-permission-level=4 + pvp=true + snooper-enabled=true + level-type=default + hardcore=false + enable-command-block=false + max-players=20 + network-compression-threshold=256 + resource-pack-sha1= + max-world-size=29999984 + server-port=25565 + server-ip= + spawn-npcs=true + allow-flight=true + level-name=world + view-distance=32 + resource-pack= + spawn-animals=true + white-list=true + generate-structures=true + online-mode=true + max-build-height=256 + level-seed= + prevent-proxy-connections=false + use-native-transport=true + motd=This is gonna be interesting + enable-rcon=false \ No newline at end of file diff --git a/values-testcraft.yaml b/values-testcraft.yaml new file mode 100644 index 0000000..b908a37 --- /dev/null +++ b/values-testcraft.yaml @@ -0,0 +1,42 @@ +image: hub.ducoterra.net/ducoterra/minecraft:1.16.4 +port: 25566 +max_ram: 8 +min_ram: 1 +server_props: | + max-tick-time=60000 + generator-settings= + force-gamemode=false + allow-nether=true + gamemode=0 + broadcast-console-to-ops=true + enable-query=false + player-idle-timeout=0 + difficulty=3 + spawn-monsters=true + op-permission-level=4 + pvp=true + snooper-enabled=true + level-type=amplified + hardcore=false + enable-command-block=false + max-players=20 + network-compression-threshold=256 + resource-pack-sha1= + max-world-size=29999984 + server-port=25565 + server-ip= + spawn-npcs=true + allow-flight=true + level-name=world + view-distance=32 + resource-pack= + spawn-animals=true + white-list=true + generate-structures=true + online-mode=true + max-build-height=512 + level-seed= + prevent-proxy-connections=false + use-native-transport=true + motd=This is gonna be interesting + enable-rcon=false \ No newline at end of file