Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ConfigMap 실습

Info
iconfalse
Code Block
sansae@sansaeAir15m2 k8s-lab-workspace % k apply -f configmap.yaml 
configmap/game-demo created

sansae@sansaeAir15m2 k8s-lab-workspace % k get cm
NAME               DATA   AGE
game-demo          4      12s
kube-root-ca.crt   1      2d10h

sansae@sansaeAir15m2 k8s-lab-workspace % k apply -f configmap-pod.yaml 
pod/configmap-demo-pod created

sansae@sansaeAir15m2 k8s-lab-workspace % k describe pod configmap-demo-pod 
Name:             configmap-demo-pod
Namespace:        default
Priority:         0
Service Account:  default
Node:             aks-agentpool-33019784-vmss000000/10.224.0.4
Start Time:       Sun, 10 Mar 2024 21:24:41 +0900
Labels:           <none>
Annotations:      cni.projectcalico.org/containerID: b87c230c73d838c496a90f78cfc891c3febd3325a6e0fb6d2ccf83b5fd11d245
                  cni.projectcalico.org/podIP: 10.244.2.216/32
                  cni.projectcalico.org/podIPs: 10.244.2.216/32
Status:           Running
IP:               10.244.2.216
IPs:
  IP:  10.244.2.216
Containers:
  demo:
    Container ID:  containerd://da3b066bff02b13352598a7d94b363e317503f6f4a2c22a7c7b87005d9fdbc9d
    Image:         alpine
    Image ID:      docker.io/library/alpine@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b
    Port:          <none>
    Host Port:     <none>
    Command:
      sleep
      3600
    State:          Running
      Started:      Sun, 10 Mar 2024 21:24:45 +0900
    Ready:          True
    Restart Count:  0
    Environment:
      PLAYER_INITIAL_LIVES:     <set to the key 'player_initial_lives' of config map 'game-demo'>     Optional: false
      UI_PROPERTIES_FILE_NAME:  <set to the key 'ui_properties_file_name' of config map 'game-demo'>  Optional: false
    Mounts:
      /config from config (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-p7w5b (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  config:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      game-demo
    Optional:  false
  kube-api-access-p7w5b:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type    Reason     Age   From               Message
  ----    ------     ----  ----               -------
  Normal  Scheduled  11s   default-scheduler  Successfully assigned default/configmap-demo-pod to aks-agentpool-33019784-vmss000000
  Normal  Pulling    11s   kubelet            Pulling image "alpine"
  Normal  Pulled     7s    kubelet            Successfully pulled image "alpine" in 3.66622611s (3.666233998s including waiting)
  Normal  Created    7s    kubelet            Created container demo
  Normal  Started    7s    kubelet            Started container demo