无法将卷安装到Pod

时间:2020-10-12 14:02:47

标签: kubernetes yaml pod

我下面有yaml文件来部署flink集群。这适用于单个卷,但是当我尝试将另一个卷附加到该卷时,它会因错误而失败

apiVersion: flinkoperator.k8s.io/v1beta1
kind: FlinkCluster
metadata:
  name: flinksessioncluster-sample
spec:
  image:
    name: flink:1.11.2
    pullPolicy: Always
  jobManager:
    accessScope: Cluster
    ports:
      ui: 8081
    resources:
      limits:
        memory: "1024Mi"
        cpu: "200m"
    volumes:
    - name: flink-check
      persistentVolumeClaim:
                claimName: flink-check-pv-claim
    - name: flink-save
      persistentVolumeClaim:
                claimName: flink-efs
    volumeMounts:
    - mountPath: /cdep/flink-checkpoints
      name: flink-check
    - mountPath: /data/flink-savepoints
      name: flink-save
        
  taskManager:
    replicas: 2
    resources:
      limits:
        memory: "1024Mi"
        cpu: "200m"
    volumes:
    - name: flink-check
      persistentVolumeClaim:
                claimName: flink-check-pv-claim
    - name: flink-save
      persistentVolumeClaim:
                claimName: flink-efs
    volumeMounts:
    - mountPath: /cdep/flink-checkpoints
      name: flink-check
    - mountPath: /data/flink-savepoints
      name: flink-save
        
    sidecars:
      - name: sidecar
        image: alpine
        command:
          - "sleep"
          - "10000"
   
  envVars:
    - name: FOO
      value: bar
  flinkProperties:
    taskmanager.numberOfTaskSlots: "1"
    taskmanager.memory.flink.size: "768m"
    restart-strategy.fixed-delay.attempts: "3"
    restart-strategy.fixed-delay.delay: "10s"
  logConfig:
    "log4j-console.properties": |
        rootLogger.level = INFO
        rootLogger.appenderRef.console.ref = LogConsole
        appender.console.name = LogConsole
        appender.console.type = CONSOLE
        appender.console.layout.type = PatternLayout
        appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n 

我有以下PV和PVC

PV


apiVersion: v1
kind: PersistentVolume
metadata:
  name: flink-save-pv
  annotations:
    volume.beta.kubernetes.io/storage-class: "efs-sc"
  labels:
    volume: flink-save-pv
spec:
  capacity:
    storage: 1Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: efs-sc
  csi:
    driver: efs.csi.aws.com
    volumeHandle: fs-846dff55

PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: flink-efs
  annotations:
    volume.beta.kubernetes.io/storage-class: "efs-sc"
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 1Gi
  volumeMode: Filesystem
  selector:
    matchLabels:
      volume: "flink-save-pv"
 

PV和PVC相互绑定。但是当我应用yaml文件时,出现以下错误:

 Warning  FailedMount  57s   kubelet, ip-1-5-1-40.ap-north-1.compute.internal  Unable to attach or mount volumes: unmounted volumes=[flink-check], unattached volumes=[flink-save flink-config-volume default-token-k7t2q flink-check]: timed out waiting for the condition

这里可能是什么问题?

0 个答案:

没有答案