Mr.Gomer
Mr.Gomer

Reputation: 649

Kubernetes: creating permanent folders in pod

I have a pod in which I'm running a image. The pod is not mine but belongs to the company I work for. Each time I mount a new image in the pod it has access to some predefined "Permanent" folders.

When I use the edit deployment command I see this:

 volumeMounts:
        - mountPath: /Data/logs
          name: ba-server-api-dh-pvc
          subPath: logs
        - mountPath: /Data/ErrorAndAbortedBlobs
          name: ba-server-api-dh-pvc
          subPath: ErrorAndAbortedBlobs
        - mountPath: /Data/SuccessfullyTransferredBlobs
          name: ba-server-api-dh-pvc
          subPath: SuccessfullyTransferredBlobs
        - mountPath: /Data/BlobsToBeTransferred
          name: ba-server-api-dh-pvc
          subPath: BlobsToBeTransferred 

Now I want to manually add another such mountPath so I get another folder in the pod. But when I add it to the deployment config (the one above) and try saving it I get the following error.

"error: deployments.extensions "ba-server-api-dh-deployment" is invalid"

What can I do to add another permanent folder to the POD?

kind regards

Upvotes: 0

Views: 1855

Answers (1)

quoc9x
quoc9x

Reputation: 2171

It looks like you haven't specified the volume.

Something looks like this.

...
        volumeMounts:
          - mountPath: /Data/BlobsToBeTransferred
            name: ba-server-api-dh-pvc
            subPath: BlobsToBeTransferred
...
   volume:
     - name: ba-server-api-dh-pvc
       persistentVolumeClaim:
         claimName: ba-server-api-dh-pvc

Note that you already have a PersistentVolumeClaim named ba-server-api-dh-pvc, otherwise you will have to create.

Upvotes: 3

Related Questions