Closed5

【k3d】永続ボリューム

not75743not75743
k3d-config.yaml
apiVersion: k3d.io/v1alpha5
// 略
volumes:
  - volume: /storage/test:/storage/test
    nodeFilters:
      - server:0
      - agent:*

ホスト:/storage/test
ノード:/storage/test

not75743not75743
pv-test.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  name: task-pv-volume
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/storage/test"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: task-pv-claim
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: echo
spec:
  selector:
    matchLabels:
      app: echo
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: echo
    spec:
      volumes:
        - name: task-pv-storage
          persistentVolumeClaim:
            claimName: task-pv-claim
      containers:
      - image: busybox
        name: echo
        volumeMounts:
          - mountPath: "/data"
            name: task-pv-storage
        command: ["ping", "127.0.0.1"]

pvで上述のパスを入力すること

not75743not75743

できなかった、深追いはしない
NFS使うのがいいのかね

ローカルだしstatic provisioningで頑張る

このスクラップは2ヶ月前にクローズされました