leixing1012
我这边自己修改了一下,
1 在项目 kubesphere-devops-worker 中修改 configmap/ks-devops-agent 添加数据
键:PodmanSetting
值:pomand配置文件,例如:
unqualified-search-registries = ["docker.io"]
[[registry]]
prefix = "docker.io"
location = "xxx.mirror.aliyuncs.com"
insecure = true
注意:xxx.mirror.aliyuncs.com
要替换成自己的阿里云镜像加速地址
2 在项目 kubesphere-devops-system 中修改 configmap/jenkins-casc-config,在要使用的agent的容器配置中修改数据挂载:
containers:
- name: "maven"
resources:
requests:
ephemeral-storage: "1Gi"
limits:
ephemeral-storage: "10Gi"
volumeMounts:
- name: config-volume
mountPath: /opt/apache-maven-3.5.3/conf/settings.xml
subPath: settings.xml
volumes:
- name: config-volume
configMap:
name: ks-devops-agent
items:
- key: MavenSetting
path: settings.xml
securityContext:
fsGroup: 1000
修改为:
containers:
- name: "maven"
resources:
requests:
ephemeral-storage: "1Gi"
limits:
ephemeral-storage: "10Gi"
volumeMounts:
- name: config-volume
mountPath: /opt/apache-maven-3.5.3/conf/settings.xml
subPath: settings.xml
- name: podman-config-volume
mountPath: /etc/containers/registries.conf
subPath: registries.conf
volumes:
- name: config-volume
configMap:
name: ks-devops-agent
items:
- key: MavenSetting
path: settings.xml
- name: podman-config-volume
configMap:
name: ks-devops-agent
items:
- key: PodmanSetting
path: registries.conf
securityContext:
fsGroup: 1000
也就是增加了
volumeMounts:
- name: podman-config-volume
mountPath: /etc/containers/registries.conf
subPath: registries.conf
和
volumes:
- name: podman-config-volume
configMap:
name: ks-devops-agent
items:
- key: PodmanSetting
path: registries.conf
jenkins-casc-config内有2个配置文件,我都进行了同样的修改,只改了maven,其他的agent根据需要可以做类似的改动,实测有效,挂载到configmap中的podman的配置确实生效了。