Hi all, I’m trying to deploy my Flink app using th...
# troubleshooting
a
Hi all, I’m trying to deploy my Flink app using the Flink k8s operator, and I’m a little confused about the “flink-volume” volume mount. I’ve created a PVC for the flink-volume. (I’m using longhorn as the storage layer if that matters) When I try deploying it, it creates a pod that starts up and goes to a ready state successfully. Then, a 2nd pod gets created which is named: <my-application-name>-taskmanager-1-1. (It’s using the same image and container as my application). However, this pod never is able to start because it’s unable to attach to the PVC which is already attached to the first pod. Since the PVC is
ReadWriteOnce
this isn’t surprising. If I use
hostPath
instead of a PVC, then everything works fine though I doubt that’s the recommended approach..? Why are both pods trying to use the same PVC? Do I need to have a PVC with ReadWriteMany? (I hope not.. 🙂 ) Thanks for any help!
m
could you share the YAML?
a
Here’s the relevant part of the CRD (podTemplate):
Copy code
podTemplate:
    apiVersion: v1
    kind: Pod
    metadata:
      name: pod-template
    spec:
      containers:
        # Do not change the main container name
        - name: flink-main-container
          volumeMounts:
            - mountPath: /flink-data
              name: flink-volume
            - name: certs
              mountPath: /var/ssl
      volumes:
        - name: flink-volume
#          hostPath:
            # directory location on host
#            path: /tmp/flink
        - name: flink-volume
          persistentVolumeClaim:
            claimName: flink-data-pvc
        - name: certs
          secret:
            secretName: cfk-green-truststore-cert
m
taskmanager
is the worker that actually runs the job, so it makes sense for it to use the same image. Other than that, I have no clue man, the manifest looks fine to me