Skip to content

Commit

Permalink
feat(persistence):
Browse files Browse the repository at this point in the history
- remove config files feature
- five option to persists server files
  • Loading branch information
joaop221 committed Jul 19, 2024
1 parent 78298ec commit 1fc5ab2
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 71 deletions.
2 changes: 1 addition & 1 deletion charts/v-rising/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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.10.5
version: 0.11.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
Expand Down
20 changes: 0 additions & 20 deletions charts/v-rising/templates/configmap-files.yaml

This file was deleted.

37 changes: 12 additions & 25 deletions charts/v-rising/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ spec:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/configfiles: {{ include (print $.Template.BasePath "/configmap-files.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
Expand All @@ -30,24 +29,6 @@ spec:
serviceAccountName: {{ include "v-rising.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if or .Values.configfiles.ServerGameSettings .Values.configfiles.adminlist .Values.configfiles.banlist }}
initContainers:
- name: {{ .Chart.Name }}-permissions
image: busybox:1.36.1
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["sh"]
args:
- -c
- mkdir -p /vrising/server/VRisingServer_Data/StreamingAssets/Settings/;
- cp -ra /vrising/temp/* /vrising/server/VRisingServer_Data/StreamingAssets/Settings;
- "chown -R {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.runAsGroup }} /vrising/server"
- "chmod -R 0777 /vrising/server"
volumeMounts:
- mountPath: /vrising/server
name: v-server
- name: v-config-files
mountPath: /vrising/temp/
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down Expand Up @@ -89,21 +70,27 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: v-server
{{- if .Values.persistence.server.enabled }}
persistentVolumeClaim:
{{- if .Values.persistence.server.existingClaim }}
claimName: {{ .Values.persistence.server.existingClaim }}
{{- else }}
claimName: {{ include "v-rising.fullname" . }}-server
{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
- name: v-data
{{- if .Values.persistence.enabled }}
{{- if .Values.persistence.data.enabled }}
persistentVolumeClaim:
{{- if .Values.persistence.existingClaim }}
claimName: {{ .Values.persistence.existingClaim }}
{{- if .Values.persistence.data.existingClaim }}
claimName: {{ .Values.persistence.data.existingClaim }}
{{- else }}
claimName: {{ include "v-rising.fullname" . }}
{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
- name: v-config-files
configMap:
name: {{ include "v-rising.fullname" . }}-files
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
15 changes: 15 additions & 0 deletions charts/v-rising/templates/pvc-data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and (.Values.persistence.data).enabled (not .Values.persistence.data.existingClaim) -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "v-rising.fullname" . }}
labels:
{{- include "v-rising.labels" . | nindent 4 }}
spec:
storageClassName: {{ .Values.persistence.data.storageClass }}
accessModes:
- {{ .Values.persistence.data.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.data.size | quote }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/v-rising/templates/pvc-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and (.Values.persistence.server).enabled (not .Values.persistence.server.existingClaim) -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "v-rising.fullname" . }}-server
labels:
{{- include "v-rising.labels" . | nindent 4 }}
spec:
storageClassName: {{ .Values.persistence.server.storageClass }}
accessModes:
- {{ .Values.persistence.server.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.server.size | quote }}
{{- end }}
15 changes: 0 additions & 15 deletions charts/v-rising/templates/pvc.yaml

This file was deleted.

22 changes: 12 additions & 10 deletions charts/v-rising/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,18 @@ ingressRoute:
resources: {}

persistence:
enabled: true
existingClaim: ""
storageClass: ""
accessMode: "ReadWriteOnce"
size: 10Gi
data:
enabled: true
existingClaim: ""
storageClass: ""
accessMode: "ReadWriteOnce"
size: 10Gi
server:
enabled: false
existingClaim: ""
storageClass: ""
accessMode: "ReadWriteOnce"
size: 10Gi

config:
TZ: America/Sao_Paulo
Expand All @@ -79,11 +86,6 @@ config:
VR_SAVE_COUNT: "1"
VR_SAVE_INTERVAL: "300"

configfiles:
adminlist: []
banlist: []
ServerGameSettings: ""

secrets:
VR_PASSWORD: ""

Expand Down

0 comments on commit 1fc5ab2

Please sign in to comment.