云服务器内容精选

  • 为什么需要自动切流 MCI提供了一种跨集群的负载均衡和流量路由机制,提高了应用程序的可用性和可靠性。然而,当集群出现故障后,通过MCI分配到该集群上的请求将会失败。 U CS 提供自动切流能力,可自动摘除故障集群上的流量,以进一步保障服务的可用性。自动切流能力的应用场景主要有: 识别集群故障并自动切流:在集群内关键组件CoreDNS功能故障后,自动探查并及时上报至控制面,将该集群上的流量摘除,由此保障服务可用性不受单个集群组件故障影响。具体切流操作请参见配置条件触发自动切流。 提前摘除流量以平滑升级:在集群管理员进行集群升级等操作前,提前将该集群上的流量摘除,操作成功后再切回流量,由此保障服务可用性不受单个集群升级影响。具体切流操作请参见配置无条件触发自动切流。
  • 配置无条件触发自动切流 集群管理员进行集群升级等操作,若出现升级策略不恰当、升级配置有误、操作人员执行失误等问题,可能会导致集群不可用。本小节指导您在进行集群升级前,通过创建无条件触发的Remedy对象,将MCI流量从目标集群上摘除。 创建Remedy对象可在特定触发条件下执行特定动作。集群管理员准备升级目标集群时(如member1),可以创建如下Remedy对象,将MCI流量从member1上摘除。 示例YAML定义了一个Remedy对象,触发条件为空,表示无条件触发,集群联邦控制器会立即将member1上的流量摘除。在集群升级成功之后,删除该Remedy对象,member1上的流量会自动恢复,由此保证单集群的升级不会影响服务的高可用。详细的Remedy对象参数说明请参见表1。 apiVersion: remedy.karmada.io/v1alpha1 kind: Remedy metadata: name: foo spec: clusterAffinity: clusterNames: - member1 actions: - TrafficControl 表1 Remedy参数说明 参数 描述 spec.clusterAffinity.clusterNames 策略关注的集群名列表。仅在该列表中的集群会执行指定动作,为空时不会执行任何动作。 spec.decisionMatches 触发条件列表。当上述集群列表中指定的集群满足任一触发条件时,即会执行指定动作。当列表为空时,表示无条件触发。 conditionType 触发条件的类型。当前仅支持ServiceDomainNameResolutionReady类型,即CPD上报的CoreDNS 域名 解析状态。 operator 判断逻辑,仅支持Equal和NotEqual两种值,即等于和不等于。 conditionStatus 触发条件的状态。 actions 策略要执行的动作,目前仅支持TrafficControl,即流量控制。 父主题: 配置MCI自动切流
  • Prometheus指标采集 volcano-scheduler通过端口8080暴露Prometheus metrics指标。您可以自建Prometheus采集器识别并通过http://{{volcano-schedulerPodIP}}:{{volcano-schedulerPodPort}}/metrics路径获取volcano-scheduler调度相关指标。 Prometheus指标暴露仅支持volcano插件1.8.5及以上版本。 表3 关键指标说明 指标名称 指标类型 描述 Labels e2e_scheduling_latency_milliseconds Histogram 端到端调度时延毫秒(调度算法+绑定) - e2e_job_scheduling_latency_milliseconds Histogram 端到端作业调度时延(毫秒) - e2e_job_scheduling_duration Gauge 端到端作业调度时长 labels=["job_name", "queue", "job_namespace"] plugin_scheduling_latency_microseconds Histogram 插件调度延迟(微秒) labels=["plugin", "OnSession"] action_scheduling_latency_microseconds Histogram 动作调度时延(微秒) labels=["action"] task_scheduling_latency_milliseconds Histogram 任务调度时延(毫秒) - schedule_attempts_total Counter 尝试调度Pod的次数。“unschedulable”表示无法调度Pod,而“error”表示内部调度器问题 labels=["result"] pod_preemption_victims Gauge 选定的抢占受害者数量 - total_preemption_attempts Counter 集群中的抢占尝试总数 - unschedule_task_count Gauge 无法调度的任务数 labels=["job_id"] unschedule_job_count Gauge 无法调度的作业数 - job_retry_counts Counter 作业的重试次数 labels=["job_id"]
  • Volcano 1.0.0版本升级说明 Volcano 1.0.0版本与后续版本不兼容,不支持在控制台升级。如想使用新版本Volcano插件,需要先卸载1.0.0版本,然后再在控制台安装新版本。 执行如下命令可以卸载Volcano。 kubectl delete crd jobs.batch.volcano.sh kubectl delete crd commands.bus.volcano.sh
  • 版本记录 建议升级到跟集群配套的最新volcano版本。 表4 集群版本配套关系 集群版本 支持的插件版本 v1.25 1.7.1、1.7.2 v1.23 1.7.1、1.7.2 v1.21 1.7.1、1.7.2 v1.19.16 1.3.7、1.3.10、1.4.5、1.7.1、1.7.2 v1.19 1.3.7、1.3.10、1.4.5 v1.17(停止维护) 1.3.7、1.3.10、1.4.5 v1.15(停止维护) 1.3.7、1.3.10、1.4.5 表5 CCE插件版本记录 插件版本 支持的集群版本 更新特性 1.9.1 /v1.19.16.*|v1.21.*|v1.23.*|v1.25.*/ 修复networkresource插件计数pipeline pod占用subeni问题 修复binpack插件对资源不足节点打分问题 修复对结束状态未知的pod的资源的处理 优化事件输出 默认高可用部署 1.7.2 /v1.19.16.*|v1.21.*|v1.23.*|v1.25.*/ Volcano 支持 Kubernetes 1.25版本 提升Volcano调度性能。 1.7.1 /v1.19.16.*|v1.21.*|v1.23.*|v1.25.*/ Volcano 支持 Kubernetes 1.25版本 1.6.5 /v1.19.*|v1.21.*|v1.23.*/ 支持作为CCE的默认调度器 支持混部场景下统一调度 1.4.5 /v1.17.*|v1.19.*|v1.21.*/ volcano-scheduler的部署方式由statefulset调整为deployment,修复节点异常时Pod无法自动迁移的问题 1.4.2 /v1.15.*|v1.17.*|v1.19.*|v1.21.*/ 修复跨GPU分配失败问题 适配更新后的EAS API 1.3.3 /v1.15.*|v1.17.*|v1.19.*|v1.21.*/ 修复GPU异常导致的调度器崩溃问题;修复特权Init容器准入失败问题 1.3.1 /v1.15.*|v1.17.*|v1.19.*/ 升级Volcano框架到最新版本 支持Kubernetes 1.19版本 添加numa-aware插件 修复多队列场景下Deployment扩缩容的问题 调整默认开启的算法插件 1.2.5 /v1.15.*|v1.17.*|v1.19.*/ 修复某些场景下OutOfcpu的问题 修复queue设置部分capability情况下Pod无法调度问题 支持volcano组件日志时间与系统时间保持一致 修复队列间多抢占问题 修复ioaware插件在某些极端场景下结果不符合预期的问题 支持混合集群 1.2.3 /v1.15.*|v1.17.*|v1.19.*/ 修复因为精度不够引发的训练任务OOM的问题 修复CCE1.15以上版本GPU调度的问题,暂不支持任务分发时的CCE版本滚动升级 修复特定场景下队列状态不明的问题 修复特定场景下作业挂载PVC panic的问题 修复GPU作业无法配置小数的问题 添加ioaware插件 添加ring controller
  • 在控制台中修改volcano-scheduler配置 Volcano允许用户在安装,升级,编辑时,编写Volcano调度器配置信息,并将配置内容同步到volcano-scheduler-configmap里。 当前小节介绍如何使用自定义配置,以便用户让volcano-scheduler能更适合自己的场景。 仅Volcano 1.7.1及以上版本支持该功能。在新版插件界面上合并了原plugins.eas_service和resource_exporter_enable等选项,以新选项default_scheduler_conf代替。 您可登录CCE控制台,单击集群名称进入集群,单击左侧导航栏的“插件管理”,在右侧找到Volcano,单击“安装”或“升级”,并在“参数配置”中设置Volcano调度器配置参数。 使用resource_exporter配置,示例如下: { "ca_cert": "", "default_scheduler_conf": { "actions": "allocate, backfill", "tiers": [ { "plugins": [ { "name": "priority" }, { "name": "gang" }, { "name": "conformance" } ] }, { "plugins": [ { "name": "drf" }, { "name": "predicates" }, { "name": "nodeorder" } ] }, { "plugins": [ { "name": "cce-gpu-topology-predicate" }, { "name": "cce-gpu-topology-priority" }, { "name": "cce-gpu" }, { "name": "numa-aware" # add this also enable resource_exporter } ] }, { "plugins": [ { "name": "nodelocalvolume" }, { "name": "nodeemptydirvolume" }, { "name": "nodeCSIscheduling" }, { "name": "networkresource" } ] } ] }, "server_cert": "", "server_key": "" } 开启后可以同时使用volcano-scheduler的numa-aware插件功能和resource_exporter功能。 使用eas_service配置,示例如下: { "ca_cert": "", "default_scheduler_conf": { "actions": "allocate, backfill", "tiers": [ { "plugins": [ { "name": "priority" }, { "name": "gang" }, { "name": "conformance" } ] }, { "plugins": [ { "name": "drf" }, { "name": "predicates" }, { "name": "nodeorder" } ] }, { "plugins": [ { "name": "cce-gpu-topology-predicate" }, { "name": "cce-gpu-topology-priority" }, { "name": "cce-gpu" }, { "name": "eas", "custom": { "availability_zone_id": "", "driver_id": "", "endpoint": "", "flavor_id": "", "network_type": "", "network_virtual_subnet_id": "", "pool_id": "", "project_id": "", "secret_name": "eas-service-secret" } } ] }, { "plugins": [ { "name": "nodelocalvolume" }, { "name": "nodeemptydirvolume" }, { "name": "nodeCSIscheduling" }, { "name": "networkresource" } ] } ] }, "server_cert": "", "server_key": "" } 使用ief配置,示例如下: { "ca_cert": "", "default_scheduler_conf": { "actions": "allocate, backfill", "tiers": [ { "plugins": [ { "name": "priority" }, { "name": "gang" }, { "name": "conformance" } ] }, { "plugins": [ { "name": "drf" }, { "name": "predicates" }, { "name": "nodeorder" } ] }, { "plugins": [ { "name": "cce-gpu-topology-predicate" }, { "name": "cce-gpu-topology-priority" }, { "name": "cce-gpu" }, { "name": "ief", "enableBestNode": true } ] }, { "plugins": [ { "name": "nodelocalvolume" }, { "name": "nodeemptydirvolume" }, { "name": "nodeCSIscheduling" }, { "name": "networkresource" } ] } ] }, "server_cert": "", "server_key": "" }
  • 保留原volcano-scheduler-configmap配置 假如在某场景下希望插件升级后时沿用原配置,可参考以下步骤: 查看原volcano-scheduler-configmap配置,并备份。 示例如下: # kubectl edit cm volcano-scheduler-configmap -n kube-system apiVersion: v1 data: default-scheduler.conf: |- actions: "enqueue, allocate, backfill" tiers: - plugins: - name: priority - name: gang - name: conformance - plugins: - name: drf - name: predicates - name: nodeorder - name: binpack arguments: binpack.cpu: 100 binpack.weight: 10 binpack.resources: nvidia.com/gpu binpack.resources.nvidia.com/gpu: 10000 - plugins: - name: cce-gpu-topology-predicate - name: cce-gpu-topology-priority - name: cce-gpu - plugins: - name: nodelocalvolume - name: nodeemptydirvolume - name: nodeCSIscheduling - name: networkresource 在控制台“参数配置”中填写自定义修改的内容: { "ca_cert": "", "default_scheduler_conf": { "actions": "enqueue, allocate, backfill", "tiers": [ { "plugins": [ { "name": "priority" }, { "name": "gang" }, { "name": "conformance" } ] }, { "plugins": [ { "name": "drf" }, { "name": "predicates" }, { "name": "nodeorder" }, { "name": "binpack", "arguments": { "binpack.cpu": 100, "binpack.weight": 10, "binpack.resources": "nvidia.com/gpu", "binpack.resources.nvidia.com/gpu": 10000 } } ] }, { "plugins": [ { "name": "cce-gpu-topology-predicate" }, { "name": "cce-gpu-topology-priority" }, { "name": "cce-gpu" } ] }, { "plugins": [ { "name": "nodelocalvolume" }, { "name": "nodeemptydirvolume" }, { "name": "nodeCSIscheduling" }, { "name": "networkresource" } ] } ] }, "server_cert": "", "server_key": "" } 使用该功能时会覆盖原volcano-scheduler-configmap中内容,所以升级时务必检查是否在volcano-scheduler-configmap做过修改。如果是,需要把修改内容同步到升级界面里。
  • 安装插件 登录UCS控制台,单击集群名称进入集群,单击左侧导航栏的“插件管理”,找到Volcano,单击“安装”。 该插件可配置“单实例”、“高可用”或自定义规格。 选择自定义时,volcano-controller和volcano-scheduler的建议值如下: 小于100个节点,可使用默认配置,即CPU的申请值为500m,限制值为2000m;内存的申请值为500Mi,限制值为2000Mi。 高于100个节点,每增加100个节点(10000个Pod),建议CPU的申请值增加500m,内存的申请值增加1000Mi;CPU的限制值建议比申请值多1500m,内存的限制值建议比申请值多1000Mi。 申请值推荐计算公式: CPU申请值:计算“目标节点数 * 目标Pod规模”的值,并在表1中根据“集群节点数 * Pod规模”的计算值进行插值查找,向上取最接近规格的申请值及限制值。 例如2000节点和2w个Pod的场景下,“目标节点数 * 目标Pod规模”等于4000w,向上取最接近的规格为700/7w(“集群节点数 * Pod规模”等于4900w),因此建议CPU申请值为4000m,限制值为5500m。 内存申请值:建议每1000个节点分配2.4G内存,每1w个Pod分配1G内存,二者叠加进行计算。(该计算方法相比表1中的建议值会存在一定的误差,通过查表或计算均可) 即:内存申请值 = 目标节点数/1000 * 2.4G + 目标Pod规模/1w * 1G。 例如2000节点和2w个Pod的场景下,内存申请值 = 2 * 2.4G + 2 * 1G = 6.8G 表1 volcano-controller和volcano-scheduler的建议值 集群节点数/Pod规模 CPU Request(m) CPU Limit(m) Memory Request(Mi) Memory Limit(Mi) 50/5k 500 2000 500 2000 100/1w 1000 2500 1500 2500 200/2w 1500 3000 2500 3500 300/3w 2000 3500 3500 4500 400/4w 2500 4000 4500 5500 500/5w 3000 4500 5500 6500 600/6w 3500 5000 6500 7500 700/7w 4000 5500 7500 8500 选择插件实例是否多可用区部署。 优先模式:优先将插件的Deployment实例调度到不同可用区的节点上,如集群下节点不满足多可用区,插件实例将调度到单可用区。 强制模式:插件Deployment实例强制调度到不同可用区的节点上,如集群下节点不满足多可用区,插件实例将无法全部运行。 配置插件实例节点亲和策略。 指定节点调度:指定插件实例部署的节点 ,若不指定,将根据集群默认调度策略进行随机调度。 自定义亲和策略:填写期望插件部署的节点标签实现更灵活的调度策略,若不填写将根据集群默认调度策略进行随机调度。自定义亲和策略详情请参见调度策略(亲和与反亲和) 配置volcano默认调度器配置参数,详情请参见表2。 colocation_enable: '' default_scheduler_conf: actions: 'allocate, backfill' tiers: - plugins: - name: 'priority' - name: 'gang' - name: 'conformance' - name: 'lifecycle' arguments: lifecycle.MaxGrade: 10 lifecycle.MaxScore: 200.0 lifecycle.SaturatedTresh: 1.0 lifecycle.WindowSize: 10 - plugins: - name: 'drf' - name: 'predicates' - name: 'nodeorder' - plugins: - name: 'cce-gpu-topology-predicate' - name: 'cce-gpu-topology-priority' - name: 'cce-gpu' - plugins: - name: 'nodelocalvolume' - name: 'nodeemptydirvolume' - name: 'nodeCSIscheduling' - name: 'networkresource' 表2 Volcano插件配置参数说明 插件 功能 参数说明 用法演示 colocation_enable 是否开启混部能力。 参数值: true:表示开启混部。 false:不是不开启混部。 - binpack 将Pod调度到资源使用较高的节点以减少资源碎片 binpack.weight:binpack插件本身在所有插件打分中的权重 binpack.cpu:CPU资源在资源比重的比例,默认是1 binpack.memory:memory资源在所有资源中的比例,默认是1 binpack.resources:资源类型。 - plugins: - name: binpack arguments: binpack.weight: 10 binpack.cpu: 1 binpack.memory: 1 binpack.resources: nvidia.com/gpu, example.com/foo binpack.resources.nvidia.com/gpu: 2 binpack.resources.example.com/foo: 3 conformance 跳过关键Pod,比如在kube-system命名空间的Pod,防止这些Pod被驱逐 - - lifecycle 通过统计业务伸缩的规律,将有相近生命周期的Pod优先调度到同一节点,配合autoscaler的水平扩缩容能力,快速缩容释放资源,节约成本并提高资源利用率。 1. 统计业务负载中Pod的生命周期,将有相近生命周期的Pod调度到同一节点 2. 对配置了自动扩缩容策略的集群,通过调整节点的缩容注解,优先缩容使用率低的节点 arguments参数: lifecycle.WindowSize:为int型整数,不小于1,默认为10。 记录副本数变更的次数,负载变化规律、周期性明显时可适当调低;变化不规律,副本数频繁变化需要调大。若过大会导致学习周期变长,记录事件过多。 lifecycle.MaxGrade:为int型整数,不小于3,默认为3。 副本分档数,如设为3,代表分为高中低档。负载变化规律、周期性明显时可适当调低;变化不规律,需要调大。若过小会导致预测的生命周期不够准确。 lifecycle.MaxScore:为float64浮点数,不小于50.0,默认为200.0。 lifecycle插件的最大得分,等效于插件权重。 lifecycle.SaturatedTresh:为float64浮点数,小于0.5时取值为0.5;大于1时取值为1,默认为0.8。 用于判断节点利用率是否过高的阈值,当超过该阈值,调度器会优先调度作业至其他节点。 - plugins: - name: priority - name: gang enablePreemptable: false - name: conformance - name: lifecycle arguments: lifecycle.MaxGrade: 10 lifecycle.MaxScore: 200.0 lifecycle.SaturatedTresh: 1.0 lifecycle.WindowSize: 10 说明: 对不希望被缩容的节点,需要手动标记长周期节点,为节点添加volcano.sh/long-lifecycle-node: true的annotation。对未标记节点,lifecycle插件将根据节点上负载的生命周期自动标记。 MaxScore默认值200.0相当于其他插件权重的两倍,当lifecycle插件效果不明显或与其他插件冲突时,需要关闭其他插件,或将MaxScore调大。 调度器重启后,lifecycle插件需要重新记录负载的变化状况,需要统计数个周期后才能达到最优调度效果。 gang 将一组Pod看做一个整体去分配资源 - - priority 使用用户自定义负载的优先级进行调度 - - overcommit 将集群的资源放到一定倍数后调度,提高负载入队效率。负载都是deployment的时候,建议去掉此插件或者设置扩大因子为2.0。 overcommit-factor: 扩大因子,默认是1.2 - plugins: - name: overcommit arguments: overcommit-factor: 2.0 drf 根据作业使用的主导资源份额进行调度,用的越少的优先 - - predicates 预选节点的常用算法,包括节点亲和,Pod亲和,污点容忍,node ports重复,volume limits,volume zone匹配等一系列基础算法 - - nodeorder 优选节点的常用算法 nodeaffinity.weight:节点亲和性优先调度,默认值是1 podaffinity.weight:Pod亲和性优先调度,默认值是1 leastrequested.weight:资源分配最少的的节点优先,默认值是1 balancedresource.weight:node上面的不同资源分配平衡的优先,默认值是1 mostrequested.weight:资源分配最多的的节点优先,默认值是0 tainttoleration.weight:污点容忍高的优先调度,默认值是1 imagelocality.weight:node上面有Pod需要镜像的优先调度,默认值是1 selectorspread.weight: 把Pod均匀调度到不同的节点上,默认值是0 volumebinding.weight: local pv延迟绑定调度,默认值是1 podtopologyspread.weight: Pod拓扑调度,默认值是2 - plugins: - name: nodeorder arguments: leastrequested.weight: 1 mostrequested.weight: 0 nodeaffinity.weight: 1 podaffinity.weight: 1 balancedresource.weight: 1 tainttoleration.weight: 1 imagelocality.weight: 1 volumebinding.weight: 1 podtopologyspread.weight: 2 cce-gpu-topology-predicate GPU拓扑调度预选算法 - - cce-gpu-topology-priority GPU拓扑调度优选算法 - - cce-gpu 结合UCS的GPU插件支持GPU资源分配,支持小数GPU配置 说明: 小数GPU配置的前提条件为UCS集群GPU节点为共享模式,检查集群是否关闭GPU共享,请参见集群配置管理中的enable-gpu-share参数。 - - numaaware numa拓扑调度 weight: 插件的权重 - networkresource 支持预选过滤ENI需求节点,参数由CCE传递,不需要手动配置 NetworkType: 网络类型(eni或者vpc-router类型) - nodelocalvolume 支持预选过滤不符合local volume需求节点 - - nodeemptydirvolume 支持预选过滤不符合emptydir需求节点 - - nodeCSIscheduling 支持预选过滤everest组件异常节点 - - 单击“安装”。
  • 插件简介 Volcano是一个基于Kubernetes的批处理平台,提供了机器学习、深度学习、生物信息学、基因组学及其他大数据应用所需要而Kubernetes当前缺失的一系列特性。 Volcano提供了高性能任务调度引擎、高性能异构芯片管理、高性能任务运行管理等通用计算能力,通过接入AI、大数据、基因、渲染等诸多行业计算框架服务终端用户。(目前Volcano项目已经在Github开源) Volcano针对计算型应用提供了作业调度、作业管理、队列管理等多项功能,主要特性包括: 丰富的计算框架支持:通过CRD提供了批量计算任务的通用API,通过提供丰富的插件及作业生命周期高级管理,支持TensorFlow,MPI,Spark等计算框架容器化运行在Kubernetes上。 高级调度:面向批量计算、高性能计算场景提供丰富的高级调度能力,包括成组调度,优先级抢占、装箱、资源预留、任务拓扑关系等。 队列管理:支持分队列调度,提供队列优先级、多级队列等复杂任务调度能力。 项目开源地址:https://github.com/volcano-sh/volcano
  • 安装nvidia-fabricmanager服务 A100/A800 GPU支持 NvLink & NvSwitch,若您使用多GPU卡的机型,需额外安装与驱动版本对应的nvidia-fabricmanager服务使GPU卡间能够互联,否则可能无法正常使用GPU实例。 本文以驱动版本470.103.01为例,您可参考以下步骤进行安装,请根据实际情况需要替换驱动版本。 登录需要安装nvidia-fabricmanager服务的GPU节点,该节点需绑定EIP用以下载nvidia-fabricmanager服务。 安装与驱动版本对应的nvidia-fabricmanager服务,您可通过官方下载操作系统和驱动版本对应的安装包。 CentOS操作系统 以CentOS 7为例: driver_version=470.103.01 wget https://developer.download.nvidia.cn/compute/cuda/repos/rhel7/x86_64/cuda-drivers-fabricmanager-${driver_version}-1.x86_64.rpm rpm -ivh nvidia-fabric-manager-${driver_version}-1.x86_64.rpm Ubuntu等其他操作系统 以Ubuntu 18.04为例: driver_version=470.103.01 driver_version_main=$(echo $driver_version | awk -F '.' '{print $1}') wget https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64/nvidia-fabricmanager-${driver_version_main}_${driver_version}-1_amd64.deb dpkg -i nvidia-fabricmanager-${driver_version_main}_${driver_version}-1_amd64.deb 启动nvidia-fabricmanager服务。 systemctl enable nvidia-fabricmanager systemctl start nvidia-fabricmanager 查看nvidia-fabricmanager服务状态。 systemctl status nvidia-fabricmanager
  • 安装插件 登录UCS控制台,单击集群名称进入集群,在左侧导航栏中选择“插件中心”。 在“可安装插件”中找到gpu-device-plugin,单击“安装”。 在安装插件页面,填写插件配置。 插件规格:可配置“默认”或“自定义”规格,请根据实际情况选择。 容器:选择“自定义”规格时支持设置。 Nvidia驱动:您可使用CCE提供的驱动地址或手动填写自定义Nvidia驱动的地址,集群下全部GPU节点将使用相同的驱动。 GPU虚拟化功能仅支持470.57.02、470.103.01、470.141.03、510.39.01、510.47.03版本的GPU驱动。 建议您使用CCE提供的驱动地址,以满足驱动版本的要求。 如果下载链接为公网地址,例如地址为nvidia官网地址https://us.download.nvidia.com/tesla/470.103.01/NVIDIA-Linux-x86_64-470.103.01.run,则各GPU节点均需要绑定EIP。获取驱动链接方法请参考获取驱动链接-公网地址。 若下载链接为OBS上的链接,无需绑定EIP 。获取驱动链接方法请参考获取驱动链接-OBS地址。 请确保Nvidia驱动版本与GPU节点适配。 更改驱动版本后,需要重启节点才能生效。 对于linux 5.x内核系统,如Huawei Cloud EulerOS 2.0或ubuntu 22.04,建议使用470及以上版本驱动。 图1 安装gpu-device-plugin 驱动选择:若您不希望集群中的所有GPU节点使用相同的驱动,CCE支持以节点池为单位安装不同的GPU驱动。 插件将根据节点池指定的驱动版本进行安装,仅对节点池新建节点生效。 新建节点更新驱动版本后,需重启节点生效。非新建节点不支持更新驱动版本。 插件卸载会自动删除已安装的GPU驱动。 GPU虚拟化:选择开启GPU虚拟化,支持GPU单卡的算力、显存分割与隔离。 若集群中未安装volcano插件,将不支持开启GPU虚拟化,您可单击“一键安装”进行安装。如需配置volcano插件参数,请单击“自定义安装”,详情请参见volcano。 若集群中已安装volcano插件,但插件版本不支持使用GPU虚拟化,您可单击“一键升级”进行升级。如需配置volcano插件参数,请单击“自定义升级”,详情请参见volcano。 单击“安装”,安装gpu-device-plugin插件的任务即可提交成功。
  • 获取驱动链接-公网地址 登录CCE控制台。 创建节点,在节点规格处选择要创建的GPU节点,选中后下方显示的信息中可以看到节点的GPU显卡型号。 登录到nvidia网站。 如图2所示,在“NVIDIA驱动程序下载”框内选择对应的驱动信息。其中“操作系统”必须选Linux 64-bit。 图2 参数选择 驱动信息确认完毕,单击“搜索”按钮,会跳转到驱动信息展示页面,该页面会显示驱动的版本信息如图3,单击“下载”到下载页面。 图3 驱动信息 获取驱动软件链接方式分两种: 方式一:如图4,在浏览器的链接中找到url=/tesla/470.103.01/NVIDIA-Linux-x86_64-470.103.01.run的路径,补齐全路径为https://us.download.nvidia.com/tesla/470.103.01/NVIDIA-Linux-x86_64-470.103.01.run,该方式节点需要绑定EIP 。 方式二:如图4,单击“下载”按钮下载驱动,然后上传到OBS,获取软件的链接,该方式节点不需要绑定EIP。 图4 获取链接
  • 约束与限制 下载的驱动必须是后缀为“.run”的文件。 仅支持Nvidia Tesla驱动,不支持GRID驱动。 安装或重装插件时,需要保证驱动下载链接正确且可正常访问,插件对链接有效性不做额外校验。 gpu-device-plugin插件仅提供驱动的下载及安装脚本执行功能,插件的状态仅代表插件本身功能正常,与驱动是否安装成功无关。 如您使用A100/A800的多GPU卡机型,您需要手动安装与版本驱动对应的nvidia-fabricmanager服务才可以正常使用,详情请参见安装nvidia-fabricmanager服务。
  • asm-iam-authenticator使用参考 asm-iam-authenticator作为k8s client端的认证插件,主要提供了generate-kubeconfig和token两个子命令。 A tool to authenticate to ASM using HuaweiCloud IAM credentials Usage: asm-iam-authenticator [command] Available Commands: completion Generate the autocompletion script for the specified shell generate-kubeconfig Generate or modify kubeconfig files based on user configuration help Help about any command token Authenticate using HuaweiCloud IAM and get token for ASM Flags: --alsologtostderr log to standard error as well as files (no effect when -logtostderr=true) -h, --help help for asm-iam-authenticator --log_dir string If non-empty, write log files in this directory (no effect when -logtostderr=true) --log_file string If non-empty, use this log file (no effect when -logtostderr=true) --logtostderr log to standard error instead of files (default true) -v, --v Level number for the log level verbosity --version version for asm-iam-authenticator Use "asm-iam-authenticator [command] --help" for more information about a command. 其中,Flags主要为日志选项。 token token子命令用于获取用户token,获取token的认证方式有用户名/密码、ak/sk两种,选择其中一种即可。 Authenticate using HuaweiCloud IAM and get token for ASM Usage: asm-iam-authenticator token [flags] Flags: --ak string IAM access key ID --aksk-dir string The directory of IAM access key(AK) and secret access key(SK) --cache Cache the token credential on disk until it expires (default true) --domain-name string IAM domain name, typically your account name -h, --help help for token --iam-endpoint string HuaweiCloud IAM endpoint, i.e. https://iam.cn-north-4.myhuaweicloud.com (default "https://iam.myhuaweicloud.com") --insecure-skip-tls-verify If true, the iam server's certificate will not be checked for validity. (default true) --password string IAM user password --project-id string IAM project id, project id and project name should not be empty at same time --project-name string IAM project name, project id and project name should not be empty at same time --sk string IAM secret access key --token-expired-refresh Whether refresh the cached token when it may have expired resulting unauthorized. If true, we will use client.authentication.k8s.io/v1alpha1 api version. Otherwise, use client.authentication.k8s.io/v1beta1 --token-only Return token only for other tool integration --user-name string IAM user name. Same as domain-name when using main account, otherwise use iam user name 其中,Flags分为用户名密码、AKSK和公共配置。 表1 用户名/密码配置 Command Flag Environment Value Description domain-name DOMAIN_NAME 租户名,即账号名,详情请参见https://support.huaweicloud.com/usermanual-ca/ca_01_0001.html。 user-name USER_NAME 子用户名,即IAM用户名。若不配置与domain-name一致。 详情请参见https://support.huaweicloud.com/usermanual-ca/ca_01_0001.html。 password PASSWORD 用户或子用户密码。 表2 AK/SK配置 Command Flag Environment Value Description ak AC CES S_KEY_ID ak、sk的获取方法请参见获取AK/SK,ak为文件中Access Key部分,sk为文件中Secret Key部分。 sk SECRET_ACCESS_KEY 表3 公共配置 Command Flag Environment Value Description iam-endpoint IAM_ENDPOINT IAM的Endpoint,必须配置,详情请参见https://developer.huaweicloud.com/endpoint?IAM。 project-name PROJECT_NAME 项目名,详情请参见https://support.huaweicloud.com/usermanual-ca/ca_01_0001.html。 project-id PROJECT_ID 项目ID,详情请参见https://support.huaweicloud.com/usermanual-ca/ca_01_0001.html。 insecure-skip-tls-verify INSECURE_SKIP_TLS_VERIFY 是否跳过对CCI/IAM服务端的校验,默认为true。 cache CREDENTIAL_CACHE 是否开启将IAM Token缓存到本地,提高访问性能,默认为true。 注意: 在非安全环境,建议关闭此选项。 generate-kubeconfig 为用户直接生成KubeConfig配置,若指定的KubeConfig已存在,则会注入新的server、user、context配置,并将当前的KubeConfig context切换到此次配置的结果。 Generate or modify kubeconfig files based on user configuration. Sets a cluster entry, a user entry and a context entry in kubeconfig and use this context as the current-context. The loading order follows these rules: 1. If the --kubeconfig flag is set, then only that file is loaded. The flag may only be set once and no merging takes place. 2. If $KUBECONFIG environment variable is set, then it is used as a list of paths (normal path delimiting rules for your system). These paths are merged. When a value is modified, it is modified in the file that defines the stanza. When a value is created, it is created in the first file that exists. If no files in the chain exist, then it creates the last file in the list. 3. Otherwise, ${HOME}/.kube/config is used and no merging takes place. Examples: # Generate kubeconfig to ${HOME}/.kube/config using aksk asm-iam-authenticator generate-kubeconfig --mesh-endpoint=https://127.0.0.1:5443 --ak=*** --sk=*** # Generate kubeconfig to ${HOME}/.kube/config using domain name and password asm-iam-authenticator generate-kubeconfig --mesh-endpoint=https://127.0.0.1:5443 --domain-name=*** --password=*** Usage: asm-iam-authenticator generate-kubeconfig [flags] Flags: --ak string IAM access key ID --aksk-dir string The directory of IAM access key(AK) and secret access key(SK) --cache Cache the token credential on disk until it expires (default true) --domain-name string IAM domain name, typically your account name -h, --help help for generate-kubeconfig --iam-endpoint string HuaweiCloud IAM endpoint, i.e. https://iam.cn-north-4.myhuaweicloud.com (default "https://iam.myhuaweicloud.com") --insecure-skip-tls-verify If true, the iam server's certificate will not be checked for validity. (default true) --kubeconfig string use a particular kubeconfig file --mesh-endpoint string Mesh server endpoint, i.e. https://127.0.0.1:5443 --mesh-region string Mesh region, i.e. cn-north-4 --password string IAM user password --project-id string IAM project id, project id and project name should not be empty at same time --project-name string IAM project name, project id and project name should not be empty at same time --sk string IAM secret access key --token-expired-refresh Whether refresh the cached token when it may have expired resulting unauthorized. If true, we will use client.authentication.k8s.io/v1alpha1 api version. Otherwise, use client.authentication.k8s.io/v1beta1 --token-only Return token only for other tool integration --user-name string IAM user name. Same as domain-name when using main account, otherwise use iam user name --validation Validate kubeconfig by trying to access Mesh with existing config (default true) 父主题: 使用kubectl连接网格控制面
  • 获取网格实例Endpoint 登录华为云UCS控制台,左侧菜单栏选择“服务网格”。 F12打开浏览器console切换到“网络”标签页,单击服务网格列表页右上角小刷新按钮,找到meshes接口,单击“预览”标签页,找到对应网格的返回体,找到status.meshEndpoint.vpcEndpointServiceName字段后复制。 登录 VPC终端节点 VPCEP,左侧菜单栏选择“终端节点”,找到终端节点服务名称为步骤2获取到的对应的终端节点,单击进入获取到节点IP。 ASM在您创建网格时选择的枢纽VPC创建终端节点,并将该终端节点连接到网格控制面apiserver,来打通访问网格控制面的网络。更多信息请参考1.2-操作步骤中VPC解释。