跳到主要内容
版本:v1.5 🚧

安装

Koordinator 依赖 Kubernetes version >= 1.18

Koordinator 需要从 kubelet 只读端口收集指标(默认设置为禁用)。 更多信息 here.

为了最好的体验,koordinator 推荐 linux kernel 4.19 或者更高版本。

使用 Helm 安装

Koordinator 可以使用 Helm v3.5+ 安装, Helm 是一个简单的命令行工具,更多信息 here.

# Firstly add koordinator charts repository if you haven't do this.
$ helm repo add koordinator-sh https://koordinator-sh.github.io/charts/

# [Optional]
$ helm repo update

# Install the latest version.
$ helm install koordinator koordinator-sh/koordinator --version 1.4.1

使用 Helm 升级

# Firstly add koordinator charts repository if you haven't do this.
$ helm repo add koordinator-sh https://koordinator-sh.github.io/charts/

# [Optional]
$ helm repo update

# Upgrade the latest version.
$ helm upgrade koordinator koordinator-sh/koordinator --version 1.4.1 [--force]

注意:

  1. 升级前,为确保你了解新版本中的重大更改,你 必须 先阅读 变更日志
  2. 如果你想删除或者新增旧版本中的 Chart 参数,推荐在 helm upgrade 命令中添加参数 --reset-values 。否则,你应该使用 --reuse-values 参数来恢复上一个版本的值。

可选:手动下载 Charts

如果你在生产环境中连接到 https://koordinator-sh.github.io/charts/ 时遇到问题,你可能需要从 此处 手动下载 Charts 进行安装或升级。

$ helm install/upgrade koordinator /PATH/TO/CHART

可选:启用 NRI 资源管理模式

前置条件

  • Containerd >= 1.7.0 且配置启用 NRI。请确保 NRI 已在 containerd 中启用,否则请参考 Enable NRI in Containerd
  • Koordinator >= 1.3

配置方式

NRI 资源管理模式是默认启用的。你无需修改 koordlet 配置就可以使用它,也可以通过设置 enable-nri-runtime-hook=false 的 koordlet 启动参数来禁用它。当它的前置条件不满足时,启用也不会影响其他功能。

可选

请注意,直接安装这个 Chart 意味着使用 Koordinator 的默认模板值。

如果将其部署到生产集群中,或者你想要配置 feature-gates,你可能需要设置特定配置。

可选: Chart 参数

下表列出了 Chart 可配置参数及其默认值。

ParameterDescriptionDefault
featureGatesFeature gates for Koordinator, empty string means all by default
installation.namespacenamespace for Koordinator installationkoordinator-system
installation.createNamespaceWhether to create the installation.namespacetrue
imageRepositoryHostImage repository hostghcr.io
manager.log.levelLog level that koord-manager printed4
manager.replicasReplicas of koord-manager deployment2
manager.image.repositoryRepository for koord-manager imagekoordinatorsh/koord-manager
manager.image.tagTag for koord-manager imagev1.4.0
manager.resources.limits.cpuCPU resource limit of koord-manager container1000m
manager.resources.limits.memoryMemory resource limit of koord-manager container1Gi
manager.resources.requests.cpuCPU resource request of koord-manager container500m
manager.resources.requests.memoryMemory resource request of koord-manager container256Mi
manager.metrics.portPort of metrics served8080
manager.webhook.portPort of webhook served9443
manager.nodeAffinityNode affinity policy for koord-manager pod{}
manager.nodeSelectorNode labels for koord-manager pod{}
manager.tolerationsTolerations for koord-manager pod[]
manager.resyncPeriodResync period of informer koord-manager, defaults no resync0
manager.hostNetworkWhether koord-manager pod should run with hostnetworkfalse
scheduler.log.levelLog level that koord-scheduler printed4
scheduler.replicasReplicas of koord-scheduler deployment2
scheduler.image.repositoryRepository for koord-scheduler imagekoordinatorsh/koord-scheduler
scheduler.image.tagTag for koord-scheduler imagev1.4.0
scheduler.resources.limits.cpuCPU resource limit of koord-scheduler container1000m
scheduler.resources.limits.memoryMemory resource limit of koord-scheduler container1Gi
scheduler.resources.requests.cpuCPU resource request of koord-scheduler container500m
scheduler.resources.requests.memoryMemory resource request of koord-scheduler container256Mi
scheduler.portPort of metrics served10251
scheduler.nodeAffinityNode affinity policy for koord-scheduler pod{}
scheduler.nodeSelectorNode labels for koord-scheduler pod{}
scheduler.tolerationsTolerations for koord-scheduler pod[]
scheduler.hostNetworkWhether koord-scheduler pod should run with hostnetworkfalse
koordlet.log.levelLog level that koordlet printed4
koordlet.image.repositoryRepository for koordlet imagekoordinatorsh/koordlet
koordlet.image.tagTag for koordlet imagev1.4.0
koordlet.resources.limits.cpuCPU resource limit of koordlet container500m
koordlet.resources.limits.memoryMemory resource limit of koordlet container256Mi
koordlet.resources.requests.cpuCPU resource request of koordlet container0
koordlet.resources.requests.memoryMemory resource request of koordlet container0
koordlet.enableServiceMonitorWhether to enable ServiceMonitor for koordletfalse
webhookConfiguration.failurePolicy.podsThe failurePolicy for pods in mutating webhook configurationIgnore
webhookConfiguration.timeoutSecondsThe timeoutSeconds for all webhook configuration30
crds.managedKoordinator will not install CRDs with chart if this is falsetrue
imagePullSecretsThe list of image pull secrets for koordinator imagefalse

使用 helm installhelm upgrade--set key=value[,key=value] 参数指定每个参数。

可选: feature-gate

Feature-Gate 控制 Koordinator 中的一些有影响力的功能:

NameDescriptionDefaultEffect (if closed)
PodMutatingWebhookWhether to open a mutating webhook for Pod createtrueDon't inject koordinator.sh/qosClass, koordinator.sh/priority and don't replace koordinator extend resources ad so on
PodValidatingWebhookWhether to open a validating webhook for Pod create/updatetrueIt is possible to create some Pods that do not conform to the Koordinator specification, causing some unpredictable problems

如果要配置 feature-gate ,只需在安装或升级时设置参数即可。如:

$ helm install koordinator https://... --set featureGates="PodMutatingWebhook=true\,PodValidatingWebhook=true"

如果要启用所有 feature-gates ,请将参数设置为 featureGates=AllAlpha=true

可选: 中国本地镜像

如果你在中国并且无法从官方 DockerHub 拉取镜像,你可以使用托管在阿里云上的镜像仓库:

$ helm install koordinator https://... --set imageRepositoryHost=registry.cn-beijing.aliyuncs.com

最佳实践

AWS EKS 的安装参数

在 EKS 上使用自定义 CNI(例如 Weave 或 Calico)时,默认情况下无法访问 webhook。发生这种情况是因为在 EKS 上控制平面无法配置运行自定义 CNI ,因此控制平面和工作节点之间的 CNI 不同。

为了解决这个问题,使用 helm install 或 upgrade 时设置 --set manager.hostNetwork=true,webhook 可以在主机网络中运行。

卸载

请注意,这将导致 Koordinator 创建的所有资源,包括 Webhook 配置、Services、Namespace、CRD 和由 Koordinator 控制器管理的 CR 实例,都被删除! 请在充分了解后果的情况下才这样做。

卸载通过 Chart 安装的 Koordinator :

$ helm uninstall koordinator
release "koordinator" uninstalled