-
Notifications
You must be signed in to change notification settings - Fork 13
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
kubeadm: add logic to enforce SELinux for Cilium CNI in Flatcar >= 3745 #461
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
krnowak
reviewed
Oct 10, 2023
@@ -91,6 +91,7 @@ EOF | |||
--config enable-endpoint-routes=true \ | |||
--config cluster-pool-ipv4-cidr=192.168.0.0/17 \ | |||
--version=v0.11.1 2>&1 | iconv --from-code utf-8 --to-code ascii//TRANSLIT | |||
grep -q svirt_lxc_file_t /etc/selinux/mcs/contexts/lxc_contexts && kubectl --namespace kube-system patch daemonset/cilium -p '{"spec":{"template":{"spec":{"containers":[{"name":"cilium-agent","securityContext":{"seLinuxOptions":{"level":"s0","type":"unconfined_t"}}}],"initContainers":[{"name":"mount-cgroup","securityContext":{"seLinuxOptions":{"level":"s0","type":"unconfined_t"}}},{"name":"apply-sysctl-overwrites","securityContext":{"seLinuxOptions":{"level":"s0","type":"unconfined_t"}}},{"name":"clean-cilium-state","securityContext":{"seLinuxOptions":{"level":"s0","type":"unconfined_t"}}}]}}}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Adding this method allows to access the runtime configuration in a test to get/set values based on some conditions. Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
This is required even with Permissive mode. Can be dropped once `spc_t` is supported on Flatcar. Picked-From: e8e9751 Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
container_t brings 'spc_t' too which is required by Cilium. We patch the daemon-set only when the old label ('svirt_lxc_file_t') is detected. Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
tormath1
force-pushed
the
tormath1/cilium-selinux
branch
from
October 10, 2023 08:13
3b7fdd6
to
daead39
Compare
krnowak
approved these changes
Oct 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, we enforce SELinux only for Flatcar >= 3745 for Cilium CNI while SELinux update did not go through all the channels and we bring back the Cilium daemon set patch: 305777e only applied on system where the selinux update did not land yet.
Testing done
Tested on OpenStack against current stable and current alpha: