关于.gitlab-ci.yml中build镜像时,docker守护进程未启动错误
参考:https://docs.gitlab.com/runner/install/kubernetes.html
问题截图
解决方法
values.yaml中关于conf.toml添加
注意:确保每个节点的docker正常运行
[[runners.kubernetes.volumes.host_path]]
name = "docker"
mount_path = "/var/run/docker.sock"
read_only = false
host_path = "/var/run/docker.sock"
关于指定节点只运行gitlab-runner和worker
添加污点配置,kubectl taint node node1 runner=gitlab-runner-only:NoSchedule,并修改configmap配置:
cat >>/home/gitlab-runner/.gitlab-runner/config.toml <<EOF
[runners.kubernetes.node_tolerations]
"runner=gitlab-runner-only" = "NoSchedule"
EOF
gitlab-runner和worker调度到指定节点
添加标签选择器,添加节点标签,修改values.yaml
kubectl label node node1 runner=gitlab-runner-only
runners:
…
nodeSelector:
runner: gitlab-runner-only
nodeSelector:
runner: gitlab-runner-only
…