Phase 3b: PVC dataSource + storageClassName plumbing (#347)
This commit is contained in:
@@ -6,6 +6,25 @@ metadata:
|
||||
{{- include "instance.labels" . | nindent 4 }}
|
||||
spec:
|
||||
accessModes: [ReadWriteOnce]
|
||||
{{- if .Values.instance.storageClassName }}
|
||||
# Tower stamps storageClassName when the destination cluster has
|
||||
# Longhorn (or another snapshot-capable CSI). Empty here means
|
||||
# bind to the cluster's default StorageClass — k3s default is
|
||||
# local-path which doesn't support snapshots, so spawn-env /
|
||||
# Refresh ↓ on those instances falls back to the S3 path.
|
||||
# ADR 0003 phase 6.
|
||||
storageClassName: {{ .Values.instance.storageClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if and .Values.instance.dataSource .Values.instance.dataSource.filestore .Values.instance.dataSource.filestore.snapshotName }}
|
||||
# Seed from VolumeSnapshot — Tower's VolumeClone path for
|
||||
# spawn-env / Refresh ↓ (ADR 0003 phase 3+4). The snapshot must
|
||||
# exist in the same namespace before this PVC is provisioned;
|
||||
# Tower creates it before triggering the chart sync.
|
||||
dataSource:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: {{ .Values.instance.dataSource.filestore.snapshotName | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ include "instance.storage" (dict "Values" .Values "layer" "filestore") | quote }}
|
||||
|
||||
@@ -64,6 +64,18 @@ spec:
|
||||
name: pgdata
|
||||
spec:
|
||||
accessModes: [ReadWriteOnce]
|
||||
{{- if .Values.instance.storageClassName }}
|
||||
storageClassName: {{ .Values.instance.storageClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if and .Values.instance.dataSource .Values.instance.dataSource.database .Values.instance.dataSource.database.snapshotName }}
|
||||
# Seed from VolumeSnapshot — Tower's VolumeClone path
|
||||
# (ADR 0003 phase 3+4). The snapshot is taken from the
|
||||
# source instance's `pgdata-<source>-pg-0` PVC.
|
||||
dataSource:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: {{ .Values.instance.dataSource.database.snapshotName | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ include "instance.storage" (dict "Values" .Values "layer" "database") | quote }}
|
||||
|
||||
Reference in New Issue
Block a user