Volume()

  • Overview
  • Pod Volume with ConfigMap

Overview

Pod Volume with ConfigMap

  • the yaml file contains configmap and pod.
apiVersion: v1
kind: Pod
metadata:
  name: my-pod-3
  namespace: matt
spec:
  containers:
    - name: my-pod-3
      image: busybox
#      command: ["/bin/sh", "-c", "sleep 3600"]
      command:
        - "/bin/sh"
        - "-c"
        - "sleep 3600"
      volumeMounts:
        - name: vol-config
          mountPath: /etc/config
  volumes:
    - name: vol-config
      configMap:
        name: my-cm-3

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-cm-3
  namespace: matt
data:
  hello: world_1 # hello is file name, world_1 is value.
————————
  • Overview
  • Pod Volume with ConfigMap

Overview

Pod Volume with ConfigMap

  • the yaml file contains configmap and pod.
apiVersion: v1
kind: Pod
metadata:
  name: my-pod-3
  namespace: matt
spec:
  containers:
    - name: my-pod-3
      image: busybox
#      command: ["/bin/sh", "-c", "sleep 3600"]
      command:
        - "/bin/sh"
        - "-c"
        - "sleep 3600"
      volumeMounts:
        - name: vol-config
          mountPath: /etc/config
  volumes:
    - name: vol-config
      configMap:
        name: my-cm-3

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-cm-3
  namespace: matt
data:
  hello: world_1 # hello is file name, world_1 is value.