lxd-profile doesn't contain lxc.cgroup.devices.allow

Bug #1876618 reported by Chris Sanders
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kubernetes Control Plane Charm
Fix Released
High
Tim Van Steenburgh
Kubernetes Worker Charm
Fix Released
High
Tim Van Steenburgh

Bug Description

When deploying charmed-kubernetes on LXD I'm seeing containers fail with this error:
message: 'failed to create containerd task: OCI runtime create failed: container_linux.go:349:
          starting container process caused "process_linux.go:449: container init
          caused \"process_linux.go:415: setting cgroup config for procHooks process
          caused \\\"failed to write \\\\\\\"a *:* rwm\\\\\\\" to \\\\\\\"/sys/fs/cgroup/devices/kubepods/besteffort/pod1ba9b91e-9e37-4ecf-9725-4c53bd198ca8/8bfe325d1d24c795663ada9aa8f36b1f7a3e28e5dda283601887c42913f0585d/devices.allow\\\\\\\":
          write /sys/fs/cgroup/devices/kubepods/besteffort/pod1ba9b91e-9e37-4ecf-9725-4c53bd198ca8/8bfe325d1d24c795663ada9aa8f36b1f7a3e28e5dda283601887c42913f0585d/devices.allow:
          operation not permitted\\\"\"": unknown'

Adding the following to my lxd profile solves the issue.
lxc.cgroup.devices.allow=a

However, keys are not merged and the charm installs it's own profile after any model-specific profiles are applied over writing the change. This means you have to define a profile with
raw.lxc: |
    lxc.apparmor.profile=unconfined
    lxc.mount.auto=proc:rw sys:rw
    lxc.cgroup.devices.allow=a
    lxc.cap.drop=

Then apply the profile after the charm has installed, and restart for it to work. Including the cgroup lxc raw value in the lxd-profile would make the manual steps unnecessary and lxd installs would just work out of the box.

Tags: sts
no longer affects: charm-aws-iam
Revision history for this message
George Kraft (cynerva) wrote :

If you can share what version of Ubuntu this occurred on and what version of LXD you were running, it would help us reproduce it.

Changed in charm-kubernetes-master:
status: New → Confirmed
Changed in charm-kubernetes-worker:
status: New → Confirmed
George Kraft (cynerva)
Changed in charm-kubernetes-master:
importance: Undecided → Critical
Changed in charm-kubernetes-worker:
importance: Undecided → Critical
Changed in charm-kubernetes-master:
status: Confirmed → Triaged
Changed in charm-kubernetes-worker:
status: Confirmed → Triaged
Revision history for this message
Chris Sanders (chris.sanders) wrote :

Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

lxd --version
3.0.3

Deploying 1.18 channel if that matters.

Changed in charm-kubernetes-master:
assignee: nobody → Tim Van Steenburgh (tvansteenburgh)
Changed in charm-kubernetes-worker:
assignee: nobody → Tim Van Steenburgh (tvansteenburgh)
Changed in charm-kubernetes-master:
milestone: none → 1.18+ck1
Changed in charm-kubernetes-worker:
milestone: none → 1.18+ck1
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :
tags: added: review-needed
Changed in charm-kubernetes-master:
status: Triaged → In Progress
Changed in charm-kubernetes-worker:
status: Triaged → In Progress
Felipe Reyes (freyes)
tags: added: sts
tags: removed: review-needed
Changed in charm-kubernetes-master:
status: In Progress → Fix Committed
Changed in charm-kubernetes-worker:
status: In Progress → Fix Committed
George Kraft (cynerva)
Changed in charm-kubernetes-master:
importance: Critical → High
Changed in charm-kubernetes-worker:
importance: Critical → High
Revision history for this message
George Kraft (cynerva) wrote :
Changed in charm-kubernetes-master:
status: Fix Committed → Fix Released
Changed in charm-kubernetes-worker:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.