apiVersion: v1
kind: PersistentVolume
metadata:
  name: code-pv
  labels:
    pv: code-pv
spec:
  storageClassName: manual
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/laravel-bjyblog/site"

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: code-pvc
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  selector:
    matchLabels:
      pv: code-pv

---

apiVersion: v1
kind: PersistentVolume
metadata:
  name: mysql-pv
  labels:
    pv: mysql-pv
spec:
  storageClassName: manual
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/laravel-bjyblog/mysql"

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mysql-pvc
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  selector:
    matchLabels:
      pv: mysql-pv

---

apiVersion: v1
kind: PersistentVolume
metadata:
  name: backup-pv
  labels:
    pv: backup-pv
spec:
  storageClassName: manual
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/laravel-bjyblog/backup"

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: backup-pvc
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
  selector:
    matchLabels:
      pv: backup-pv

{{- if .Values.prometheus.enabled }}
---

apiVersion: v1
kind: PersistentVolume
metadata:
  name: prometheus-pv
  labels:
    pv: prometheus-pv
spec:
  storageClassName: manual
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/laravel-bjyblog/prometheus"

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: prometheus-pvc
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  selector:
    matchLabels:
      pv: prometheus-pv
{{- end }}

{{- if .Values.grafana.enabled }}
---

apiVersion: v1
kind: PersistentVolume
metadata:
  name: grafana-pv
  labels:
    pv: grafana-pv
spec:
  storageClassName: manual
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/laravel-bjyblog/grafana"

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: grafana-pvc
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  selector:
    matchLabels:
      pv: grafana-pv
{{- end }}

{{- if .Values.elasticsearch.enabled }}
---

apiVersion: v1
kind: PersistentVolume
metadata:
  name: elasticsearch-pv
  labels:
    pv: elasticsearch-pv
spec:
  storageClassName: manual
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/laravel-bjyblog/elasticsearch"

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: elasticsearch-pvc
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  selector:
    matchLabels:
      pv: elasticsearch-pv
{{- end }}
