Added local disk

This commit is contained in:
2023-06-29 22:04:37 +02:00
parent 09e21d9bf4
commit 87384c8b63
5 changed files with 54 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
variables:
HELM_CHART_VERSION: "0.6.12"
HELM_CHART_VERSION: "99.6.12"
stages:
- deploy

View File

@@ -29,12 +29,28 @@ spec:
- name: cloud
persistentVolumeClaim:
claimName: pvc-{{ include "..fullname" . }}
- name: cloud-local
persistentVolumeClaim:
claimName: pvc-{{ include "..fullname" . }}-local
- name: serverconfig
configMap:
name: {{ include "..fullname" . }}-cfg
imagePullSecrets:
- name: pull-secret
initContainers:
- name: init-storage
securityContext:
allowPrivilegeEscalation: false
runAsUser: 0
image: cloudyne/ubuntu-ci:latest
command: ["storage-clone"]
args: ["/full-cloud", "/full-cloud-local"]
imagePullPolicy: Always
volumeMounts:
- name: cloud
mountPath: /full-cloud
- name: cloud-local
mountPath: /full-cloud-local
- name: deploy
securityContext:
allowPrivilegeEscalation: false
@@ -49,14 +65,14 @@ spec:
subPath: init.json
{{- if .Values.storage.wpContent }}
{{- range $v := .Values.storage.wpContent }}
- name: cloud
- name: cloud-local
mountPath: "/app/web/app/{{ $v }}"
subPath: "{{ $v }}"
{{- end }}
{{- end }}
{{- if .Values.storage.additionalMounts }}
{{- range $v := .Values.storage.additionalMounts }}
- name: cloud
- name: cloud-local
mountPath: {{ $v.localPath }}
subPath: {{ $v.cloudPath }}
{{- end }}
@@ -81,14 +97,14 @@ spec:
subPath: unit.json
{{- if .Values.storage.wpContent }}
{{- range $v := .Values.storage.wpContent }}
- name: cloud
- name: cloud-local
mountPath: "/app/web/app/{{ $v }}"
subPath: "{{ $v }}"
{{- end }}
{{- end }}
{{- if .Values.storage.additionalMounts }}
{{- range $v := .Values.storage.additionalMounts }}
- name: cloud
- name: cloud-local
mountPath: {{ $v.localPath }}
subPath: {{ $v.cloudPath }}
{{- end }}

View File

@@ -35,4 +35,18 @@ spec:
persistentVolumeReclaimPolicy: Retain
storageClassName: {{ .Values.storage.class | default "premium01" }}-retain
volumeMode: Filesystem
---
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-{{ include "..fullname" }}-local
labels:
{{- include "..labels" . | nindent 8 }}
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: {{ .Values.site.resources.disk | default "5Gi" }}
persistentVolumeReclaimPolicy: Retain
storageClassName: "longhorn"
volumeMode: Filesystem

View File

@@ -19,4 +19,20 @@ spec:
{{- if and .Values.storage .Values.storage.class }}
storageClassName: {{ .Values.storage.class | default "premium01" }}-retain
{{- end }}
{{- end }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
{{- include "..labels" . | nindent 8 }}
name: pvc-{{ include "..fullname" . }}-local
spec:
volumeMode: Filesystem
volumeName: pv-{{ include "..fullname" }}-local
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.site.resources.disk | default "5Gi" }}
storageClassName: "longhorn"

View File

@@ -37,7 +37,7 @@ database:
# Storage Settings
storage:
# The storage class to use for the site
# The storage class used for the cloud part of the storage
# Default: premium01
class: "premium01"