Skip to content

Commit e581c21

Browse files
committed
improve persistence config
1 parent 7da7733 commit e581c21

File tree

3 files changed

+111
-13
lines changed

3 files changed

+111
-13
lines changed

hosting/k8s/helm/README.md

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,15 @@ postgres:
219219
220220
## Persistence
221221
222-
All services support persistent storage and allow you to control the storage class globally or per service:
222+
All services support persistent storage and allow you to control the storage class globally or per service. Our internal services (Registry) now support the full Bitnami persistence configuration pattern:
223+
224+
### Basic Persistence Configuration
223225
224226
```yaml
225227
global:
226228
storageClass: "fast-ssd" # Default for all services
227229

230+
# Bitnami chart services (simplified configuration)
228231
postgres:
229232
primary:
230233
persistence:
@@ -250,22 +253,66 @@ s3:
250253
enabled: true
251254
size: 10Gi
252255
storageClass: "objectstore-ssd" # Optional: override for S3
256+
```
257+
258+
### Internal Services - Full Bitnami-Style Configuration
253259
260+
Our internal services (Registry) support the complete Bitnami persistence configuration pattern:
261+
262+
```yaml
263+
# Registry - Full persistence configuration options
254264
registry:
255265
persistence:
256266
enabled: true
267+
# Name to assign the volume
268+
volumeName: "data"
269+
# Name of an existing PVC to use
270+
existingClaim: ""
271+
# The path the volume will be mounted at
272+
mountPath: "/var/lib/registry"
273+
# The subdirectory of the volume to mount to
274+
subPath: ""
275+
# PVC Storage Class for Registry data volume
276+
storageClass: "registry-ssd"
277+
# PVC Access Mode for Registry volume
278+
accessModes:
279+
- "ReadWriteOnce"
280+
# PVC Storage Request for Registry volume
257281
size: 10Gi
258-
storageClass: "registry-ssd" # Optional: override for Registry
282+
# Annotations for the PVC
283+
annotations:
284+
backup.velero.io/backup-volumes: "data"
285+
# Labels for the PVC
286+
labels:
287+
app.kubernetes.io/component: "storage"
288+
# Selector to match an existing Persistent Volume
289+
selector:
290+
matchLabels:
291+
tier: "registry"
292+
# Custom PVC data source
293+
dataSource:
294+
name: "registry-snapshot"
295+
kind: "VolumeSnapshot"
296+
apiGroup: "snapshot.storage.k8s.io"
259297

260298
# Shared persistent volume for worker token file
261299
persistence:
262300
shared:
263301
enabled: true
264302
size: 5Mi
303+
accessMode: ReadWriteOnce
304+
# accessMode: ReadWriteMany # Use for cross-node deployment
305+
storageClass: ""
306+
retain: true # Prevents deletion on uninstall
265307
```
266308
267-
- If a per-service `storageClass` is set, it overrides the global value for that service only.
268-
- If neither is set, the cluster's default StorageClass is used.
309+
### Persistence Configuration Rules
310+
311+
- **Service-level storageClass** overrides the global value for that service only
312+
- **Global storageClass** applies to all services that don't specify their own
313+
- **Cluster default** is used if neither global nor service-level storageClass is set
314+
- **Internal services** (Registry) support full Bitnami-style configuration
315+
- **Bitnami chart services** use their respective chart's configuration patterns
269316
270317
## Monitoring
271318
@@ -517,13 +564,13 @@ helm upgrade --install trigger . \
517564
storageClass: "fast-nvme" # Default for all services
518565

519566
postgres:
520-
persistence:
521-
primary:
567+
primary:
568+
persistence:
522569
size: 500Gi
523570

524571
redis:
525-
persistence:
526-
master:
572+
master:
573+
persistence:
527574
size: 20Gi
528575

529576
clickhouse:
@@ -534,9 +581,14 @@ helm upgrade --install trigger . \
534581
persistence:
535582
size: 200Gi
536583

584+
# Internal services support full Bitnami-style configuration
537585
registry:
538586
persistence:
587+
enabled: true
539588
size: 100Gi
589+
storageClass: "registry-ssd"
590+
annotations:
591+
backup.velero.io/backup-volumes: "data"
540592
```
541593
542594
### 🏗️ High Availability (RECOMMENDED)

hosting/k8s/helm/templates/registry.yaml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@ spec:
7070
resources:
7171
{{- toYaml .Values.registry.resources | nindent 12 }}
7272
volumeMounts:
73-
- name: registry-data
74-
mountPath: /var/lib/registry
73+
- name: {{ .Values.registry.persistence.volumeName }}
74+
mountPath: {{ .Values.registry.persistence.mountPath }}
75+
{{- if .Values.registry.persistence.subPath }}
76+
subPath: {{ .Values.registry.persistence.subPath }}
77+
{{- end }}
7578
{{- if .Values.registry.auth.enabled }}
7679
- name: registry-auth
7780
mountPath: /auth
@@ -84,26 +87,45 @@ spec:
8487
secretName: {{ include "trigger-v4.fullname" . }}-registry-auth
8588
{{- end }}
8689
{{- if not .Values.registry.persistence.enabled }}
87-
- name: registry-data
90+
- name: {{ .Values.registry.persistence.volumeName }}
8891
emptyDir: {}
92+
{{- else if .Values.registry.persistence.existingClaim }}
93+
- name: {{ .Values.registry.persistence.volumeName }}
94+
persistentVolumeClaim:
95+
claimName: {{ .Values.registry.persistence.existingClaim }}
8996
{{- end }}
9097
{{- if .Values.registry.persistence.enabled }}
9198
volumeClaimTemplates:
9299
- metadata:
93-
name: registry-data
100+
name: {{ .Values.registry.persistence.volumeName }}
101+
{{- with .Values.registry.persistence.annotations }}
102+
annotations:
103+
{{- toYaml . | nindent 10 }}
104+
{{- end }}
94105
labels:
95106
{{- $component := "registry" }}
96107
{{- include "trigger-v4.componentLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "component" $component) | nindent 10 }}
108+
{{- with .Values.registry.persistence.labels }}
109+
{{- toYaml . | nindent 10 }}
110+
{{- end }}
97111
spec:
98112
accessModes:
99-
- ReadWriteOnce
113+
{{- toYaml .Values.registry.persistence.accessModes | nindent 10 }}
100114
resources:
101115
requests:
102116
storage: {{ .Values.registry.persistence.size }}
103117
{{- $storageClass := .Values.registry.persistence.storageClass | default .Values.global.storageClass }}
104118
{{- if $storageClass }}
105119
storageClassName: {{ $storageClass | quote }}
106120
{{- end }}
121+
{{- with .Values.registry.persistence.selector }}
122+
selector:
123+
{{- toYaml . | nindent 10 }}
124+
{{- end }}
125+
{{- with .Values.registry.persistence.dataSource }}
126+
dataSource:
127+
{{- toYaml . | nindent 10 }}
128+
{{- end }}
107129
{{- end }}
108130
---
109131
apiVersion: v1

hosting/k8s/helm/values.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,33 @@ registry:
439439
# runAsNonRoot: true
440440
# runAsUser: 1000
441441

442+
# Persistence configuration (Bitnami-style)
442443
persistence:
443444
enabled: true
445+
# Name to assign the volume
446+
volumeName: "data"
447+
# Name of an existing PVC to use
448+
existingClaim: ""
449+
# The path the volume will be mounted at
450+
mountPath: "/var/lib/registry"
451+
# The subdirectory of the volume to mount to
452+
subPath: ""
453+
# PVC Storage Class for Registry data volume
454+
storageClass: ""
455+
# PVC Access Mode for Registry volume
456+
accessModes:
457+
- "ReadWriteOnce"
458+
# PVC Storage Request for Registry volume
444459
size: 10Gi
460+
# Annotations for the PVC
461+
annotations: {}
462+
# Labels for the PVC
463+
labels: {}
464+
# Selector to match an existing Persistent Volume
465+
selector: {}
466+
# Custom PVC data source
467+
dataSource: {}
468+
445469
service:
446470
type: ClusterIP
447471
port: 5000

0 commit comments

Comments
 (0)