2021-08-08 23:34:03 +00:00
|
|
|
diff --git a/pkg/cluster/internal/providers/common/getmodules.go b/pkg/cluster/internal/providers/common/getmodules.go
|
|
|
|
new file mode 100644
|
2022-06-16 17:23:12 +00:00
|
|
|
index 00000000..1cce5675
|
2021-08-08 23:34:03 +00:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/pkg/cluster/internal/providers/common/getmodules.go
|
|
|
|
@@ -0,0 +1,15 @@
|
|
|
|
+package common
|
|
|
|
+
|
|
|
|
+import "os"
|
|
|
|
+
|
|
|
|
+const (
|
2022-06-16 17:23:12 +00:00
|
|
|
+ fhsKernelModulePath = "/lib/modules"
|
|
|
|
+ nixKernelModulePath = "/run/booted-system/kernel-modules/lib/modules"
|
2021-08-08 23:34:03 +00:00
|
|
|
+)
|
|
|
|
+
|
|
|
|
+func GetKernelModulePath() string {
|
2022-06-16 17:23:12 +00:00
|
|
|
+ if _, err := os.Stat(nixKernelModulePath); !os.IsNotExist(err) {
|
|
|
|
+ return nixKernelModulePath
|
2021-08-08 23:34:03 +00:00
|
|
|
+ }
|
2022-06-16 17:23:12 +00:00
|
|
|
+ return fhsKernelModulePath
|
2021-08-08 23:34:03 +00:00
|
|
|
+}
|
|
|
|
diff --git a/pkg/cluster/internal/providers/docker/provision.go b/pkg/cluster/internal/providers/docker/provision.go
|
2022-06-16 17:23:12 +00:00
|
|
|
index 97b05594..3aaa9830 100644
|
2021-08-08 23:34:03 +00:00
|
|
|
--- a/pkg/cluster/internal/providers/docker/provision.go
|
|
|
|
+++ b/pkg/cluster/internal/providers/docker/provision.go
|
2023-04-29 16:46:19 +00:00
|
|
|
@@ -230,7 +230,7 @@ func runArgsForNode(node *config.Node, clusterIPFamily config.ClusterIPFamily, n
|
2021-08-08 23:34:03 +00:00
|
|
|
// (please don't depend on doing this though!)
|
|
|
|
"--volume", "/var",
|
|
|
|
// some k8s things want to read /lib/modules
|
|
|
|
- "--volume", "/lib/modules:/lib/modules:ro",
|
|
|
|
+ "--volume", fmt.Sprintf("%s:/lib/modules:ro", common.GetKernelModulePath()),
|
2022-06-16 17:23:12 +00:00
|
|
|
// propagate KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER to the entrypoint script
|
|
|
|
"-e", "KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER",
|
2021-08-08 23:34:03 +00:00
|
|
|
},
|
|
|
|
diff --git a/pkg/cluster/internal/providers/podman/provision.go b/pkg/cluster/internal/providers/podman/provision.go
|
2022-06-16 17:23:12 +00:00
|
|
|
index 50aa7018..7e25a4de 100644
|
2021-08-08 23:34:03 +00:00
|
|
|
--- a/pkg/cluster/internal/providers/podman/provision.go
|
|
|
|
+++ b/pkg/cluster/internal/providers/podman/provision.go
|
2023-04-29 16:46:19 +00:00
|
|
|
@@ -203,7 +203,7 @@ func runArgsForNode(node *config.Node, clusterIPFamily config.ClusterIPFamily, n
|
2021-08-08 23:34:03 +00:00
|
|
|
// dev: devices on the volume will be able to be used by processes within the container
|
|
|
|
"--volume", fmt.Sprintf("%s:/var:suid,exec,dev", varVolume),
|
|
|
|
// some k8s things want to read /lib/modules
|
|
|
|
- "--volume", "/lib/modules:/lib/modules:ro",
|
|
|
|
+ "--volume", fmt.Sprintf("%s:/lib/modules:ro", common.GetKernelModulePath()),
|
2022-06-16 17:23:12 +00:00
|
|
|
// propagate KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER to the entrypoint script
|
|
|
|
"-e", "KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER",
|
2021-08-08 23:34:03 +00:00
|
|
|
},
|