-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
How to enforce host apparmor
profiles on kind
?
#3704
Comments
Note, you have a typo here: root@kind-worker3:/# systemctl status apprmor
Unit apprmor.service could not be found. Just a hunch, but have you tried adding an extra mount to pull in the host's |
Good catch! It's still not found though:
Are you suggesting that I do something like: apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
extraMounts:
- hostPath: /etc/apparmor.d/
containerPath: /etc/apparmor.d/ Thanks for the reply, BTW. |
Disclaimer: I have not done this! Part of it may be needing to add the mount, but from what you've seen, that apparmor service is not installed into the base image. So maybe someone has a workaround to avoid it, but I think you may be better off building your own node image to include what you need here. |
Thanks. Mounting did add the profiles, but I still the error message:
I will have a look at building an image. The only confusing thing is that |
We don't support this, apparmor doesn't mix well with nested containers, which to be fair are a hack that generally isn't expected to be supported by other tools. https://kind.sigs.k8s.io/docs/user/known-issues/#apparmor kind nodes ask docker to disable apparmor, because otherwise a lot of things would break, the host apparmor profiles would get applied to the nested kubernetes under the node containers and break things because the profiles are designed to run against a single non-nested container or only the host. I would recommend developing apparmor roles only on a VM closer to your target cluster.
|
I would like to apply the
/etc/apparmor.d/enroot
that is found on thekind
host to the worker nodes. I can see that from a worker node that/sys/module/apparmor/parameters/enabled
is set toY
but I get an error indicating otherwise.I do not want to build a new
kind
node.I could try with
kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e
but I doubt this will make a difference?host
Worker Node(s)
Error
Or from
k9s
:Version
kind:
kind v0.23.0 go1.22.3 linux/amd6
Node:
kindest/node:v1.24.17@sha256:bad10f9b98d54586cba05a7eaa1b61c6b90bfc4ee174fdc43a7b75ca75c95e51
The text was updated successfully, but these errors were encountered: