下载
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助
昇腾小AI

K8s集成Containerd使用

K8s集成Containerd场景下,用户需要安装Ascend Docker Runtime,并参照本章节完成相应修改。使用任务yaml下发训练或推理任务时,NPU芯片的分配由VolcanoAscend Device Plugin组件自动完成;NPU芯片及相关文件目录的挂载由Ascend Docker Runtime组件自动完成。

操作步骤

  1. 修改Containerd配置文件“/etc/containerd/config.toml”
    • 使用cgroup v1的用户,根据实际情况修改返回类型和runtime安装路径,示例如下加粗部分所示。
          [plugins."io.containerd.grpc.v1.cri".containerd.runtimes] 
             [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]  
               runtime_type = "io.containerd.runtime.v1.linux" 
               runtime_engine = "" 
               runtime_root = "" 
               privileged_without_host_devices = false 
               base_runtime_spec = "" 
               [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] 
         [plugins."io.containerd.grpc.v1.cri".cni] 
           bin_dir = "/opt/cni/bin" 
           conf_dir = "/etc/cni/net.d" 
           max_conf_num = 1 
           conf_template = "" 
       [plugins."io.containerd.grpc.v1.cri".registry] 
           [plugins."io.containerd.grpc.v1.cri".registry.mirrors] 
             [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"] 
               endpoint = ["https://registry-1.docker.io"] 
       [plugins."io.containerd.grpc.v1.cri".image_decryption] 
           key_model = "" 
       
      ...
       [plugins."io.containerd.monitor.v1.cgroups"] 
         no_prometheus = false 
       [plugins."io.containerd.runtime.v1.linux"] 
         shim = "containerd-shim" 
         runtime = "/usr/local/Ascend/Ascend-Docker-Runtime/ascend-docker-runtime"   
         runtime_root = "" 
         no_shim = false 
         shim_debug = false 
       [plugins."io.containerd.runtime.v2.task"] 
         platforms = ["linux/amd64"] 
      ...
    • 若使用的是cgroup v2,需要做如下加粗部分的修改,示例如下。
              [plugins."io.containerd.grpc.v1.cri".containerd.default_runtime.options]
            [plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
              [plugins."io.containerd.grpc.v2.cri".containerd.runtimes.runc]
                base_runtime_spec = ""
                cni_conf_dir = ""
                cni_max_conf_num = 0
                container_annotations = []
                pod_annotations = []
                privileged_without_host_devices = false
                runtime_engine = ""
                runtime_path = ""
                runtime_root = ""
                runtime_type = "io.containerd.runc.v2"
                [plugins."io.containerd.grpc.v2.cri".containerd.runtimes.runc.options]
                  BinaryName = "/usr/local/Ascend/Ascend-Docker-Runtime/ascend-docker-runtime"
                  CriuImagePath = ""
                  CriuPath = ""
                  CriuWorkPath = ""
                  IoGid = 0
                  IoUid = 0
                  NoNewKeyring = false
                  NoPivotRoot = false
                  Root = ""
                  ShimCgroup = ""
                  SystemdCgroup = true
      ...
  2. 修改节点上kubelet的配置文件kubeadm-flags.env。
    vi /var/lib/kubelet/kubeadm-flags.env

    增加如下加粗内容,其他参数已省略。

    KUBELET_KUBEADM_ARGS="... --container-runtime=remote --container-runtime-endpoint=/run/containerd/containerd.sock ..."
  3. 执行命令,重启Containerdkubelet,示例如下。
    systemctl daemon-reload && systemctl restart containerd kubelet
搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词