m/node/kubernetes: remove local-strict storage class
It turns out that the local-strict storage class did not have an effect
on readonly volumes, or on gVisor. And after updating runc to 1.2.0, it
no longer has an effect anywhere. It appears that setting noexec and
similar flags in the CSI server, using a storage class, is the wrong
approach and just happened to work by accident. Instead, this should
probably be implemented as a Kubernetes feature to set per-mount-point
flags on the VolumeMount.
This commit thus removes the local-strict storage class and the mount
options processing in the provisioner and CSI server. This will allow
updating runc.
Additionally, the StatefulSet end-to-end test is extended to also run
tests with gVisor. gVisor apparently does not support block volumes.
See: https://github.com/monogon-dev/monogon/issues/361
Change-Id: Ic2f50aa3bc9442ca1dbb9e8742d5b8fecbfc3614
Reviewed-on: https://review.monogon.dev/c/monogon/+/3658
Tested-by: Jenkins CI
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/node/kubernetes/reconciler/resources_storageclass.go b/metropolis/node/kubernetes/reconciler/resources_storageclass.go
index 36dee1c..9be81fb 100644
--- a/metropolis/node/kubernetes/reconciler/resources_storageclass.go
+++ b/metropolis/node/kubernetes/reconciler/resources_storageclass.go
@@ -68,8 +68,7 @@
"storageclass.kubernetes.io/is-default-class": "true",
"kubernetes.io/description": "local is the default storage class on Metropolis. " +
"It stores data on the node root disk and supports space limits, resizing and oversubscription but no snapshots. " +
- "It is backed by XFS and uses permissive mounting options (exec,dev,suid). " +
- "If you want more strict mounting options, chose the `local-strict` storage class.",
+ "It is backed by XFS.",
},
},
AllowVolumeExpansion: True(),
@@ -82,25 +81,5 @@
"suid",
},
},
- &storage.StorageClass{
- ObjectMeta: meta.ObjectMeta{
- Name: "local-strict",
- Labels: builtinLabels(nil),
- Annotations: map[string]string{
- "storageclass.kubernetes.io/is-default-class": "false",
- "kubernetes.io/description": "local-strict is the same as local (see its description) but uses strict mount options (noexec, nodev, nosuid). " +
- "It is best used together with readOnlyRoot to restrict exploitation vectors.",
- },
- },
- AllowVolumeExpansion: True(),
- Provisioner: csiProvisionerName,
- ReclaimPolicy: &reclaimPolicyDelete,
- VolumeBindingMode: &waitForConsumerBinding,
- MountOptions: []string{
- "noexec",
- "nodev",
- "nosuid",
- },
- },
}
}