"K8s volumes configMap"의 두 판 사이의 차이

 
(같은 사용자의 중간 판 3개는 보이지 않습니다)
2번째 줄: 2번째 줄:
;K8s volumes configMap  
;K8s volumes configMap  


<syntaxhighlight lang='yaml'>
<syntaxhighlight lang='yaml' line highlight='15'>
apiVersion: v1
apiVersion: v1
kind: Pod
kind: Pod
16번째 줄: 16번째 줄:
         mountPath: /etc/config
         mountPath: /etc/config
   volumes:
   volumes:
    - name: config-volume
  - name: config-volume
      configMap:
    configMap:
        # Provide the name of the ConfigMap containing the files you want
      name: special-config
        # to add to the container
        name: special-config
   restartPolicy: Never
   restartPolicy: Never
</syntaxhighlight>
<syntaxhighlight lang='yaml' line highlight='15'>
apiVersion: v1
kind: Pod
metadata:
  name: dapi-test-pod
spec:
  containers:
    - name: test-container
      image: k8s.gcr.io/busybox
      command: [ "/bin/sh","-c","cat /etc/config/keys" ]
      volumeMounts:
      - name: config-volume
        mountPath: /etc/config
  volumes:
  - name: config-volume
    configMap:
      name: special-config
      items:
      - key: SPECIAL_LEVEL
        path: keys
</syntaxhighlight>
</syntaxhighlight>


==같이 보기==
==같이 보기==
* [[k8s volume]]
* [[k8s volume]]
* [[k8s configMap]]
* [[k8s ConfigMap]]


==참고==
==참고==
* https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#populate-a-volume-with-data-stored-in-a-configmap
* https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#populate-a-volume-with-data-stored-in-a-configmap
* https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#add-configmap-data-to-a-specific-path-in-the-volume


[[분류: k8s 볼륨]]
[[분류: k8s 볼륨]]
[[분류: k8s ConfigMap]]
[[분류: k8s ConfigMap]]

2021년 11월 17일 (수) 14:59 기준 최신판

1 개요[ | ]

K8s volumes configMap
apiVersion: v1
kind: Pod
metadata:
  name: dapi-test-pod
spec:
  containers:
    - name: test-container
      image: k8s.gcr.io/busybox
      command: [ "/bin/sh", "-c", "ls /etc/config/" ]
      volumeMounts:
      - name: config-volume
        mountPath: /etc/config
  volumes:
  - name: config-volume
    configMap:
      name: special-config
  restartPolicy: Never
apiVersion: v1
kind: Pod
metadata:
  name: dapi-test-pod
spec:
  containers:
    - name: test-container
      image: k8s.gcr.io/busybox
      command: [ "/bin/sh","-c","cat /etc/config/keys" ]
      volumeMounts:
      - name: config-volume
        mountPath: /etc/config
  volumes:
  - name: config-volume
    configMap:
      name: special-config
      items:
      - key: SPECIAL_LEVEL
        path: keys

2 같이 보기[ | ]

3 참고[ | ]

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