Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not specifying volumes defaults to emptyDir #46950

Closed
xiangpengzhao opened this issue Jun 5, 2017 · 5 comments
Closed

Not specifying volumes defaults to emptyDir #46950

xiangpengzhao opened this issue Jun 5, 2017 · 5 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/storage Categorizes an issue or PR as relevant to SIG Storage.

Comments

@xiangpengzhao
Copy link
Contributor

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.):
NO

Note: Please file issues for subcomponents under the appropriate repo

Component Repo
kubectl kubernetes/kubectl
kubeadm kubernetes/kubeadm

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):


Is this a BUG REPORT or FEATURE REQUEST? (choose one):

Kubernetes version (use kubectl version):
HEAD

Environment:

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

What happened:
I have a user who faced an odd problem.

  42m		42m		1	{kubelet 172.168.200.150}	spec.containers{vr2}	Warning		Failed		Failed to start container with docker id 0f4f50e2e7bb with error: Error response from daemon: {"message":"invalid header field value \"oci runtime error: container_linux.go:247: starting container process caused \\\"no such file or directory\\\"\\n\""}

Finally we found that it was due to mounting an emptyDir volume to /dev in container.

He intended to configure volumes in pod manifest as below and mount the volume to /dev in container.

    "volumes": [
      {
        "name": "dev",
        "hostPath": {
              "path": "/dev"
        }
      }
    ]

But for whatever reason he configured it as below. No volume type was specified. This led to an emptyDir type volume.

    "volumes": [
      {
        "name": "dev"
      }
    ]

What you expected to happen:
Validate if volume type is not specified, and error out.

Maybe there is some reason for defaulting to emptyDir by design. But I didn't find any description about this in design-proposals or user guide docs.

At least we should document this default behavior.

How to reproduce it (as minimally and precisely as possible):

  • configure a volume without type in pod manifest
  • create the pod
  • describe the pod

Anything else we need to know:

/sig storage
/sig api-machinery

/cc @jingxu97 @smarterclayton

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Jun 5, 2017
@smarterclayton
Copy link
Contributor

smarterclayton commented Jun 5, 2017 via email

@dixudx
Copy link
Member

dixudx commented Jun 5, 2017

echo @smarterclayton, You're right.

In volume spec, if the obj.VolumeSource (i.e., the location and the type of mounted volume) is not set,

obj.VolumeSource = VolumeSource{
	EmptyDir: &EmptyDirVolumeSource{},
}

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 26, 2017
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 25, 2018
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/storage Categorizes an issue or PR as relevant to SIG Storage.
Projects
None yet
Development

No branches or pull requests

5 participants