{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/65597","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/65597/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/65597/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/65597/events","html_url":"https://github.com/kubernetes/kubernetes/issues/65597","id":336771856,"node_id":"MDU6SXNzdWUzMzY3NzE4NTY=","number":65597,"title":"Init containers cannot use downward API volumes","user":{"login":"ImJasonH","id":210737,"node_id":"MDQ6VXNlcjIxMDczNw==","avatar_url":"https://avatars1.githubusercontent.com/u/210737?v=4","gravatar_id":"","url":"https://api.github.com/users/ImJasonH","html_url":"https://github.com/ImJasonH","followers_url":"https://api.github.com/users/ImJasonH/followers","following_url":"https://api.github.com/users/ImJasonH/following{/other_user}","gists_url":"https://api.github.com/users/ImJasonH/gists{/gist_id}","starred_url":"https://api.github.com/users/ImJasonH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImJasonH/subscriptions","organizations_url":"https://api.github.com/users/ImJasonH/orgs","repos_url":"https://api.github.com/users/ImJasonH/repos","events_url":"https://api.github.com/users/ImJasonH/events{/privacy}","received_events_url":"https://api.github.com/users/ImJasonH/received_events","type":"User","site_admin":false},"labels":[{"id":105146071,"node_id":"MDU6TGFiZWwxMDUxNDYwNzE=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/bug","name":"kind/bug","color":"e11d21","default":false},{"id":173493665,"node_id":"MDU6TGFiZWwxNzM0OTM2NjU=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/node","name":"sig/node","color":"d2b48c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-28T20:39:21Z","updated_at":"2018-09-26T21:17:51Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n/kind bug\r\n-->\r\n\r\n**What happened**:\r\n\r\nDefine a Pod with an `initContainer` that mounts a volume backed by the downward API to expose its CPU request to the container.\r\n\r\n```yaml\r\napiVersion: v1\r\nkind: Pod\r\nmetadata:\r\n  name: pod\r\n\r\nspec:\r\n  initContainers:\r\n  - name: init\r\n    image: ubuntu\r\n    args: ['cat', '/etc/podinfo/cpu']\r\n    resources:\r\n      requests:\r\n        cpu: '.25'\r\n      limits:\r\n        cpu: '.25'\r\n    volumeMounts:\r\n    - name: podinfo-init\r\n      mountPath: /etc/podinfo\r\n\r\n  containers:\r\n  - name: real\r\n    image: ubuntu\r\n    args: ['echo', 'hello']\r\n\r\n  volumes:\r\n  - name: podinfo-init\r\n    downwardAPI:\r\n      items:\r\n      - path: 'cpu'\r\n        resourceFieldRef:\r\n          containerName: 'init'\r\n          resource: 'requests.cpu'\r\n```\r\n\r\nWhen I start this pod, I see it in `Init 0/1` and `kubectl describe pod pod` shows:\r\n\r\n```\r\nMountVolume.SetUp failed for volume \"podinfo-init\" : container init not found\r\n```\r\n\r\n**What you expected to happen**:\r\n\r\nThe pod starts, runs the init container with volume mounted to print the mounted file, then the real container, then finishes.\r\n\r\n**How to reproduce it (as minimally and precisely as possible)**:\r\n\r\nSee the YAML above, more repro cases [here](https://gist.github.com/ImJasonH/6a0d8e0c0b11cda095f30c4890072d73)\r\n\r\n**Anything else we need to know?**:\r\n\r\nI suspect this might be because the container name `init` is ambiguous between init containers and a pod's \"real\" containers. If so, is there some way to reference the init container specifically in the `containerName` field?\r\n\r\n**Environment**:\r\n- Kubernetes version (use `kubectl version`):\r\n\r\n```\r\nClient Version: version.Info{Major:\"1\", Minor:\"10\", GitVersion:\"v1.10.5\", GitCommit:\"32ac1c9073b132b8ba18aa830f46b77dcceb0723\", GitTreeState:\"clean\", BuildDate:\"2018-06-21T11:46:00Z\", GoVersion:\"go1.9.3\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\nServer Version: version.Info{Major:\"1\", Minor:\"10+\", GitVersion:\"v1.10.2-gke.3\", GitCommit:\"d2c7a2bd41036f9474287579a725dc54c904e92d\", GitTreeState:\"clean\", BuildDate:\"2018-05-23T00:19:39Z\", GoVersion:\"go1.9.3b4\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\n```\r\n\r\n- Cloud provider or hardware configuration:\r\n\r\nGKE\r\n\r\n```sh\r\n$ gcloud container clusters list\r\ncluster-1                                us-east1-b  1.10.2-gke.3    <IP>  n1-standard-4  1.10.2-gke.3  3          RUNNING\r\n\r\n```\r\n\r\n- OS (e.g. from /etc/os-release):\r\n\r\n```sh\r\n$ cat /etc/os-release\r\nPRETTY_NAME=\"Debian GNU/Linux buster/sid\"\r\nNAME=\"Debian GNU/Linux\"\r\nID=debian\r\nHOME_URL=\"https://www.debian.org/\"\r\nSUPPORT_URL=\"https://www.debian.org/support\"\r\nBUG_REPORT_URL=\"https://bugs.debian.org/\"\r\n```\r\n\r\n- Kernel (e.g. `uname -a`):\r\n\r\n```\r\n$ uname -a\r\nLinux <hostname> 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux\r\n```"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/424872974","html_url":"https://github.com/kubernetes/kubernetes/issues/65597#issuecomment-424872974","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/65597","id":424872974,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDg3Mjk3NA==","user":{"login":"fejta-bot","id":30488982,"node_id":"MDQ6VXNlcjMwNDg4OTgy","avatar_url":"https://avatars1.githubusercontent.com/u/30488982?v=4","gravatar_id":"","url":"https://api.github.com/users/fejta-bot","html_url":"https://github.com/fejta-bot","followers_url":"https://api.github.com/users/fejta-bot/followers","following_url":"https://api.github.com/users/fejta-bot/following{/other_user}","gists_url":"https://api.github.com/users/fejta-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/fejta-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fejta-bot/subscriptions","organizations_url":"https://api.github.com/users/fejta-bot/orgs","repos_url":"https://api.github.com/users/fejta-bot/repos","events_url":"https://api.github.com/users/fejta-bot/events{/privacy}","received_events_url":"https://api.github.com/users/fejta-bot/received_events","type":"User","site_admin":false},"created_at":"2018-09-26T21:17:51Z","updated_at":"2018-09-26T21:17:51Z","author_association":"NONE","body":"Issues go stale after 90d of inactivity.\nMark the issue as fresh with `/remove-lifecycle stale`.\nStale issues rot after an additional 30d of inactivity and eventually close.\n\nIf this issue is safe to close now please do so with `/close`.\n\nSend feedback to sig-testing, kubernetes/test-infra and/or [fejta](https://github.com/fejta).\n/lifecycle stale"}}
{"actor":{"display_login":"fejta-bot"}}