Skip to content

Commit

Permalink
Beginn with pvc mounting via storage class
Browse files Browse the repository at this point in the history
  • Loading branch information
Skaronator committed Jun 24, 2023
1 parent 57b1295 commit 4dcab86
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
16 changes: 13 additions & 3 deletions .charts/generic-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ metadata:
labels:
{{- include "generic-service.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
replicas: {{ .Values.replicas }}
revisionHistoryLimit: 3
strategy:
type: {{ .Values.strategyType }}
selector:
Expand Down Expand Up @@ -65,7 +66,7 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 10 }}
{{- if or .Values.configMaps .Values.hostPaths }}
{{- if or .Values.configMaps .Values.hostPaths .Values.pvcPaths }}
volumeMounts:
{{- range .Values.configMaps }}
- name: config
Expand All @@ -77,8 +78,12 @@ spec:
mountPath: {{ .containerPath | quote }}
readOnly: {{ .readOnly | default false }}
{{- end }}
{{- range .Values.pvcPaths }}
- name: {{ .name }}
mountPath: {{ .path | quote }}
{{- end }}
{{- end -}}
{{- if or .Values.configMaps .Values.hostPaths }}
{{- if or .Values.configMaps .Values.hostPaths .Values.pvcPaths }}
volumes:
{{- if .Values.configMaps }}
- name: config
Expand All @@ -91,6 +96,11 @@ spec:
path: {{ .hostPath | quote }}
type: {{ .type | default "DirectoryOrCreate" }}
{{- end }}
{{- range .Values.pvcPaths }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ include "generic-service.name" $ }}-{{ .name }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
13 changes: 13 additions & 0 deletions .charts/generic-service/templates/persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ range .Values.pvcPaths }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "generic-service.name" $ }}-{{ .name }}
spec:
storageClassName: {{ .class }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Mi
{{ end }}
6 changes: 5 additions & 1 deletion .charts/generic-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1
replicas: 1

image:
repository: ""
Expand Down Expand Up @@ -83,3 +83,7 @@ hostPaths: []
# readOnly: false
# type: "DirectoryOrCreate"

pvcPaths: []
# - name: ""
# class: ""
# path: ""
5 changes: 5 additions & 0 deletions crypto/monero-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ hostPaths:
hostPath: /srv/nvme/scrap-data/monero
containerPath: /root/.bitmonero

# pvcPaths:
# - name: data
# class: scrap-data
# path: /root/.bitmonero

ports:
- name: main
containerPort: 18089
Expand Down

0 comments on commit 4dcab86

Please sign in to comment.