如何使用rkt作为容器运行时而不是docker来运行kubernetes?

时间:2019-03-20 13:12:43

标签: kubernetes kubelet rkt

我尝试使用rktlet(https://github.com/kubernetes-incubator/rktlet/blob/master/docs/getting-started-guide.md

但是当我尝试

kubelet --cgroup-driver=systemd \
> --container-runtime=remote \
> --container-runtime-endpoint=/var/run/rktlet.sock \
> --image-service-endpoint=/var/run/rktlet.sock

我遇到以下错误

Flag --cgroup-driver has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
I0320 13:10:21.661373    3116 server.go:407] Version: v1.13.4
I0320 13:10:21.663411    3116 plugins.go:103] No cloud provider specified.
W0320 13:10:21.664635    3116 server.go:552] standalone mode, no API client
W0320 13:10:21.669757    3116 server.go:464] No api server defined - no events will be sent to API server.
I0320 13:10:21.669791    3116 server.go:666] --cgroups-per-qos enabled, but --cgroup-root was not specified.  defaulting to /
I0320 13:10:21.670018    3116 container_manager_linux.go:248] container manager verified user specified cgroup-root exists: []
I0320 13:10:21.670038    3116 container_manager_linux.go:253] Creating Container Manager object based on Node Config: {RuntimeCgroupsName: SystemCgroupsName: KubeletCgroupsName: ContainerRuntime:remote CgroupsPerQOS:true CgroupRoot:/ CgroupDriver:systemd KubeletRootDir:/var/lib/kubelet ProtectKernelDefaults:false NodeAllocatableConfig:{KubeReservedCgroupName: SystemReservedCgroupName: EnforceNodeAllocatable:map[pods:{}] KubeReserved:map[] SystemReserved:map[] HardEvictionThresholds:[{Signal:nodefs.inodesFree Operator:LessThan Value:{Quantity:<nil> Percentage:0.05} GracePeriod:0s MinReclaim:<nil>} {Signal:imagefs.available Operator:LessThan Value:{Quantity:<nil> Percentage:0.15} GracePeriod:0s MinReclaim:<nil>} {Signal:memory.available Operator:LessThan Value:{Quantity:100Mi Percentage:0} GracePeriod:0s MinReclaim:<nil>} {Signal:nodefs.available Operator:LessThan Value:{Quantity:<nil> Percentage:0.1} GracePeriod:0s MinReclaim:<nil>}]} QOSReserved:map[] ExperimentalCPUManagerPolicy:none ExperimentalCPUManagerReconcilePeriod:10s ExperimentalPodPidsLimit:-1 EnforceCPULimits:true CPUCFSQuotaPeriod:100ms}
I0320 13:10:21.670125    3116 container_manager_linux.go:272] Creating device plugin manager: true
I0320 13:10:21.670151    3116 state_mem.go:36] [cpumanager] initializing new in-memory state store
I0320 13:10:21.670254    3116 state_mem.go:84] [cpumanager] updated default cpuset: ""
I0320 13:10:21.670271    3116 state_mem.go:92] [cpumanager] updated cpuset assignments: "map[]"
W0320 13:10:21.672059    3116 util_unix.go:77] Using "/var/run/rktlet.sock" as endpoint is deprecated, please consider using full url format "unix:///var/run/rktlet.sock".
W0320 13:10:21.672124    3116 util_unix.go:77] Using "/var/run/rktlet.sock" as endpoint is deprecated, please consider using full url format "unix:///var/run/rktlet.sock".
E0320 13:10:21.673168    3116 remote_runtime.go:72] Version from runtime service failed: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService
E0320 13:10:21.673228    3116 kuberuntime_manager.go:184] Get runtime version failed: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService
F0320 13:10:21.673249    3116 server.go:261] failed to run Kubelet: failed to create kubelet: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService

如何使用rkt创建kube集群?请帮忙。

1 个答案:

答案 0 :(得分:2)

这就是运行Rktlet的方式。但是,Rktlet仍处于试验阶段,我相信它也不会得到积极开发。根据本文撰写的last commit位于05/2018中。

您可以尝试按照herehere所述的其他方式运行它。基本上,在kubelet上使用--container-runtime=rkt--rkt-path=PATH_TO_RKT_BINARY等。

是否有您需要rkt的原因?请注意,--container-runtime=rkt在最新的Kubernetes中是deprecated,但仍然可以使用(在撰写本文时为1.13)。