centos 7 kubernetes v1.11 配置节点资源保留

作者: admin 分类: kubernetes 发布时间: 2018-09-29 09:49 ė 6 没有评论

vim /etc/kubernetes/start-kubelet.conf

systemReserved:
  cpu: '5'
  memory: 15Gi
kubeReserved:
  cpu: '2'
  memory: 2Gi
enforceNodeAllocatable:
- pods
kind: KubeletConfiguration
apiVersion: kubelet.config.k8s.io/v1beta1
evictionHard:
  imagefs.available: 15%
  memory.available: 2Gi
  nodefs.available: 10%
  nodefs.inodesFree: 5%
evictionSoft:
  memory.available: 5Gi
evictionSoftGracePeriod:
  memory.available: 1m30s

vim /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true"
Environment="KUBELET_NETWORK_ARGS=--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
Environment="KUBELET_DNS_ARGS=--cluster-dns=10.10.0.1 --cluster-domain=test.qq.com"
Environment="KUBELET_AUTHZ_ARGS=--authorization-mode=Webhook --client-ca-file=/etc/kubernetes/pki/ca.crt"
Environment="KUBELET_CADVISOR_ARGS=--cadvisor-port=0"
Environment="KUBELET_CGROUP_ARGS=--cgroup-driver=systemd"
Environment="KUBELET_CERTIFICATE_ARGS=--rotate-certificates=true --cert-dir=/var/lib/kubelet/pki"
Environment="KUBELET_CONFIG_ARGS=--config=/etc/kubernetes/start-kubelet.conf"
#Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kube-proxy/config.conf
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_SYSTEM_PODS_ARGS $KUBELET_NETWORK_ARGS $KUBELET_DNS_ARGS $KUBELET_AUTHZ_ARGS $KUBELET_CADVISOR_ARGS $KUBELET_CGROUP_ARGS $KUBELET_CERTIFICATE_ARGS $KUBELET_EXTRA_ARGS $KUBELET_CONFIG_ARGS

参考文档 :https://kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/
https://kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/

本文出自 小Q,转载时请注明出处及相应链接。

本文永久链接: http://www.linuxqq.com/archives/1941.html

0
更多
Ɣ回顶部