Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[stable/factorio] Update to the recommended pvc patterns. (#442)
Browse files Browse the repository at this point in the history
* Convert chart factorio to use the recommended pvc patterns

* Update mods-pvc.yaml

* Update saves-pvc.yaml

* Update Chart.yaml

* Update _helpers.tpl
  • Loading branch information
AmandaCameron authored and prydonius committed Jan 28, 2017
1 parent f5e826a commit 5baa7c5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion stable/factorio/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: factorio
version: 0.1.2
version: 0.1.3
description: Factorio dedicated server.
keywords:
- game
Expand Down
6 changes: 3 additions & 3 deletions stable/factorio/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
6 changes: 5 additions & 1 deletion stable/factorio/templates/mods-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
{{- if .Values.persistence.storageClass }}
volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
{{- else }}
volume.alpha.kubernetes.io/storage-class: default
{{- end }}
spec:
accessModes:
- ReadWriteOnce
Expand Down
6 changes: 5 additions & 1 deletion stable/factorio/templates/saves-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
{{- if .Values.persistence.storageClass }}
volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
{{- else }}
volume.alpha.kubernetes.io/storage-class: default
{{- end }}
spec:
accessModes:
- ReadWriteOnce
Expand Down
5 changes: 4 additions & 1 deletion stable/factorio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ factorio:
password: your.password

persistence:
storageClass: generic
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
## Default: volume.alpha.kubernetes.io/storage-class: default
##
# storageClass:
savedGames:
# Set this to false if you don't care to persist saved games between restarts.
enabled: true
Expand Down

0 comments on commit 5baa7c5

Please sign in to comment.