一、注意事项
·如果当前开放的参数不满足你的业务需求,你可以 提交工单 进行咨询。在提交工单时,请提供账号 APPID、集群 ID、需要设置的组件和组件的参数。
·集群大版本升级场景:由于 Kubernetes 跨版本升级后,启动参数可能存在不兼容的情况,升级前请确认是否存在参数废弃情况。
二、参数介绍
以下是用户可自定义配置的参数范围和 TKE 集群提供的默认值。请确保你修改的参数取值在系统支持的范围内。每个参数的具体含义可以从社区获取。
针对 feature-gates 参数,如果当前版本没有可用的 feature-gate,则无法设置。
三、APIServer
| 参数名称 | 参数类型 | 默认值 | 取值范围 | K8s 适用版本 |
| –feature-gates | mapStringBool | – | – | 1.16+ |
| –goaway-chance | float | 0 | [0, 0.02] | 1.18+ |
| –service-node-port-range | portRange | 30000-32767 | 10500-32767 | 1.20+ |
| –kubelet-preferred-address-types | strings | Hostname,InternalDNS,InternalIP,ExternalDNS,ExternalIP | ('Hostname','InternalDNS','InternalIP','ExternalDNS','ExternalIP') | 1.20+ |
四、KubeControllerManager
| 参数名称 | 参数类型 | 默认值 | 取值范围 | K8s 适用版本 |
| –kube-api-burst | int | 30 | [30, 3000] | 1.14+ |
| –kube-api-qps | qps | 20 | [20, 5000] | 1.14+ |
| –node-monitor-grace-period | duration | 40s | [40s, 1h] | 1.14+ |
| –node-startup-grace-period | duration | 1m0s | [1m, 1h] | 1.14+ |
| –pod-eviction-timeout | duration | 5m | [5m, 1h] | 1.14-1.24 |
| –cluster-signing-duration | duration | 8760h0m0s | [8760h, 87600h] | 1.20+ |
| –concurrent-cron-job-syncs | int | 5 | [5, 20] | 1.20+ |
| –concurrent-deployment-syncs | int | 5 | [5, 20] | 1.14+ |
| –concurrent-endpoint-syncs | int | 5 | [5, 20] | 1.14+ |
| –concurrent-ephemeralvolume-syncs | int | 5 | [5, 20] | 1.24+ |
| –concurrent-gc-syncs | int | 20 | [20, 50] | 1.14+ |
| –concurrent-horizontal-pod-autoscaler-syncs | int | 5 | [5, 20] | 1.26+ |
| –concurrent-job-syncs | int | 5 | [5, 20] | 1.14+ |
| –concurrent-namespace-syncs | int | 10 | [10, 20] | 1.14+ |
| –concurrent-rc-syncs | int | 5 | [5, 20] | 1.14+ |
| –concurrent-replicaset-syncs | int | 5 | [5, 20] | 1.14+ |
| –concurrent-resource-quota-syncs | int | 5 | [5, 20] | 1.14+ |
| –concurrent-service-endpoint-syncs | int | 5 | [5, 20] | 1.16+ |
| –concurrent-service-syncs | int | 1 | [1, 5] | 1.14+ |
| –concurrent-serviceaccount-token-syncs | int | 5 | [5, 20] | 1.14+ |
| –concurrent-statefulset-syncs | int | 5 | [5, 20] | 1.16+ |
| –concurrent-ttl-after-finished-syncs | int | 5 | [5, 20] | 1.14+ |
| –endpoint-updates-batch-period | duration | 0 | [0s, 10s] | 1.14+ |
| –endpointslice-updates-batch-period | duration | 0 | [0s, 10s] | 1.18+ |
| –horizontal-pod-autoscaler-cpu-initialization-period | duration | 5m0s | [1m,10m] | 1.14+ |
| –horizontal-pod-autoscaler-downscale-stabilization | duration | 5m0s | [1m,10m] | 1.14+ |
| –horizontal-pod-autoscaler-initial-readiness-delay | duration | 30s | [10s,1m] | 1.14+ |
| –horizontal-pod-autoscaler-sync-period | duration | 15s | [5s, 1m] | 1.14+ |
| –horizontal-pod-autoscaler-tolerance | float | 0.1 | [0.01, 0.3] | 1.14+ |
| –large-cluster-size-threshold | int | 50 | [10, 100] | 1.14+ |
| –namespace-sync-period | duration | 5m0s | [1m, 10m] | 1.14+ |
| –node-eviction-rate | float | 0.1 | [0.01, 0.1] | 1.14+ |
| –resource-quota-sync-period | duration | 5m0s | [1m, 10m] | 1.14+ |
| –secondary-node-eviction-rate | float | 0.01 | [0.001, 0.01] | 1.14+ |
| –terminated-pod-gc-threshold | int | 12500 | [0, 12500] | 1.14+ |
| –unhealthy-zone-threshold | float | 0.55 | [0.55, 1] | 1.14+ |
| –feature-gates | mapStringBool | – | – | 1.14+ |
五、KubeScheduler
| 参数名称 | 参数类型 | 默认值 | 取值范围 | K8s 适用版本 |
| –evict-filter-toleration | duration | 5m0s | [30s,240h] | 1.18+ |
| –hard-pod-affinity-symmetric-weight | int | 1 | [0,100] | 1.14-1.20 |
| –kube-api-burst | int | 100 | [30,3000] | 1.14+ |
| –kube-api-qps | float | 50 | [20,5000] | 1.14+ |
| –feature-gates | mapStringBool | – | – | 1.14+ |
| –feature-gates=EnableEvictHistory | – | – | – | 1.14+ |
| –feature-gates=EnableFitIPResource | – | – | – | 1.14+ |
| –feature-gates=EnableLocalReplicas | – | – | – | 1.20、1.24+ |
以下 feature-gates 参数在 APIServer、KubeControllerManager、KubeScheduler 组件中都支持设置:
| feature-gates 名称 | 支持版本 |
| StatefulSetStartOrdinal | 1.26、1.28 |
| TTLAfterFinished | 1.14、1.16、1.18、1.20 |
| MaxUnavailableStatefulSet | 1.24、1.26、1.28 |
| EphemeralContainers | 1.16、1.18、1.20、1.22 |
六、创建集群
1. 登录 腾讯云容器服务控制台,单击左侧导航栏中的集群。
2. 在集群页面,单击集群列表上方的新建。
3. 在创建集群页面,选择高级设置 > 设置 kubernetes 自定义组件参数。
七、已有集群
1. 登录 腾讯云容器服务控制台,单击左侧导航栏中的集群。
2. 在集群页面,选择目标集群 ID,进入基本信息页。
3. 在左侧导航中选择节点管理,选择 Master&Etcd。
4. 单击自定义参数模块中的编辑来配置参数:
注意:控制面组件参数修改后需要滚动更新生效,为避免对业务产生影响,建议你在业务低峰期时间操作。
八、集群升级
1. 登录 腾讯云容器服务控制台,单击左侧导航栏中的集群。
2. 在集群页面,选择目标集群 ID,进入基本信息页。
3. 在集群基本信息中,单击 Kubernetes 版本右侧的升级,同时设置 Kubernetes 组件启动参数:
注意:部分启动参数将随着 Kubernetes 版本的演进不再支持,建议你在升级前谨慎了解目标升级版本和当前参数是否存在废弃和不兼容的情况,更多信息可参考社区 Kubernetes Changelog和 API 迁移指南 获取。