Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions pkg/render/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1064,10 +1064,6 @@ func (c *nodeComponent) nodeVolumes() []corev1.Volume {
{Name: "sys-fs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs", Type: &dirOrCreate}}},
// Volume for the bpffs itself, used by the main node container.
{Name: "bpffs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs/bpf", Type: &dirMustExist}}},
// securityfs, read by Felix to detect kernel lockdown=confidentiality. No
// Type set (like nodeproc) so nodes without securityfs still start; Felix
// treats an unreadable lockdown file as "not locked down".
{Name: "sys-kernel-security", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/kernel/security"}}},
// Volume used by mount-cgroupv2 init container to access root cgroup name space of node.
{Name: "nodeproc", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/proc"}}},
}
Expand Down Expand Up @@ -1375,9 +1371,6 @@ func (c *nodeComponent) nodeVolumeMounts() []corev1.VolumeMount {
corev1.VolumeMount{MountPath: "/var/run/calico", Name: "var-run-calico"},
corev1.VolumeMount{MountPath: "/var/lib/calico", Name: "var-lib-calico"},
corev1.VolumeMount{MountPath: "/sys/fs/bpf", Name: BPFVolumeName},
// Read-only so Felix can detect kernel lockdown=confidentiality via
// /sys/kernel/security/lockdown (securityfs is separate from /sys/fs).
corev1.VolumeMount{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
c.cfg.TLS.NodeSecret.VolumeMount(c.SupportedOSType()),
)

Expand Down
13 changes: 0 additions & 13 deletions pkg/render/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ var _ = Describe("Node rendering tests", func() {
{Name: "policysync", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/var/run/nodeagent", Type: &dirOrCreate}}},
{Name: "sys-fs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs", Type: &dirOrCreate}}},
{Name: "bpffs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs/bpf", Type: &dirMustExist}}},
{Name: "sys-kernel-security", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/kernel/security"}}},
{Name: "nodeproc", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/proc"}}},
{
Name: "tigera-ca-bundle",
Expand Down Expand Up @@ -363,7 +362,6 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/node-certs", Name: render.NodeTLSSecretName, ReadOnly: true},
{MountPath: "/var/log/calico", Name: "var-log-calico"},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down Expand Up @@ -519,7 +517,6 @@ var _ = Describe("Node rendering tests", func() {
{Name: "cni-plugins-stage", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}},
{Name: "sys-fs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs", Type: &dirOrCreate}}},
{Name: "bpffs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs/bpf", Type: &dirMustExist}}},
{Name: "sys-kernel-security", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/kernel/security"}}},
{Name: "nodeproc", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/proc"}}},
{Name: "policysync", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/var/run/nodeagent", Type: &dirOrCreate}}},
{
Expand Down Expand Up @@ -557,7 +554,6 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/node-certs", Name: render.NodeTLSSecretName, ReadOnly: true},
{MountPath: "/var/log/calico", Name: "var-log-calico"},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down Expand Up @@ -813,7 +809,6 @@ var _ = Describe("Node rendering tests", func() {
{Name: "policysync", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/var/run/nodeagent", Type: &dirOrCreate}}},
{Name: "sys-fs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs", Type: &dirOrCreate}}},
{Name: "bpffs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs/bpf", Type: &dirMustExist}}},
{Name: "sys-kernel-security", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/kernel/security"}}},
{Name: "nodeproc", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/proc"}}},
{
Name: "tigera-ca-bundle",
Expand Down Expand Up @@ -850,7 +845,6 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/node-certs", Name: render.NodeTLSSecretName, ReadOnly: true},
{MountPath: "/var/log/calico", Name: "var-log-calico"},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down Expand Up @@ -953,7 +947,6 @@ var _ = Describe("Node rendering tests", func() {
{Name: "policysync", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/var/run/nodeagent", Type: &dirOrCreate}}},
{Name: "sys-fs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs", Type: &dirOrCreate}}},
{Name: "bpffs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs/bpf", Type: &dirMustExist}}},
{Name: "sys-kernel-security", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/kernel/security"}}},
{Name: "nodeproc", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/proc"}}},
{
Name: "tigera-ca-bundle",
Expand Down Expand Up @@ -989,7 +982,6 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/etc/pki/tls/certs", Name: "tigera-ca-bundle", ReadOnly: true},
{MountPath: "/node-certs", Name: render.NodeTLSSecretName, ReadOnly: true},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down Expand Up @@ -1223,7 +1215,6 @@ var _ = Describe("Node rendering tests", func() {
{Name: "policysync", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/var/run/nodeagent", Type: &dirOrCreate}}},
{Name: "sys-fs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs", Type: &dirOrCreate}}},
{Name: "bpffs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs/bpf", Type: &dirMustExist}}},
{Name: "sys-kernel-security", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/kernel/security"}}},
{Name: "nodeproc", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/proc"}}},
{
Name: "tigera-ca-bundle",
Expand Down Expand Up @@ -1260,7 +1251,6 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/node-certs", Name: render.NodeTLSSecretName, ReadOnly: true},
{MountPath: "/var/log/calico", Name: "var-log-calico"},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down Expand Up @@ -1360,7 +1350,6 @@ var _ = Describe("Node rendering tests", func() {
{Name: "policysync", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/var/run/nodeagent", Type: &dirOrCreate}}},
{Name: "sys-fs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs", Type: &dirOrCreate}}},
{Name: "bpffs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs/bpf", Type: &dirMustExist}}},
{Name: "sys-kernel-security", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/kernel/security"}}},
{Name: "nodeproc", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/proc"}}},
{
Name: "tigera-ca-bundle",
Expand Down Expand Up @@ -1396,7 +1385,6 @@ var _ = Describe("Node rendering tests", func() {
{MountPath: "/etc/pki/tls/certs", Name: "tigera-ca-bundle", ReadOnly: true},
{MountPath: "/node-certs", Name: render.NodeTLSSecretName, ReadOnly: true},
{MountPath: "/sys/fs/bpf", Name: "bpffs"},
{MountPath: "/sys/kernel/security", Name: "sys-kernel-security", ReadOnly: true},
}
Expect(ds.Spec.Template.Spec.Containers[0].VolumeMounts).To(ConsistOf(expectedNodeVolumeMounts))

Expand Down Expand Up @@ -1477,7 +1465,6 @@ var _ = Describe("Node rendering tests", func() {
{Name: "flexvol-driver-host", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/etc/kubernetes/kubelet-plugins/volume/exec/nodeagent~uds", Type: &dirOrCreate}}},
{Name: "sys-fs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs", Type: &dirOrCreate}}},
{Name: "bpffs", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/fs/bpf", Type: &dirMustExist}}},
{Name: "sys-kernel-security", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/sys/kernel/security"}}},
{Name: "nodeproc", VolumeSource: corev1.VolumeSource{HostPath: &corev1.HostPathVolumeSource{Path: "/proc"}}},
{
Name: "tigera-ca-bundle",
Expand Down
Loading