Skip to content

Commit d2e3af3

Browse files
committed
Add LD_LIBRARY_PATH
1 parent b9691b1 commit d2e3af3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

nodeup/pkg/model/kube_proxy.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,18 @@ func (b *KubeProxyBuilder) buildPod() (*v1.Pod, error) {
229229
vol.HostPath.Type = &hostPathType
230230
}
231231

232-
// Mount host nft binary and its shared library dependencies for kube-proxy nftables mode
232+
// Mount host nft binary and its shared library dependencies for kube-proxy nftables mode.
233+
// The nft binary on the host is dynamically linked against host libraries
234+
// (e.g. libreadline, libnftnl, libmnl) that are not in the container image.
235+
// LD_LIBRARY_PATH is needed because the container's dynamic linker doesn't
236+
// search /usr/lib64 by default.
233237
if c.ProxyMode == "nftables" {
234238
kubemanifest.AddHostPathMapping(pod, container, "usrsbin", "/usr/sbin", kubemanifest.WithMountPath("/usr/sbin"))
235239
kubemanifest.AddHostPathMapping(pod, container, "usrlib64", "/usr/lib64", kubemanifest.WithMountPath("/usr/lib64"))
240+
container.Env = append(container.Env, v1.EnvVar{
241+
Name: "LD_LIBRARY_PATH",
242+
Value: "/usr/lib64",
243+
})
236244
}
237245

238246
pod.Spec.Containers = append(pod.Spec.Containers, *container)

0 commit comments

Comments
 (0)