apiVersion: v1
kind: ConfigMap
metadata:
  name: cm-volume
data:
  author.txt: wangxiaochun
  file.conf: |
    [app]
    config1
    config2
---
apiVersion: v1
kind: Pod
metadata:
  name: pod-volume-test
spec:
  volumes:
    - name: volume-config  #指定卷名
      configMap:
        name: cm-volume  #指定卷来自cm
  containers:
    - name: nginx
      image: registry.cn-beijing.aliyuncs.com/wangxiaochun/nginx:1.20.0
      volumeMounts:
      - name: volume-config #调用前面定义的卷名
        mountPath: /cmap/   #指定Pod中的挂载点目录
