kubekey icon indicating copy to clipboard operation
kubekey copied to clipboard

Installation problems in offline mode

Open phoenixzjh opened this issue 1 year ago • 7 comments

What is version of KubeKey has the issue?

3.0.7

What is your os environment?

CentOS 9

KubeKey config file

apiVersion: kubekey.kubesphere.io/v1alpha2
kind: Cluster
metadata:
  name: sample
spec:
  hosts:
  - {name: node1, address: 192.168.8.20, internalAddress: 192.168.8.20, user: root, password: "A123123"}
  roleGroups:
    etcd:
    - node1
    control-plane: 
    - node1
    worker:
    - node1
    registry:
    - node1
  controlPlaneEndpoint:
    ## Internal loadbalancer for apiservers 
    internalLoadbalancer: haproxy

    domain: lb.kubesphere.local
    address: ""
    port: 6443
  kubernetes:
    version: v1.25.5
    clusterName: cluster.local
    autoRenewCerts: true
    containerManager: containerd
  etcd:
    type: kubekey
  network:
    plugin: calico
    kubePodsCIDR: 10.233.64.0/18
    kubeServiceCIDR: 10.233.0.0/18
    ## multus support. https://github.com/k8snetworkplumbingwg/multus-cni
    multusCNI:
      enabled: false
  registry:
    privateRegistry: dockerhub.kubekey.local
    registryMirrors: []
    insecureRegistries: []
  addons: []

A clear and concise description of what happend.

Execute the following command line kk init registry -f k8s.yaml -a kubekey.tar.gz kk create cluster - f k8s.yaml - a kubekey.tar.gz

Installation failed with error message

Relevant log output

pull image failed: Failed to exec command: sudo -E /bin/bash -c "env PATH=$PATH crictl pull dockerhub.kubekey.local/kubesphere/pause:3.8" 
E0304 11:52:19.930866   15585 remote_image.go:238] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"dockerhub.kubekey.local/kubesphere/pause:3.8\": failed to resolve reference \"dockerhub.kubekey.local/kubesphere/pause:3.8\": failed to do request: Head \"https://dockerhub.kubekey.local/v2/kubesphere/pause/manifests/3.8\": x509: certificate signed by unknown authority" image="dockerhub.kubekey.local/kubesphere/pause:3.8"
FATA[0000] pulling image: rpc error: code = Unknown desc = failed to pull and unpack image "dockerhub.kubekey.local/kubesphere/pause:3.8": failed to resolve reference "dockerhub.kubekey.local/kubesphere/pause:3.8": failed to do request: Head "https://dockerhub.kubekey.local/v2/kubesphere/pause/manifests/3.8": x509: certificate signed by unknown authority: Process exited with status 1

Additional information

No response

phoenixzjh avatar Mar 03 '23 15:03 phoenixzjh

find bugs , add text into /etc/containerd/config.toml file, restart containerd service

[plugins."io.containerd.grpc.v1.cri".registry.configs]
  [plugins."io.containerd.grpc.v1.cri".registry.configs."dockerhub.kubekey.local".tls]
    ca_file = "/etc/docker/certs.d/dockerhub.kubekey.local/dockerhub.kubekey.local.cert"

phoenixzjh avatar Mar 08 '23 15:03 phoenixzjh

howto add config.toml config to kubekey config

xiaods avatar Mar 08 '23 23:03 xiaods

howto add config.toml config to kubekey config

run command "kk create cluster - f k8s.yaml - a kubekey.tar.gz" until error , the file config.toml created

phoenixzjh avatar Mar 09 '23 12:03 phoenixzjh

PR welcome

xiaods avatar Mar 13 '23 23:03 xiaods

Modify registry in config-sample.yaml as below might solve the problem:

registry:
    type: harbor
    auths:
      "dockerhub.kubekey.local":
        username: admin
        password: Harbor12345
        certsPath: "/etc/docker/certs.d/dockerhub.kubekey.local"
    privateRegistry: "dockerhub.kubekey.local"
    namespaceOverride: "kubesphereio"
    registryMirrors: []
    insecureRegistries: []

Taurus-Le avatar Aug 17 '23 05:08 Taurus-Le

I get error "unable to sign certificate: must specify a CommonName" with ./kk init registry -f k8s.yaml -a kubesphere.tar.gz when i try to install offline, solved with Taurus-Le modification.

liushuainudt avatar Aug 31 '23 08:08 liushuainudt

I get error "unable to sign certificate: must specify a CommonName" with ./kk init registry -f k8s.yaml -a kubesphere.tar.gz when i try to install offline, solved with Taurus-Le modification.

same issue , sloved ths

xueshuai0922 avatar Sep 06 '23 08:09 xueshuai0922