Kubernetes使用Docker,而kubelet为任何给定的集群规定了兼容的Docker版本.
我的问题是,鉴于已经配置并运行的Kubernetes集群,如果我无法直接访问节点,如何找出集群中正在运行的Docker版本?
Nic*_*lay 11
您可以使用以下命令查找容器运行时及其版本:
kubectl get node <node> -o jsonpath="{.status.nodeInfo.containerRuntimeVersion}"
Run Code Online (Sandbox Code Playgroud)
小智 5
以下kubectl命令将显示集群中节点的详细信息:
kubectl describe nodes
Run Code Online (Sandbox Code Playgroud)
节点的一个实例如下所示:
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>
Run Code Online (Sandbox Code Playgroud)
在docker version该节点上运行中可以找到系统信息:,例如,在上述的情况下:
容器运行时版本:docker://1.13.1
| 归档时间: |
|
| 查看次数: |
2705 次 |
| 最近记录: |