K8s configMap optional

Jmnote (토론 | 기여)님의 2022년 1월 3일 (월) 20:02 판 (새 문서: ==개요== ;k8s configMap optional <syntaxhighlight lang='yaml'> apiVersion: v1 kind: Pod metadata: name: dapi-test-pod spec: containers: - name: test image: nginx volu...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

k8s configMap optional
apiVersion: v1
kind: Pod
metadata:
  name: dapi-test-pod
spec:
  containers:
  - name: test
    image: nginx
    volumeMounts:
    - name: vol
      mountPath: /test/
  volumes:
  - name: vol
    configMap:
      name: not-exists
$ kubectl apply -f a.yaml
pod/dapi-test-pod created
$ kubectl get pod dapi-test-pod
NAME            READY   STATUS              RESTARTS   AGE
dapi-test-pod   0/1     ContainerCreating   0          29s
$ kubectl describe pod dapi-test-pod | grep Events: -A9
Events:
  Type     Reason       Age               From               Message
  ----     ------       ----              ----               -------
  Normal   Scheduled    73s               default-scheduler  Successfully assigned default/dapi-test-pod to node1
  Warning  FailedMount  9s (x8 over 73s)  kubelet            MountVolume.SetUp failed for volume "vol" : configmap "not-exists" not found

2 같이 보기

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