有没有好心人帮我看看,这个问题搞了两天了,还是搞不定。T-T

我按照离线安装 KubeSphere的步骤在不能上网的机器上部署,在执行到 5. 安装 Kubernetes https://www.kubesphere.io/zh/docs/v4.1/03-installation-and-upgrade/02-install-kubesphere/04-offline-installation/#*5*%E5%AE%89%E8%A3%85_kubernetes

这一步时。因为我们的Harbor只支持http(访问方式: http://{ip地址}:{端口}),所以我修改config-sample.yaml文件中registry部分如下:

  registry:
    registryMirrors: []
    insecureRegistries: ["{IP地址}:{端口}"]
    privateRegistry: "{IP地址}:{端口}"
    namespaceOverride: "kubesphereio"
    auths: # if docker add by `docker login`, if containerd append to `/etc/containerd/config.toml`
      "{IP地址}:{端口}":
        username: "{登录的账号}"
        password: "***"
        skipTLSVerify: true # Allow contacting registries over HTTPS with failed TLS verification.
        plainHTTP: true # Allow contacting registries over HTTP.

但是执行到推镜像到Harbor仓库时开始报错,看错误信息,程序想要用https去ping我配置的http的地址:

…… pinging container registry {IP地址}:{端口}. Get "https://{IP地址}:{端口}/v2":
http server gave HTTP response to HTTPS client
……
error: Pipeline[CreateClusterPipeline] excute failed: Module[CopyImagesToRegiestryModule] exec failed:
failed: [LocalHost] [PushManifest] exec failed after 1 retries: get manifest list failed by module cache

上面的错误信息都是手抄然后打字的,如有谬误还请见谅。

这两天也在网上找了各种方法,包括:

  1. 修改Docker的配置

创建/etc/docker/daemon.json

# cat /etc/docker/daemon.json
{
    "insecure-registries": ["{IP地址}:{端口}"]
}

但是输入重启docker服务命令时,提示没有这个docker服务。

  1. 修改Containerd配置

我发现kk创建了/etc/containerd/config.toml文件,其中包括了我配置的链接和账号密码,我照着网上的方法修改相关部分的内容如下:

# /etc/containerd/config.toml
. . .
  [plugin."io.containerd.grpc.v1.cri".registry
    [plugin."io.containerd.grpc.v1.cri".registry.mirrors]
      [plugin."io.containerd.grpc.v1.cri".registry.mirrors."{IP地址}:{端口}"]
        endpoint = ["http://{IP地址}:{端口}"]
      [plugin."io.containerd.grpc.v1.cri".registry.configs]
        [plugins."io.containerd.grpc.v1.cri".registry.configs."{IP地址}:{端口}".auth]
          username = "{登录的账号}"
          password = '***'

然后重启containerd服务。

systemctl daemon-reload
systemctl restart containerd

再尝试执行部署

./kk create cluster -f config-sample.yaml -a kubesphere.tar.gz --with-local-storage

但始终都是“http server gave HTTP response to HTTPS client”这个错。中间我也尝试过修改本地hosts文件给IP配别名、去node2上也照着配置一遍、修改config-sample.yaml里面skipTLSVerifyplainHTTP的true/false值,甚至全部删了重新上传tar包从头开始,但都不起作用。

有没有哪位大神帮忙看看,我应该改哪里的配置才能让它不要再去用https访问?

skipTLSVerify: true 这个配置删掉,只保留 plainHTTP: true 试试看

    Cauchy 试过还是不行。现在不清楚究竟是kk要去ping https还是它调用了containerd去ping https

    加registry.insecureRegistries: [] 按这个层级,在config里面

      sylvia 麻烦问下是改config-sample.yaml还是改/etc/containerd/config.toml文件

        heltest 参考这个链接https://www.kubesphere.io/docs/v3.3/installing-on-linux/introduction/vars/ 里面有这个参数

          sylvia 谢谢!我最后还是又搭了一个nginx,然后做https转http的代理,这步总算是过了