操作系统信息

Ubuntu 24.04 4c8g

Kubernetes版本信息
kubectl version 命令执行结果贴在下方

# crictl version
Version:  0.1.0
RuntimeName:  containerd
RuntimeVersion:  v1.7.13
RuntimeApiVersion:  v1

KubeSphere版本信息
v4.1.1

安装命令如下,helm安装kubesphere时修改默认的镜像拉取地址

export KKZONE=cn
curl -sfL https://get-kk.kubesphere.io | sh -
./kk create cluster --with-local-storage  --with-kubernetes v1.31.0 --container-manager containerd  -y

helm upgrade --install -n kubesphere-system --create-namespace ks-core https://charts.kubesphere.io/main/ks-core-1.1.1.tgz --debug --wait --set global.imageRegistry=swr.cn-southwest-2.myhuaweicloud.com/ks

镜像拉取失败,已经设置默认拉取镜像地址,但是在安装devops扩展组件的时候拉取镜像的地址还是走docker.io下载

Events:
  Type     Reason       Age                      From     Message
  ----     ------       ----                     ----     -------
  Warning  FailedMount  54m (x61 over 174m)      kubelet  MountVolume.SetUp failed for volume "kube-api-access-85tw5" : failed to fetch token: serviceaccounts "devops" not found
  Warning  FailedMount  39m (x93 over 3h32m)     kubelet  MountVolume.SetUp failed for volume "kubesphere-config" : configmap "devops-config" not found
  Warning  Failed       29m (x41 over 3h24m)     kubelet  (combined from similar events): Failed to pull image "docker.io/kubesphere/devops-apiserver:v4.1.2": rpc error: code = DeadlineExceeded desc = failed to pull and unpack image "docker.io/kubesphere/devops-apiserver:v4.1.2": failed to resolve reference "docker.io/kubesphere/devops-apiserver:v4.1.2": failed to do request: Head "https://registry-1.docker.io/v2/kubesphere/devops-apiserver/manifests/v4.1.2": dial tcp 199.96.62.41:443: i/o timeout
  Normal   BackOff      4m46s (x838 over 3h53m)  kubelet  Back-off pulling image "docker.io/kubesphere/devops-apiserver:v4.1.2"
Events:
  Type     Reason   Age                       From     Message
  ----     ------   ----                      ----     -------
  Warning  Failed   8m42s (x102 over 6h57m)   kubelet  (combined from similar events): Failed to pull image "docker.io/kubesphere/kubectl:v1.27.4": rpc error: code = DeadlineExceeded desc = failed to pull and unpack image "docker.io/kubesphere/kubectl:v1.27.4": failed to resolve reference "docker.io/kubesphere/kubectl:v1.27.4": failed to do request: Head "https://registry-1.docker.io/v2/kubesphere/kubectl/manifests/v1.27.4": dial tcp 199.16.156.75:443: i/o timeout
  Normal   BackOff  3m51s (x1650 over 7h32m)  kubelet  Back-off pulling image "docker.io/kubesphere/kubectl:v1.27.4"

    之前的版本可以修改配置解决类似问题,覆盖docker下载地址,

    4.1版本找了半天也没找到相关的配置在哪里。。。

    local_registry: dockerhub.kubekey.local
    namespace_override: kubesphereio
    mosatu 更改标题为「V4.1.1 版本安装DevOps扩展插件安装失败 Failed to pull image "docker.io/kubesphere******

    mosatu 这个修改只支持 LuBan ks-core 相关服务的镜像仓库地址;扩展组件的镜像仓库地址只能在扩展组件配置里修改,如图:

    只支持修改镜像仓库地址,不支持修改镜像 namespace ;

      10 天 后
      6 个月 后

      4.1.3 kse 纳管的 k8s 是1.23.17 安装DevOps失败,查看Event发现要去拉取kubectl:v1.27.4 发现本地harbor中找到该镜像,导致安装失败,求解?

      yudong
      你好 請問這邊 jenkins-casc-config.yaml確定裡面鏡像都是 private registry了,但pipeline用kubernetes做一個我自己鏡像做的pod卻是拉docker.io的jnlp鏡像 不是我私有倉庫的該怎麼做?

      上面配置 global imageRegistry我也做了一樣沒有用

      –set global.imageRegistry=swr.cn-southwest-2.myhuaweicloud.com/ks –set extension.imageRegistry=swr.cn-southwest-2.myhuaweicloud.com/ks

        sylvia 我安裝kubesphere時已經有加這些了
        現在的問題是 jenkins-casc-config 裡面的 jnlp jenkins/inbound image 確實是我 Rigistry 裡面的
        但是我在 pipeline 用 k8s 建一個新的 pod 他會自動起一個 jnlp,就不是拉我 Registry 的導致 pod 一直起不來

          cici 不理解,有报错图和你pipeline的文件吗

          • cici 回复了此帖

            sylvia 我成功了~應該是K8s agent pod yaml 撰寫問題導致的

            商业产品与合作咨询