Commit 80be079c authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #33555 from rustyrobot/fix-selinux-rules-discovery

Automatic merge from submit-queue Kubeadm: fix SELinux rules for kubernetes discovery service **What this PR does / why we need it**: Fixes problems with SELinux on CentOS for discovery container which cannot read data from `/tmp/secret` directory. **Which issue this PR fixes** Fixed #33541
parents 354f003c 8f586d91
......@@ -81,6 +81,15 @@ func newKubeDiscoveryPodSpec(s *kubeadmapi.KubeadmConfig) api.PodSpec {
// `HostIP: s.API.AdvertiseAddrs[0]`, if there is only one address`
{Name: "http", ContainerPort: 9898, HostPort: 9898},
},
SecurityContext: &api.SecurityContext{
SELinuxOptions: &api.SELinuxOptions{
// TODO: This implies our discovery container is not being restricted by
// SELinux. This is not optimal and would be nice to adjust in future
// so it can read /tmp/secret, but for now this avoids recommending
// setenforce 0 system-wide.
Type: "unconfined_t",
},
},
}},
Volumes: []api.Volume{{
Name: kubeDiscoverySecretName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment