Skip to content

Commit

Permalink
Update osmcha db helm template
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Sep 11, 2023
1 parent b720b2f commit 0310df9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
33 changes: 23 additions & 10 deletions osm-seed/templates/osmcha-db/osmcha-db-pd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ metadata:
name: {{ .Release.Name }}-osmcha-db-pv
labels:
app: {{ template "osm-seed.name" . }}
component: osmcha-db-pd
component: db-osmcha-pv
environment: {{ .Values.environment }}
release: {{ .Release.Name }}
spec:
accessModes:
- ReadWriteOnce
############## Minikube ##############
{{- if eq .Values.cloudProvider "minikube" }}
storageClassName: local-storage
capacity:
storage: {{ .Values.osmchaDb.persistenceDisk.localVolumeSize }}
accessModes:
- ReadWriteOnce
hostPath:
path: {{ .Values.osmchaDb.persistenceDisk.localVolumeHostPath | quote }}
{{- end }}
Expand All @@ -26,8 +26,6 @@ spec:
storageClassName: ""
capacity:
storage: {{ .Values.osmchaDb.persistenceDisk.AWS_ElasticBlockStore_size }}
accessModes:
- ReadWriteOnce
awsElasticBlockStore:
volumeID: {{ .Values.osmchaDb.persistenceDisk.AWS_ElasticBlockStore_volumeID }}
fsType: ext4
Expand All @@ -38,20 +36,30 @@ spec:
storageClassName: ""
capacity:
storage: {{ .Values.osmchaDb.persistenceDisk.GCP_gcePersistentDisk_size }}
accessModes:
- ReadWriteOnce
gcePersistentDisk:
pdName: {{ .Values.osmchaDb.persistenceDisk.GCP_gcePersistentDisk_pdName }}
fsType: ext4
{{- end }}

############## Azure Provider ##############
{{- if eq .Values.cloudProvider "azure" }}
storageClassName: ""
capacity:
storage: {{ .Values.osmchaDb.persistenceDisk.AZURE_diskSize }}
persistentVolumeReclaimPolicy: Retain
azureDisk:
kind: Managed
diskName: {{ .Values.osmchaDb.persistenceDisk.AZURE_diskName }}
diskURI: {{ .Values.osmchaDb.persistenceDisk.AZURE_diskURI }}
{{- end }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}-osmcha-db-pv-claim
labels:
app: {{ template "osm-seed.name" . }}
component: db-pd
component: db-osmcha-pvc
environment: {{ .Values.environment }}
release: {{ .Release.Name }}
spec:
Expand All @@ -67,7 +75,7 @@ spec:
- ReadWriteOnce
resources:
requests:
############# Minikube ##############
############## Minikube ##############
{{- if eq .Values.cloudProvider "minikube" }}
storage: {{ .Values.osmchaDb.persistenceDisk.localVolumeSize }}
{{- end }}
Expand All @@ -81,5 +89,10 @@ spec:
{{- if eq .Values.cloudProvider "gcp" }}
storage: {{ .Values.osmchaDb.persistenceDisk.GCP_gcePersistentDisk_size }}
{{- end }}

############## AZURE Provider ##############
{{- if eq .Values.cloudProvider "azure" }}
storage: {{ .Values.osmchaDb.persistenceDisk.AZURE_diskSize }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
9 changes: 8 additions & 1 deletion osm-seed/templates/osmcha-db/osmcha-db-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ spec:
release: {{ .Release.Name }}
run: {{ .Release.Name }}-osmcha-db
spec:
# Remove lost+found in EBS disk
initContainers:
- name: remove-lost-found
image: busybox
command: ['sh', '-c', 'rm -rf /var/lib/postgresql/data/lost+found']
volumeMounts:
- name: postgres-storage
mountPath: /var/lib/postgresql/data
containers:
- name: {{ .Chart.Name }}-osmcha-db
image: "{{ .Values.osmchaDb.image.name }}:{{ .Values.osmchaDb.image.tag }}"
Expand Down Expand Up @@ -66,7 +74,6 @@ spec:
volumeMounts:
- name: postgres-storage
mountPath: {{ .Values.osmchaDb.persistenceDisk.mountPath }}
subPath: {{ .Values.osmchaDb.persistenceDisk.subPath }}
{{- if .Values.osmchaDb.resources.enabled }}
resources:
requests:
Expand Down

0 comments on commit 0310df9

Please sign in to comment.