I am learning how to use volume with pods in K8s.

I tried the exact example here.

This is the snippet

apiVersion: v1
kind: Pod
  name: test-pd
  - image: k8s.gcr.io/test-webserver
    name: test-container
    - mountPath: /test-pd
      name: test-volume
  - name: test-volume
      # directory location on host
      path: /data
      # this field is optional
      type: Directory

I simply copied pasted it and run it with kubectl apply -f <file>

Running kubectl get pods shows status hangs ContainerCreating

I have two questions

  1. How to make the pod run as expected?
  2. How to troubleshoot this situation? using kubectl logs <podname> doesn't yield anything useful

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.