Skip to content

Instantly share code, notes, and snippets.

@kerus1024
Created July 23, 2022 14:35
Show Gist options
  • Save kerus1024/db84e65a1c5c09eca2e1e3032a2327f3 to your computer and use it in GitHub Desktop.
Save kerus1024/db84e65a1c5c09eca2e1e3032a2327f3 to your computer and use it in GitHub Desktop.
Kubernetes (K8S) Standalone Node : Use Local-Path Provisioner

local-path provisioner

https://github.com/rancher/local-path-provisioner

SC 생성

kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/v0.0.22/deploy/local-path-storage.yaml

PVC 생성

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: local-path-pvc
  namespace: default
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: local-path
  resources:
    requests:
      storage: 10Gi

sample pod

apiVersion: v1
kind: Pod
metadata:
  name: volume-test
  namespace: default
spec:
  containers:
  - name: volume-test
    image: nginx:stable-alpine
    imagePullPolicy: IfNotPresent
    volumeMounts:
    - name: volv
      mountPath: /data
    ports:
    - containerPort: 80
  volumes:
  - name: volv
    persistentVolumeClaim:
      claimName: local-path-pvc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment