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

cmd/k8s-operator,docs/k8s: run tun mode proxies in privileged containers #14262

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

irbekrm
Copy link
Contributor

@irbekrm irbekrm commented Dec 2, 2024

We were previously relying on unintended behaviour by runc where all containers where by default given read/write/mknod permissions for tun devices.
This behaviour was removed in opencontainers/runc#3468 and released in runc 1.2.
Containerd container runtime, used by Docker and majority of Kubernetes distributions bumped runc to 1.2 in 1.7.24 /~https://github.com/containerd/containerd/releases/tag/v1.7.24 thus breaking our reference tun mode Tailscale Kubernetes manifests and Kubernetes operator proxies.

This PR changes the all Kubernetes container configs that run Tailscale in tun mode to privileged. This should not be a breaking change because all these containers would run in a Pod that already has a privileged init container.

Alternative would be to delegate tun device creation to a device plugin like described in #10814 (comment).
However, this would mean an additional prerequisite and dependency on a third party tool to get started with the operator proxies- it seems like a better way is to make the proxies privileged by default to maintain the ease of installation/quick start setup. We can then document that users can alternatively deploy the device plugin and remove privileged context from the Tailscale containers.

I have tested this with a GKE 1.31.3 cluster + manually bumped containerd to v1.74 and runc to 1.2 as well as with Talos 1.8 that bundles containerd v2.0

Long term, we should look into whether these proxies can be run in netstack mode.

Updates #14256
Updates #10814
Updates #14149

Copy link
Member

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we should also update the docs for SecurityContext in ProxyClass.

What's the communication plan for this change, will we add a changelog?

We were previously relying on unintended behaviour by runc where
all containers where by default given read/write/mknod permissions
for tun devices.
This behaviour was removed in opencontainers/runc#3468
and released in runc 1.2.
Containerd container runtime, used by Docker and majority of Kubernetes distributions
bumped runc to 1.2 in 1.7.24 /~https://github.com/containerd/containerd/releases/tag/v1.7.24
thus breaking our reference tun mode Tailscale Kubernetes manifests and Kubernetes
operator proxies.

This PR changes the all Kubernetes container configs that run Tailscale in tun mode
to privileged. This should not be a breaking change because all these containers would
run in a Pod that already has a privileged init container.

Updates #14256
Updates #10814

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
@irbekrm
Copy link
Contributor Author

irbekrm commented Dec 3, 2024

we should also update the docs for SecurityContext in ProxyClass

Good catch, updated

What's the communication plan for this change, will we add a changelog

It is non-breaking so changelog should suffice + will update docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants