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

2번째 줄: 2번째 줄:
;k8s hostPath
;k8s hostPath


<syntaxhighlight lang='yaml'>
<syntaxhighlight lang='yaml' line highlight='14'>
apiVersion: v1
apiVersion: v1
kind: Pod
kind: Pod
22번째 줄: 22번째 줄:
       type: Directory
       type: Directory
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang='yaml'>
<syntaxhighlight lang='yaml' line highlight='16,21'>
apiVersion: v1
apiVersion: v1
kind: Pod
kind: Pod

2022년 4월 2일 (토) 17:00 판

1 개요

k8s hostPath
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

2 같이 보기

3 참고

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