K8s/Storage: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Created page with "==References== {| |valign='top'| * K8s » CSI Hostpath Driver * K8s » Swiss Knife * K8s » Ingress * K8s » Service * K8s » Run |valign='top'| |valign='top'| |- |colspan='3'| ---- |- |valign='top'| * Helm » GitLab » External * Helm » PostgreSQL * Helm » MariaDB * Helm » GitLab * Helm/Redis|He..."
 
No edit summary
Line 1: Line 1:
==Storage » Class » Hostpath==
<syntaxhighlight lang="yaml" highlight="6-8" line>
cat <<'YML'| kubectl apply -f -
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: hostpath
provisioner: k8s.io/minikube-hostpath
reclaimPolicy: Retain
volumeBindingMode: Immediate
YML
</syntaxhighlight>
==Storage » Persistent Volume==
<syntaxhighlight lang="yaml" highlight="13-15" line>
cat <<'YML'| kubectl apply -f -
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: mariadb-mariadb-0
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: hostpath
  hostPath:
    path: /var/hostpath_pv/mariadb/mariadb-0
    type: DirectoryOrCreate
YML
</syntaxhighlight>
==References==
==References==
{|
{|

Revision as of 08:23, 11 June 2025

Storage » Class » Hostpath

cat <<'YML'| kubectl apply -f -
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: hostpath
provisioner: k8s.io/minikube-hostpath
reclaimPolicy: Retain
volumeBindingMode: Immediate
YML

Storage » Persistent Volume

cat <<'YML'| kubectl apply -f -
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: mariadb-mariadb-0
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: hostpath
  hostPath:
    path: /var/hostpath_pv/mariadb/mariadb-0
    type: DirectoryOrCreate
YML

References