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: variables:
HELM_CHART_VERSION: "0.6.12" HELM_CHART_VERSION: "99.6.12"
stages: stages:
- deploy - deploy

View File

@@ -29,12 +29,28 @@ spec:
- name: cloud - name: cloud
persistentVolumeClaim: persistentVolumeClaim:
claimName: pvc-{{ include "..fullname" . }} claimName: pvc-{{ include "..fullname" . }}
- name: cloud-local
persistentVolumeClaim:
claimName: pvc-{{ include "..fullname" . }}-local
- name: serverconfig - name: serverconfig
configMap: configMap:
name: {{ include "..fullname" . }}-cfg name: {{ include "..fullname" . }}-cfg
imagePullSecrets: imagePullSecrets:
- name: pull-secret - name: pull-secret
initContainers: 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 - name: deploy
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
@@ -49,14 +65,14 @@ spec:
subPath: init.json subPath: init.json
{{- if .Values.storage.wpContent }} {{- if .Values.storage.wpContent }}
{{- range $v := .Values.storage.wpContent }} {{- range $v := .Values.storage.wpContent }}
- name: cloud - name: cloud-local
mountPath: "/app/web/app/{{ $v }}" mountPath: "/app/web/app/{{ $v }}"
subPath: "{{ $v }}" subPath: "{{ $v }}"
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if .Values.storage.additionalMounts }} {{- if .Values.storage.additionalMounts }}
{{- range $v := .Values.storage.additionalMounts }} {{- range $v := .Values.storage.additionalMounts }}
- name: cloud - name: cloud-local
mountPath: {{ $v.localPath }} mountPath: {{ $v.localPath }}
subPath: {{ $v.cloudPath }} subPath: {{ $v.cloudPath }}
{{- end }} {{- end }}
@@ -81,14 +97,14 @@ spec:
subPath: unit.json subPath: unit.json
{{- if .Values.storage.wpContent }} {{- if .Values.storage.wpContent }}
{{- range $v := .Values.storage.wpContent }} {{- range $v := .Values.storage.wpContent }}
- name: cloud - name: cloud-local
mountPath: "/app/web/app/{{ $v }}" mountPath: "/app/web/app/{{ $v }}"
subPath: "{{ $v }}" subPath: "{{ $v }}"
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if .Values.storage.additionalMounts }} {{- if .Values.storage.additionalMounts }}
{{- range $v := .Values.storage.additionalMounts }} {{- range $v := .Values.storage.additionalMounts }}
- name: cloud - name: cloud-local
mountPath: {{ $v.localPath }} mountPath: {{ $v.localPath }}
subPath: {{ $v.cloudPath }} subPath: {{ $v.cloudPath }}
{{- end }} {{- end }}

View File

@@ -35,4 +35,18 @@ spec:
persistentVolumeReclaimPolicy: Retain persistentVolumeReclaimPolicy: Retain
storageClassName: {{ .Values.storage.class | default "premium01" }}-retain storageClassName: {{ .Values.storage.class | default "premium01" }}-retain
volumeMode: Filesystem 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 }} {{- if and .Values.storage .Values.storage.class }}
storageClassName: {{ .Values.storage.class | default "premium01" }}-retain 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 Settings
storage: storage:
# The storage class to use for the site # The storage class used for the cloud part of the storage
# Default: premium01 # Default: premium01
class: "premium01" class: "premium01"