home-pvc.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {{- if not (contains "jenkins-home" (quote .Values.persistence.volumes)) }}
  2. {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
  3. kind: PersistentVolumeClaim
  4. apiVersion: v1
  5. metadata:
  6. {{- if .Values.persistence.annotations }}
  7. annotations:
  8. {{ toYaml .Values.persistence.annotations | indent 4 }}
  9. {{- end }}
  10. name: {{ template "jenkins.fullname" . }}
  11. namespace: {{ template "jenkins.namespace" . }}
  12. labels:
  13. "app.kubernetes.io/name": '{{ template "jenkins.name" .}}'
  14. {{- if .Values.renderHelmLabels }}
  15. "helm.sh/chart": "{{ template "jenkins.label" .}}"
  16. {{- end }}
  17. "app.kubernetes.io/managed-by": "{{ .Release.Service }}"
  18. "app.kubernetes.io/instance": "{{ .Release.Name }}"
  19. "app.kubernetes.io/component": "{{ .Values.controller.componentName }}"
  20. {{- if .Values.persistence.labels }}
  21. {{ toYaml .Values.persistence.labels | indent 4 }}
  22. {{- end }}
  23. spec:
  24. {{- if .Values.persistence.dataSource }}
  25. dataSource:
  26. {{ toYaml .Values.persistence.dataSource | indent 4 }}
  27. {{- end }}
  28. accessModes:
  29. - {{ .Values.persistence.accessMode | quote }}
  30. resources:
  31. requests:
  32. storage: {{ .Values.persistence.size | quote }}
  33. {{- if .Values.persistence.storageClass }}
  34. {{- if (eq "-" .Values.persistence.storageClass) }}
  35. storageClassName: ""
  36. {{- else }}
  37. storageClassName: "{{ .Values.persistence.storageClass }}"
  38. {{- end }}
  39. {{- end }}
  40. {{- end }}
  41. {{- end }}