kubelet配置详解及简单实例
kubelet配置详解及简单实例
摘要:这两天试着重新去理解kubelet的每一个配置,并整理出我们最有可能要配置的项作为我们上生产的要考虑的kubelet最佳配置。
author:garnett.wang@gmail.com
kubernetesversion:1.6.2
KubeletConfigurationsWeShouldCareAbout
下面是我梳理的,我认为必须关注的flag。
flag | value |
---|---|
--address | 0.0.0.0 |
--allow-privileged | false |
--cadvisor-portint32 | 4194 |
--cgroup-driverstring | cgroupfs |
--cluster-dnsstringSlice | 10.0.0.10//todo |
--cluster-domainstring | caas.vivo.com |
--cni-bin-dirstring | /opt/cni/bin |
--cni-conf-dirstring | /etc/cni/net.d |
--docker-endpointstring | unix:///var/run/docker.sock |
--eviction-hard string | memory.available<4Gi, nodefs.available<20Gi, imagefs.available<5Gi |
--eviction-max-pod-grace-period int32 | 30 |
--eviction-minimum-reclaim string | memory.available=500Mi, nodefs.available=2Gi,, imagefs.available=2Gi |
--eviction-pressure-transition-periodduration | 5m0s |
--eviction-softstring | memory.available<8Gi, nodefs.available<100Gi, imagefs.available<20Gi |
--eviction-soft-grace-period string | memory.available=30s, nodefs.available=2m, imagefs.available=2m |
--experimental-fail-swap-on | + |
--experimental-kernel-memcg-notification | + |
--feature-gatesstring | AllAlpha=false |
--file-check-frequency duration | 20s |
--hairpin-modestring | promiscuous-bridge |
--healthz-portint32 | 10248 |
--image-gc-high-threshold int32 | 60 |
--image-gc-low-threshold int32 | 40 |
--image-pull-progress-deadlineduration | 2m0s |
--kube-api-qpsint32 | 5 |
--kube-reservedmapStringString | cpu=200m,memory=16G |
--kubeconfig string | /var/lib/kubelet/kubeconfig |
--max-podsint32 | 50 |
--minimum-image-ttl-durationduration | 1h |
--network-plugin string | cni |
--pod-infra-container-image string | vivo.registry.com/google_containers/pause-amd64:3.0 |
--pod-manifest-path string | /var/lib/kubelet/pod_manifest |
--portint32 | 10250 |
--protect-kernel-defaults | + |
--read-only-portint32 | 10255 |
--require-kubeconfig | + |
--root-dirstring | /var/lib/kubelet |
--runtime-request-timeoutduration | 2m0s |
--serialize-image-pulls | false |
--sync-frequencyduration | 1m0s |
--system-reservedmapStringString | cpu=100m,memory=32G |
--volume-plugin-dirstring | /usr/libexec/kubernetes/kubelet-plugins/volume/exec/ |
--volume-stats-agg-periodduration | 1m0s |
下面是我最终梳理的,认为需要真正显示设置的flag,如下:
/usr/bin/kubelet—address=0.0.0.0 --port=10250 --allow-privileged=false --cluster-dns=10.0.0.1 --cluster-domain=caas.vivo.com --max-pods=50 --network-plugin=cni --require-kubeconfig --pod-manifest-path=/etc/kubelet.d/ --pod-infra-container-image=vivo.registry.com/google_containers/pause-amd64:3.0 --eviction-hard=memory.available<4Gi,nodefs.available<20Gi,imagefs.available<5Gi --eviction-max-pod-grace-period=30 --eviction-minimum-reclaim=memory.available=500Mi,nodefs.available=2Gi,imagefs.available=2Gi --eviction-pressure-transition-period=5m0s --eviction-soft=memory.available<8Gi,nodefs.available<100Gi,imagefs.available<20Gi --eviction-soft-grace-period=memory.available=30s,nodefs.available=2m,imagefs.available=2m --experimental-kernel-memcg-notification --experimental-fail-swap-on --system-reserved=cpu=100m,memory=8G --kube-reserved=cpu=200m,memory=16G --hairpin-mode=promiscuous-bridge --image-gc-high-threshold=60 --image-gc-low-threshold=40 --serialize-image-pulls=false --protect-kernel-defaults --feature-gates=AllAlpha=false
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!