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

2번째 줄: 2번째 줄:
;K8s volumes configMap  
;K8s volumes configMap  


<syntaxhighlight lang='yaml' line>
<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>
<syntaxhighlight lang='yaml' line>
<syntaxhighlight lang='yaml' line highlight='14'>
apiVersion: v1
apiVersion: v1
kind: Pod
kind: Pod
37번째 줄: 35번째 줄:
         mountPath: /etc/config
         mountPath: /etc/config
   volumes:
   volumes:
    - name: config-volume
  - name: config-volume
      configMap:
    configMap:
        name: special-config
      name: special-config
        items:
      items:
        - key: SPECIAL_LEVEL
      - key: SPECIAL_LEVEL
          path: keys
        path: keys
  restartPolicy: Never
</syntaxhighlight>
</syntaxhighlight>


==같이 보기==
==같이 보기==

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 }}