apiVersion: v1
kind: Pod
metadata:
  name: busybox
  namespace: default
spec:
  containers:
  - name: busybox
    image: busybox
    #image: registry.cn-hangzhou.aliyuncs.com/zhengyu1992/busybox
    args: [/bin/sh, -c, 'sleep 99999']
    volumeMounts:
    - name: dir1
      mountPath: /dir1
    - name: dir2
      mountPath: /dir2
    - name: cert1
      mountPath: /home/ssl/abc.com.pem
      subPath: abc.com.pem
      readOnly: true
  volumes:
  ##绑定已创建好的PVC
  - name: dir1
    persistentVolumeClaim:
      claimName: pvc1
  ##绑定本地的磁盘中的目录,pod所在宿主机,一般需要配合nodeSelector使用
  - name: dir2
    hostPath:
      path: /data
  ##挂载已创建好的configmap中的文件
  - name: cert1
    configMap:
      defaultMode: 420
      name: abc-pem-config
  nodeSelector:
    abc: 1
  tolerations:
  - key: node-role.kubernetes.io/control-plane
    effect: NoSchedule
    operator: Exists
  • No labels