kube-scheduler最佳配置

Posted WaltonWang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了kube-scheduler最佳配置相关的知识,希望对你有一定的参考价值。

version: kubernetes 1.6.2

kube-scheduler Configuration

下面是我梳理的kube-scheduler的完成配置:

flagdefault valuecomments
–address string0.0.0.0The IP address to serve on (set to 0.0.0.0 for all interfaces) (default “0.0.0.0”)
–algorithm-provider stringDefaultProviderThe scheduling algorithm provider to use, one of: DefaultProvider
–failure-domains stringkubernetes.io/hostname,
failure-domain.beta.kubernetes.io/zone,
failure-domain.beta.kubernetes.io/region
Indicate the “all topologies” set for an empty topologyKey when it’s used for PreferredDuringScheduling pod anti-affinity. (default “kubernetes.io/hostname,failure-domain.beta.kubernetes.io/zone,failure-domain.beta.kubernetes.io/region”)
–feature-gates valueA set of key=value pairs that describe feature gates for alpha/experimental features. Options are:
AllAlpha=true
–google-json-key stringThe Google Cloud Platform Service Account JSON Key to use for authentication.
–hard-pod-affinity-symmetric-weight int1RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule corresponding to every RequiredDuringScheduling affinity rule. –hard-pod-affinity-symmetric-weight represents the weight of implicit PreferredDuringScheduling affinity rule. (default 1)
–kube-api-burst value100Burst to use while talking with kubernetes apiserver (default 100)
–kube-api-content-type stringapplication/vnd.kubernetes.protobufContent type of requests sent to apiserver. (default “application/vnd.kubernetes.protobuf”)
–kube-api-qps value50QPS to use while talking with kubernetes apiserver (default 50)
–kubeconfig stringPath to kubeconfig file with authorization and master location information.
–leader-electtrueStart a leader election client and gain leadership before executing the main loop. Enable this when running replicated components for high availability. (default true)
–leader-elect-lease-duration duration15sThe duration that non-leader candidates will wait after observing a leadership renewal until attempting to acquire leadership of a led but unrenewed leader slot. This is effectively the maximum duration that a leader can be stopped before it is replaced by another candidate. This is only applicable if leader election is enabled. (default 15s)
–leader-elect-renew-deadline duration10sThe interval between attempts by the acting master to renew a leadership slot before it stops leading. This must be less than or equal to the lease duration. This is only applicable if leader election is enabled. (default 10s)
–leader-elect-retry-period duration2sThe duration the clients should wait between attempting acquisition and renewal of a leadership. This is only applicable if leader election is enabled. (default 2s)
–master stringThe address of the Kubernetes API server (overrides any value in kubeconfig)
–policy-config-file stringFile with scheduler policy configuration
–port value10251The port that the scheduler’s http service runs on (default 10251)
–profilingtrueEnable profiling via web interface host:port/debug/pprof/ (default true)
–scheduler-name stringdefault-schedulerName of the scheduler, used to select which pods will be processed by this scheduler, based on pod’s annotation with key ‘scheduler.alpha.kubernetes.io/name’ (default “default-scheduler”)

kube-scheduler Configuration Best Practices

下面是我梳理的,个人认为必须关注的配置:

flagdefault valuecomments
–address string0.0.0.0The IP address to serve on (set to 0.0.0.0 for all interfaces) (default “0.0.0.0”)
–kubeconfig stringPath to kubeconfig file with authorization and master location information.
–master stringThe address of the Kubernetes API server (overrides any value in kubeconfig)
–policy-config-file stringFile with scheduler policy configuration
–port value10251The port that the scheduler’s http service runs on (default 10251)
–profilingtrueEnable profiling via web interface host:port/debug/pprof/ (default true)

以上是关于kube-scheduler最佳配置的主要内容,如果未能解决你的问题,请参考以下文章

k8s调度器启动流程分析 | 视频文字稿

kube-scheduler 磁盘调度源码分析

k8s二进制安装kube-scheduler

06-4.部署高可用 kube-scheduler 集群

原创k8s源码分析-----kube-scheduler

Kubernetes学习二:Kubernetes集群搭建之部署kubernetes server