"K8s hostPath"의 두 판 사이의 차이

잔글 (Jmnote님이 HostPath 문서를 K8s hostPath 문서로 이동했습니다)
 
(같은 사용자의 중간 판 5개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
{{소문자}}
;k8s hostPath
;k8s hostPath


==pod==
<syntaxhighlight lang='yaml' line highlight='14'>
<syntaxhighlight lang='yaml' line highlight='14'>
apiVersion: v1
apiVersion: v1
46번째 줄: 48번째 줄:
       path: /var/local/aaa/1.txt
       path: /var/local/aaa/1.txt
       type: FileOrCreate
       type: FileOrCreate
</syntaxhighlight>
==pv==
<syntaxhighlight lang='yaml' line highlight='10'>
apiVersion: v1
kind: PersistentVolume
metadata:
  name: example-pv
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /mnt/data
</syntaxhighlight>
</syntaxhighlight>


==같이 보기==
==같이 보기==
* [[k8s PV]]
* [[k8s Pod]]
* [[k8s 볼륨]]
* [[k8s 볼륨]]



2024년 6월 8일 (토) 01:11 기준 최신판

1 개요[ | ]

k8s hostPath

2 pod[ | ]

apiVersion: v1
kind: Pod
metadata:
  name: test-pd
spec:
  containers:
  - image: k8s.gcr.io/test-webserver
    name: test-container
    volumeMounts:
    - mountPath: /test-pd
      name: test-volume
  volumes:
  - name: test-volume
    hostPath:
      # directory location on host
      path: /data
      # this field is optional
      type: Directory
apiVersion: v1
kind: Pod
metadata:
  name: test-webserver
spec:
  containers:
  - name: test-webserver
    image: k8s.gcr.io/test-webserver:latest
    volumeMounts:
    - mountPath: /var/local/aaa
      name: mydir
    - mountPath: /var/local/aaa/1.txt
      name: myfile
  volumes:
  - name: mydir
    hostPath:
      # Ensure the file directory is created.
      path: /var/local/aaa
      type: DirectoryOrCreate
  - name: myfile
    hostPath:
      path: /var/local/aaa/1.txt
      type: FileOrCreate

3 pv[ | ]

apiVersion: v1
kind: PersistentVolume
metadata:
  name: example-pv
spec:
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: /mnt/data

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}