artifactory-nfs-pvc.yaml 2.69 KB
Newer Older
Joe Mayer's avatar
Joe Mayer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
{{- if eq .Values.artifactory.persistence.type "nfs" }}
### Artifactory HA data
apiVersion: v1
kind: PersistentVolume
metadata:
  name: {{ template "artifactory-ha.fullname" . }}-data-pv
  labels:
    app: {{ template "artifactory-ha.name" . }}
    chart: {{ template "artifactory-ha.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
    id: {{ template "artifactory-ha.name" . }}-data-pv
    type: nfs-volume
spec:
  capacity:
    storage: {{ .Values.artifactory.persistence.nfs.capacity }}
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  nfs:
    server: {{ .Values.artifactory.persistence.nfs.ip }}
    path: "{{ .Values.artifactory.persistence.nfs.haDataMount }}"
    readOnly: false
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ template "artifactory-ha.fullname" . }}-data-pvc
  labels:
    app: {{ template "artifactory-ha.name" . }}
    chart: {{ template "artifactory-ha.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
    type: nfs-volume
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: ""
  resources:
    requests:
      storage: {{ .Values.artifactory.persistence.nfs.capacity }}
  selector:
    matchLabels:
      id: {{ template "artifactory-ha.name" . }}-data-pv
      app: {{ template "artifactory-ha.name" . }}
      release: {{ .Release.Name }}
---
### Artifactory HA backup
apiVersion: v1
kind: PersistentVolume
metadata:
  name: {{ template "artifactory-ha.fullname" . }}-backup-pv
  labels:
    app: {{ template "artifactory-ha.name" . }}
    chart: {{ template "artifactory-ha.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
    id: {{ template "artifactory-ha.name" . }}-backup-pv
    type: nfs-volume
spec:
  capacity:
    storage: {{ .Values.artifactory.persistence.nfs.capacity }}
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  nfs:
    server: {{ .Values.artifactory.persistence.nfs.ip }}
    path: "{{ .Values.artifactory.persistence.nfs.haBackupMount }}"
    readOnly: false
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ template "artifactory-ha.fullname" . }}-backup-pvc
  labels:
    app: {{ template "artifactory-ha.name" . }}
    chart: {{ template "artifactory-ha.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
    type: nfs-volume
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: ""
  resources:
    requests:
      storage: {{ .Values.artifactory.persistence.nfs.capacity }}
  selector:
    matchLabels:
      id: {{ template "artifactory-ha.name" . }}-backup-pv
      app: {{ template "artifactory-ha.name" . }}
      release: {{ .Release.Name }}
{{- end }}