• kuberneets 1.17 设置 kube-reserved, system-reserved


    主要修改 kubelet的启动命令 增加reserved相关参数

    [Unit]
       Description=Kubernetes Kubelet Server
       After=docker.service
       Requires=docker.service
    [Service]
       ExecStartPre=/usr/bin/mkdir -p /sys/fs/cgroup/pids/system.slice/kubelet.service
       ExecStartPre=/usr/bin/mkdir -p /sys/fs/cgroup/cpu/system.slice/kubelet.service
       ExecStartPre=/usr/bin/mkdir -p /sys/fs/cgroup/cpuacct/system.slice/kubelet.service
       ExecStartPre=/usr/bin/mkdir -p /sys/fs/cgroup/cpuset/system.slice/kubelet.service
       ExecStartPre=/usr/bin/mkdir -p /sys/fs/cgroup/memory/system.slice/kubelet.service
       ExecStartPre=/usr/bin/mkdir -p /sys/fs/cgroup/systemd/system.slice/kubelet.service
       WorkingDirectory=/var/lib/kubelet
       EnvironmentFile=-/etc/kubernetes/config
       EnvironmentFile=-/etc/kubernetes/kubelet
       ExecStart=/root/k8s/cmd/kubelet 
                   $KUBE_LOGTOSTDERR 
                   $KUBE_LOG_LEVEL 
                   $KUBELET_API_SERVER 
                   $KUBELET_PORT 
                   $KUBELET_HOSTNAME 
                   $KUBELET_POD_INFRA_CONTAINER 
                   $KUBELET_ARGS 
                   --network-plugin=cni 
                   --feature-gates=LocalStorageCapacityIsolationFSQuotaMonitoring=true 
                   --kube-reserved=cpu=6,memory=8Gi,ephemeral-storage=4Gi 
                   --enforce-node-allocatable=pods,kube-reserved 
                   --kube-reserved-cgroup=/system.slice/kubelet.service 
                   --root-dir=/home/kubelet 
                   --v=2
    Restart=on-failure
    [Install]
    WantedBy=multi-user.target
    

      

    在实际使用中没有增加system-reserved参数,由于有些场景预留资源给少了会早知 device busy的错误 可以参考 https://github.com/rootsongjc/qa/issues/3

    上边那些 ExecStartPre  还创建的,具体参考上边的issue

    添加完成后 重启kubelet 查看资源信息

    Capacity:
      cpu:                48
      ephemeral-storage:  1892365528Ki
      hugepages-1Gi:      0
      hugepages-2Mi:      0
      memory:             131142712Ki
      nvidia.com/gpu:     2
      pods:               110
    Allocatable:
      cpu:                42
      ephemeral-storage:  1888171224Ki
      hugepages-1Gi:      0
      hugepages-2Mi:      0
      memory:             122242104Ki
      nvidia.com/gpu:     2
      pods:               110
    

      

    如果 

    grep CGROUP_HUGETLB /boot/config-xxxxx

    CONFIG_CGROUP_HUGETLB=y

    需要在kubelet.service中加入

    ExecStartPre=/usr/bin/mkdir -p /sys/fs/cgroup/hugetlb/system.slice/kubelet.service

    来解决
    hugetlb.1GB.limit_in_bytes: no such file or directory


  • 相关阅读:
    7.3---直线是否相交(CC150)
    7.2---蚂蚁相遇问题(CC150)
    5.6---交换整数的奇数位和偶数位(CC150)
    5.5---整数A转成整数B(CC150)
    5.2---小数的二进制表示(CC150)
    5.1---二进制数插入(CC150)
    4.6---找二叉树中序后继(CC150)
    4.5---判断是否是二叉排序树BST(CC150)
    4.4---建立二叉树的链表
    linux中查看java进程
  • 原文地址:https://www.cnblogs.com/xuchenCN/p/12205600.html
Copyright © 2020-2023  润新知