{"action":"closed","issue":{"url":"https://api.github.com/repos/lxc/lxd/issues/3957","repository_url":"https://api.github.com/repos/lxc/lxd","labels_url":"https://api.github.com/repos/lxc/lxd/issues/3957/labels{/name}","comments_url":"https://api.github.com/repos/lxc/lxd/issues/3957/comments","events_url":"https://api.github.com/repos/lxc/lxd/issues/3957/events","html_url":"https://github.com/lxc/lxd/issues/3957","id":267107740,"number":3957,"title":"CGroup Mount creating strange directory structure","user":{"login":"tommyknows","id":16387735,"avatar_url":"https://avatars2.githubusercontent.com/u/16387735?v=4","gravatar_id":"","url":"https://api.github.com/users/tommyknows","html_url":"https://github.com/tommyknows","followers_url":"https://api.github.com/users/tommyknows/followers","following_url":"https://api.github.com/users/tommyknows/following{/other_user}","gists_url":"https://api.github.com/users/tommyknows/gists{/gist_id}","starred_url":"https://api.github.com/users/tommyknows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tommyknows/subscriptions","organizations_url":"https://api.github.com/users/tommyknows/orgs","repos_url":"https://api.github.com/users/tommyknows/repos","events_url":"https://api.github.com/users/tommyknows/events{/privacy}","received_events_url":"https://api.github.com/users/tommyknows/received_events","type":"User","site_admin":false},"labels":[{"id":145665855,"url":"https://api.github.com/repos/lxc/lxd/labels/Incomplete","name":"Incomplete","color":"5319e7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2017-10-20T08:57:55Z","updated_at":"2017-11-16T02:13:35Z","closed_at":"2017-11-16T02:13:35Z","author_association":"NONE","body":"# Required information\r\n\r\n * Distribution: Ubuntu 16.04 (without systemd)\r\n * The output of \"lxc info\" or if that fails:\r\n   * Kernel version:  4.10.0-37-generic\r\n   * LXC version: 2.18\r\n   * LXD version: 2.18\r\n   * Storage backend in use: zfs | dir\r\n\r\n# Issue description\r\n\r\nI'm trying to run kubernetes inside an lxc container, however, the kubelet fails on startup with the following error:\r\n```kubelet[4066]: error: failed to run Kubelet: mountpoint for cpu not found```\r\n\r\nAfter some googling, I found that this is most likely an issue with cgroups. \r\nThese are the cgroups on the host:\r\n``` \r\nroot@ubuntu:~# ls /sys/fs/cgroup\r\nblkio  cpu  cpuacct  cpuset  devices  freezer  hugetlb  memory  net_cls  net_prio  perf_event  pids  systemd\r\n```\r\n\r\nThe cgroups inside the container look different:\r\n```\r\nroot@kubernetes:~# ls /sys/fs/cgroup/\r\nblkio  cpu,cpuacct  cpuset  devices  freezer  hugetlb  memory  net_cls,net_prio  perf_event  pids  systemd\r\n```\r\n(Notice the \"cpu,cpuacct\" is one folder, instead of two seperate)\r\n\r\n```\r\nroot@kubernetes:~# cat /proc/self/cgroup\r\n13:name=systemd:/\r\n12:pids:/\r\n11:hugetlb:/\r\n10:net_prio:/\r\n9:perf_event:/\r\n8:net_cls:/\r\n7:freezer:/\r\n6:devices:/\r\n5:memory:/\r\n4:blkio:/\r\n3:cpuacct:/\r\n2:cpu:/\r\n1:cpuset:/\r\nroot@kubernetes:~# cat /proc/self/mountinfo | grep cgroup\r\n57 102 0:52 / /sys/fs/cgroup ro,nosuid,nodev,noexec - tmpfs tmpfs ro,mode=755\r\n58 57 0:38 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,name=systemd\r\n59 57 0:31 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,devices\r\n60 57 0:37 / /sys/fs/cgroup/pids rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,pids\r\n61 57 0:34 / /sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,perf_event\r\n62 57 0:28 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,blkio\r\n63 57 0:36 / /sys/fs/cgroup/hugetlb rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,hugetlb\r\n64 57 0:22 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,cpuset\r\n65 57 0:29 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,memory\r\n66 57 0:32 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,freezer\r\n```\r\n\r\nI use the following two profiles for the container:\r\n```\r\nroot@ubuntu:~# lxc profile show docker\r\nconfig:\r\n  linux.kernel_modules: overlay, nf_nat\r\n  security.nesting: \"true\"\r\ndescription: Profile supporting docker in containers\r\ndevices:\r\n  aadisable:\r\n    path: /sys/module/apparmor/parameters/enabled\r\n    source: /dev/null\r\n    type: disk\r\nname: docker\r\nused_by:\r\n- /1.0/containers/kubernetes\r\n\r\nroot@ubuntu:~# lxc profile show kubernetes\r\nconfig:\r\n  boot.autostart: \"true\"\r\n  linux.kernel_modules: bridge,br_netfilter,ip_tables,ip6_tables,netlink_diag,nf_nat,overlay\r\n  raw.lxc: |-\r\n    lxc.aa_profile = unconfined\r\n    lxc.cgroup.devices.allow = a\r\n    lxc.mount.auto=proc:rw sys:rw\r\n    lxc.cap.drop =\r\n  security.nesting: \"true\"\r\n  security.privileged: \"true\"\r\ndescription: Profile for kubernetes hosts\r\ndevices:\r\n  eth0:\r\n    nictype: bridged\r\n    parent: lxdbr0\r\n    type: nic\r\n  root:\r\n    path: /\r\n    pool: dirpool\r\n    type: disk\r\nname: kubernetes\r\nused_by:\r\n- /1.0/containers/kubernetes\r\n```\r\n\r\n# Steps to reproduce\r\n\r\n 1. Start an ubuntu container (```lxc launch ubuntu:16.04 test```)\r\n 2. Check CGroups\r\n\r\nAm I missing something? Or is this expected behavior?\r\n\r\nThanks"}}
{"actor":{"display_login":"stgraber"}}