我的Kubernetes运行的是什么版本的Docker?

时间:2017-12-05 20:46:41

标签: kubernetes

Kubernetes使用Docker和kubelet dictates兼容的Docker版本用于任何给定的群集。

我的问题是,鉴于已经配置并运行的Kubernetes集群,如果我无法直接访问节点,如何找出集群中正在运行的Docker版本?

3 个答案:

答案 0 :(得分:7)

您可以使用以下命令查找容器运行时及其版本:

kubectl get node <node> -o jsonpath="{.status.nodeInfo.containerRuntimeVersion}"

答案 1 :(得分:4)

以下var lightReq = new XMLHttpRequest(); if ("withCredentials" in lightReq) { lightReq.open('PUT',stringChange,true); if (value == false) { lightReq.send("{\"on\":true}"); } else { lightReq.send("{\"on\":false}"); } } 命令将显示群集中节点的详细信息:

kubectl

节点的一个实例如下所示:

kubectl describe nodes

节点上运行的Name: node3-virtualbox Roles: <none> Labels: beta.kubernetes.io/arch=amd64 beta.kubernetes.io/os=linux kubernetes.io/hostname=node3-virtualbox Annotations: node.alpha.kubernetes.io/ttl=0 volumes.kubernetes.io/controller-managed-attach-detach=true Taints: <none> CreationTimestamp: Tue, 05 Dec 2017 07:01:42 +0100 Conditions: Type Status LastHeartbeatTime LastTransitionTime Reason Message ---- ------ ----------------- ------------------ ------ ------- OutOfDisk False Tue, 05 Dec 2017 22:52:05 +0100 Tue, 05 Dec 2017 17:08:13 +0100 KubeletHasSufficientDisk kubelet has sufficient disk space available MemoryPressure False Tue, 05 Dec 2017 22:52:05 +0100 Tue, 05 Dec 2017 21:08:21 +0100 KubeletHasSufficientMemory kubelet has sufficient memory available DiskPressure False Tue, 05 Dec 2017 22:52:05 +0100 Tue, 05 Dec 2017 21:08:21 +0100 KubeletHasNoDiskPressure kubelet has no disk pressure Ready False Tue, 05 Dec 2017 22:52:05 +0100 Tue, 05 Dec 2017 21:08:21 +0100 KubeletNotReady runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized Addresses: InternalIP: 10.0.2.15 Hostname: node3-virtualbox Capacity: cpu: 1 memory: 2048268Ki pods: 110 Allocatable: cpu: 1 memory: 1945868Ki pods: 110 System Info: Machine ID: 9654f9402bfc4042b82b454e323cf46c System UUID: 6EBA3E13-624C-4C82-A8EA-24FF86FA6E66 Boot ID: c7217654-8514-482c-9899-f04a3d3ce6d8 Kernel Version: 4.4.0-101-generic OS Image: Ubuntu 16.04.1 LTS Operating System: linux Architecture: amd64 Container Runtime Version: docker://1.13.1 Kubelet Version: v1.8.4 Kube-Proxy Version: v1.8.4 ExternalID: node3-virtualbox Non-terminated Pods: (2 in total) Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits --------- ---- ------------ ---------- --------------- ------------- kube-system kube-proxy-sxp5s 0 (0%) 0 (0%) 0 (0%) 0 (0%) kube-system weave-net-6jf98 20m (2%) 0 (0%) 0 (0%) 0 (0%) Allocated resources: (Total limits may be over 100 percent, i.e., overcommitted.) CPU Requests CPU Limits Memory Requests Memory Limits ------------ ---------- --------------- ------------- 20m (2%) 0 (0%) 0 (0%) 0 (0%) Events: <none> 可以在系统信息中找到,例如在上面的情况中:

容器运行时版本:docker://1.13.1

答案 2 :(得分:0)

尝试 kubectl获取-o宽的节点,并检查CONTAINER-RUNTIME列,这里是我的AKS示例:

t@Azure:/$  kubectl get nodes -o wide
NAME                       STATUS   ROLES   AGE    VERSION   INTERNAL-IP   EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
aks-agentpool-311111-0   Ready    agent   4d1h   v1.12.8   10.240.0.66   <none>        Ubuntu 16.04.6 LTS   4.15.0-1042-azure   docker://3.0.4
aks-agentpool-311111-1   Ready    agent   4d     v1.12.8   10.240.0.35   <none>        Ubuntu 16.04.6 LTS   4.15.0-1042-azure   docker://3.0.4
aks-agentpool-311111-3   Ready    agent   4d1h   v1.12.8   10.240.0.97   <none>        Ubuntu 16.04.6 LTS   4.15.0-1042-azure   docker://3.0.4