创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。
发帖前请点击 发表主题 右边的 预览(👀) 按钮,确保帖子格式正确。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。
操作系统信息
ECS,openeuler22.03,16C/64G
Kubernetes版本信息
v1.27,多节点
容器运行时
containerd 1.16.14
KubeSphere版本信息
v3.4.1,已有K8s安装
问题是什么
我们部署的k8s集群已经把运行时换成了containerd,但kubesphere流水线中集成的还是docker,请问如何在流水线脚本中使用nerdctl命令代替docker命令,我想了个办法把配置字典jenkins-casc-config改成下面的样子,但不管用,提示找不到nerdctl命令
`- name: “maven”
namespace: “kubesphere-devops-worker”
label: “maven”
nodeUsageMode: “EXCLUSIVE”
idleMinutes: 0
containers:
- name: “maven”
image: “dockerhub.kubekey.local/kubesphere/builder-maven:v3.2.0-podman”
command: “cat”
args: ""
ttyEnabled: true
privileged: true
resourceRequestCpu: “100m”
resourceLimitCpu: “4000m”
resourceRequestMemory: “100Mi”
resourceLimitMemory: “8192Mi”
- name: “jnlp”
image: “dockerhub.kubekey.local/jenkins/inbound-agent:4.10-2”
args: “^${computer.jnlpmac} ^${computer.name}”
resourceRequestCpu: “50m”
resourceLimitCpu: “500m”
resourceRequestMemory: “400Mi”
resourceLimitMemory: “1536Mi”
workspaceVolume:
emptyDirWorkspaceVolume:
memory: false
volumes:
- hostPathVolume:
hostPath: “/var/run/containerd/containerd.sock”
mountPath: “/var/run/containerd/containerd.sock”
- hostPathVolume:
hostPath: “/usr/local/bin/nerdctl”
mountPath: “/usr/bin/nerdctl”
- hostPathVolume:
hostPath: “/var/data/jenkins_maven_cache”
mountPath: “/root/.m2”
- hostPathVolume:
hostPath: “/var/data/jenkins_sonar_cache”
mountPath: “/root/.sonar/cache”`