k8s部署单控制平面集群(二)

2. Nodes资源管理

     2.1 查看资源的简略信息

     2.2 查看资源的扩展信息

     2.3 查看资源的详细信息

     2.4 查看资源的yaml文件格式

     2.5 查看资源的json文件格式

3. Label与Annotation

    3.1 Label

    3.2 Annotation

2. Nodes资源管理

2.1 查看资源的简略信息

kubectl get nodes
   # 解析:
     NAME:node的名称
     STATUS:node的状态
     ROLES: node的角色
     AGE:node的生命周期
     VERSION:kubernetes版本

2.2 查看资源的扩展信息

kubectl get nodes -o wide
# 解析:
    INTERNAL-IP::内部IP
    EXTERNAL-IP:外部IP
    OS-IMAGE:系统版本
    KERNEL-VERSION;系统内核版本
    CONTAINER-RUNTIME:container runtime的版本

2.3 查看资源的详细信息

kubectl describe nodes master01 
# 解析:
capacity:描述节点上的总资源:CPU、内存和可以调度到节点上的最pod数量;
allocatable: 描述可分配的资源;
conditions: 
    MemoryPressure:
        status: True    节点内存存在压力或者不足
        status: False   节点内存正常无压力
        DiskPressure:
        status: True    磁盘容量存在压力或者容量低
        status: False   磁盘容量正常无压力
    PIDPressure:
        status: True    进程上存在压力或者进程过多
        status: False   进程正常无压力
    Ready:
        status: True    节点是健康正常
        status: False   节点不健康
    OutOfDisk:
        status: True    如果节点上没有足够的空闲空间来添加新的pod  
        status: False   节点上有空闲的空间
    NetworkUnavailable:
        status: True    节点的网络配置不正确
        status: False   节点的网络配置正确

2.4 查看资源的yaml文件格式

kubectl get nodes master01 -o yaml

2.5 查看资源的json文件格式

kubectl get nodes master01 -o json

3. Label与Annotation

3.1 Label

查看资源的标签信息

kubectl get nodes --show-labels

或者

kubectl describe nodes node01

Label的添加与删除,Key必须存在且唯一,Value可以为空、且不唯一

# 添加Label

kubectl label nodes node01 node-role.kubernetes.io/work=

# 删除Label

kubectl label nodes node01 node-role.kubernetes.io/work-

查看node的角色

kubectl get nodes

3.2 Annotation

查看Annotation

kubectl describe resource_type/resource_name

Annotation的添加与删除,#Key必须存在且唯一,Value可以为空、且不唯一

添加Annotation
kubectl annotate resource_type resource_name key=value​
# 删除Annotation
kubectl annotate resource_type resource_name key-
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值