diff --git a/cmd/localkube/cmd/start.go b/cmd/localkube/cmd/start.go index 24ddb40de7..16dc99822d 100644 --- a/cmd/localkube/cmd/start.go +++ b/cmd/localkube/cmd/start.go @@ -23,6 +23,8 @@ import ( "github.com/spf13/cobra" + "k8s.io/kubernetes/pkg/capabilities" + "k8s.io/kubernetes/pkg/kubelet/types" "k8s.io/minikube/pkg/localkube" ) @@ -61,6 +63,19 @@ func SetupServer(s *localkube.LocalkubeServer) { panic(err) } } + + // Setup capabilities. This can only be done once per binary. + allSources, _ := types.GetValidatedSources([]string{types.AllSource}) + c := capabilities.Capabilities{ + AllowPrivileged: true, + PrivilegedSources: capabilities.PrivilegedSources{ + HostNetworkSources: allSources, + HostIPCSources: allSources, + HostPIDSources: allSources, + }, + } + capabilities.Initialize(c) + // setup etcd etcd, err := s.NewEtcd(localkube.KubeEtcdClientURLs, localkube.KubeEtcdPeerURLs, "kubeetcd", s.GetEtcdDataDirectory()) if err != nil { diff --git a/pkg/localkube/kubelet.go b/pkg/localkube/kubelet.go index e2ce6f2a62..fae77b81f7 100644 --- a/pkg/localkube/kubelet.go +++ b/pkg/localkube/kubelet.go @@ -39,6 +39,7 @@ func StartKubeletServer(lk LocalkubeServer) func() error { config.Containerized = lk.Containerized config.AllowPrivileged = true + config.Config = "/etc/kubernetes/manifests" // Networking config.ClusterDomain = lk.DNSDomain