Skip to content

Commit

Permalink
Merge branch 'master' into statefulset
Browse files Browse the repository at this point in the history
  • Loading branch information
danielr1996 authored Sep 23, 2023
2 parents d3cbdef + 890cd55 commit 0a731a7
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Lint and Test Charts

on: pull_request


jobs:
lint-test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -35,14 +36,13 @@ jobs:
run: ct lint

- name: Create kind cluster
uses: helm/kind-action@v1.2.0
uses: helm/kind-action@v1.8.0
if: steps.list-changed.outputs.changed == 'true'

- name: Install LoadBalancer
run: |-
kubectl config use-context kind-chart-testing
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.12.1/manifests/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.12.1/manifests/metallb.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml
kubectl apply -f .github/metallb-configmap.yaml
- name: Run chart-testing (install)
Expand Down
13 changes: 13 additions & 0 deletions charts/minecraft-bedrock/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,16 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "extraDeploy.render" -}}
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
{{- if contains "{{" (toJson .value) }}
{{- if .scope }}
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
{{- else }}
{{- tpl $value .context }}
{{- end }}
{{- else }}
{{- $value }}
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/minecraft-bedrock/templates/extra-list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraDeploy }}
---
{{ include "extraDeploy.render" (dict "value" . "context" $) }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/minecraft-bedrock/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ initContainers: []
# - vers=4
extraVolumes: []

## Array of extra objects to deploy with the release
##
# extraDeploy:
# - |
# apiVersion: v1
# kind: ConfigMap
# metadata:
# name: {{ template "minecraft.fullname" . }}-extra-cm
# data:
# key: |-
# {
# "key": "value"
# }
extraDeploy: []

minecraftServer:
# This must be overridden, since we can't accept this for the user.
eula: "FALSE"
Expand Down
15 changes: 14 additions & 1 deletion charts/minecraft/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,17 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
- name: {{ index . 0 }}
value: {{ index . 1 | quote }}
{{- end }}
{{- end }}
{{- end }}

{{- define "extraDeploy.render" -}}
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
{{- if contains "{{" (toJson .value) }}
{{- if .scope }}
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
{{- else }}
{{- tpl $value .context }}
{{- end }}
{{- else }}
{{- $value }}
{{- end }}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/minecraft/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ spec:
{{- if .Values.lifecycle.preStop }}
preStop:
exec:
command: {{- range .Values.lifecycle.postStart }}
command: {{- range .Values.lifecycle.preStop }}
- {{ . }}
{{- end }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions charts/minecraft/templates/extra-list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraDeploy }}
---
{{ include "extraDeploy.render" (dict "value" . "context" $) }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/minecraft/templates/extraports-ing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ metadata:
chart: "{{ $.Chart.Name }}-{{ $.Chart.Version }}"
release: "{{ $.Release.Name }}"
heritage: "{{ $.Release.Service }}"
app.kubernetes.io/name: "{{ .Chart.Name }}"
app.kubernetes.io/name: "{{ $.Chart.Name }}"
app.kubernetes.io/instance: {{ $minecraftFullname }}
app.kubernetes.io/version: "{{ .Chart.Version }}"
app.kubernetes.io/version: "{{ $.Chart.Version }}"
spec:
{{- if .ingress.ingressClassName }}
ingressClassName: {{ .ingress.ingressClassName }}
Expand Down
4 changes: 2 additions & 2 deletions charts/minecraft/templates/extraports-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ metadata:
chart: "{{ $.Chart.Name }}-{{ $.Chart.Version }}"
release: "{{ $.Release.Name }}"
heritage: "{{ $.Release.Service }}"
app.kubernetes.io/name: "{{ .Chart.Name }}"
app.kubernetes.io/name: "{{ $.Chart.Name }}"
app.kubernetes.io/instance: {{ $minecraftFullname }}
app.kubernetes.io/version: "{{ .Chart.Version }}"
app.kubernetes.io/version: "{{ $.Chart.Version }}"
spec:
{{- if (or (eq .service.type "ClusterIP") (empty .service.type)) }}
type: ClusterIP
Expand Down
3 changes: 3 additions & 0 deletions charts/minecraft/templates/minecraft-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.minecraftServer.extraServiceSpec }}
{{ toYaml .Values.minecraftServer.extraServiceSpec | indent 2 }}
{{- end }}
19 changes: 19 additions & 0 deletions charts/minecraft/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,22 @@ sidecarContainers: []
# - vers=4
extraVolumes: []


## Array of extra objects to deploy with the release
##
# extraDeploy:
# - |
# apiVersion: v1
# kind: ConfigMap
# metadata:
# name: {{ template "minecraft.fullname" . }}-extra-cm
# data:
# key: |-
# {
# "key": "value"
# }
extraDeploy: []

minecraftServer:
# This must be overridden, since we can't accept this for the user.
eula: "FALSE"
Expand Down Expand Up @@ -247,6 +263,9 @@ minecraftServer:
# A list of Spigot resources/plugins IDs to download.
spigetResources: []

# Additional service specs to be defined
extraServiceSpec: {}

# A list of Modrinth project slugs with optional version after colon
modrinth:
projects: []
Expand Down

0 comments on commit 0a731a7

Please sign in to comment.