Directory not created after defining the mounting path for the configMap in a Deployment yaml

4/10/2018

Heading

I was trying to add a directory for mounting the configMap in the Deployment yaml of the Kubernetes artifact. Though I defined the volumes and the mountpath within the container, in the pod exec, I couldn't find the directory?

My deployment file looks like this:

apiVersion: v1
kind: Deployment
metadata:
  name: test-deployment
  namespace: test
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: reactor
    spec:
      containers:
      - name: reactor
        image: test/chain
        imagePullPolicy: Always
        volumeMounts:
        - mountPath: /test
          name: chaindata
        ports:
        - containerPort: 3003
      volumes:
      - configMap:
          name: chaindata
          defaultMode: 420
        name: chaindata
-- Nikitha
kubernetes
node.js
yaml

1 Answer

4/11/2018

I found my error, I was actually pointing to my app directory but the directory was already created in the root folder. Hence, I have changed the Mountpath in the deployment file from /test to src/lib/app/functionchain

Thanks for the concern

-- Nikitha
Source: StackOverflow