title: kubernetes add local files to pod
body: <p>I am attempting to build a pod in kubernetes that has files mounted to the pod from my local system, in a similar way to mounting volumes in <code>docker-compose</code> files</p>
  
  <p>I have tried the following, in an attempt to mount the local folder <code>./test</code> and files to the pod under the <code>/blah/</code> folder. However kubernetes is complaining that <code>MountVolume.SetUp failed for volume "config-volume" : hostPath type check failed: ./test/ is not a directory</code></p>
  
  <p>Here is my <code>yaml</code> file. Am I missing something?</p>
  
  <pre><code>kind: Service
  metadata:
    name: vol-test
    labels:
      app: vol-test
  spec:
    type: NodePort
    ports:
      - port: 8200
        nodePort: 30008
    selector:
      app: vol-test
  
  ---
  
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: vol-test
  spec:
    replicas: 1
    selector:
      matchLabels:
        app: vol-test
    template:
      metadata:
        labels:
          app: vol-test
      spec:
        containers:
          - name: vol-test
            image: nginx
            imagePullPolicy: "IfNotPresent"
            volumeMounts:
              - name: config-volume
                mountPath: /blah/
            ports:
              - containerPort: 8200
        volumes:
          - name: config-volume
            hostPath:
              path: ./test/
              type: Directory
  </code></pre>