• 安装部署
  • Kubernetes 最小化安装 KubeSphere v3.2.0;ks-installer 出现 “CrashLoopBackOff” 问题

创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。
发帖前请点击 发表主题 右边的 预览(👀) 按钮,确保帖子格式正确。

操作系统信息

树莓派4b+ raspberry 4C8G debian10 (buster)

Kubernetes版本信息

K8S: v1.20.9

容器运行时

Docker version 20.10.1, build 831ebea

**KubeSphere版本信息:**

KubeSphere v3.2.0

问题是什么
在使用树莓派4B+时时,最小化安装 KubeSphere v3.2.0;ks-installer 出现 “CrashLoopBackOff” 问题

  • 系统:debian10 (buster)
  • K8S: v1.20.9
pi@raspbian ~/m/k8s> uname -a
Linux raspbian 5.4.83-OPENFANS+20210102-v8 #1 SMP Sat Jan 2 21:52:54 CST 2021 aarch64 GNU/Linux
pi@raspbian ~/m/k8s> 
pi@raspbian ~/m/k8s> 
pi@raspbian ~/m/k8s> cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

关键日志

pi@raspbian ~/m/k8s> docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.0-docker)

Server:
 Containers: 32
  Running: 21
  Paused: 0
  Stopped: 11
 Images: 45
 Server Version: 20.10.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.4.83-OPENFANS+20210102-v8
 Operating System: Debian GNU/Linux 10 (buster)
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 7.677GiB
 Name: raspbian
 ID: ZDXH:MDJW:4MK6:NRZE:NVUK:5SLR:GWKN:R2HX:WXAQ:6P7A:KOMO:IXO7
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Registry Mirrors:
  https://ximk15cc.mirror.aliyuncs.com/
 Live Restore Enabled: false

WARNING: No blkio weight support
WARNING: No blkio weight_device support
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
pi@raspbian ~/m/k8s> 
pi@raspbian ~/m/k8s> docker --version
Docker version 20.10.1, build 831ebea

pi@raspbian ~/m/k8s> free -g
              total        used        free      shared  buff/cache   available
Mem:              7           1           3           0           2           6
Swap:             0           0           0
pi@raspbian ~/m/k8s> kubectl version -o json
{
  "clientVersion": {
    "major": "1",
    "minor": "20",
    "gitVersion": "v1.20.9",
    "gitCommit": "7a576bc3935a6b555e33346fd73ad77c925e9e4a",
    "gitTreeState": "clean",
    "buildDate": "2021-07-15T21:01:38Z",
    "goVersion": "go1.15.14",
    "compiler": "gc",
    "platform": "linux/arm64"
  },
  "serverVersion": {
    "major": "1",
    "minor": "20",
    "gitVersion": "v1.20.9",
    "gitCommit": "7a576bc3935a6b555e33346fd73ad77c925e9e4a",
    "gitTreeState": "clean",
    "buildDate": "2021-07-15T20:56:38Z",
    "goVersion": "go1.15.14",
    "compiler": "gc",
    "platform": "linux/arm64"
  }
}
pi@raspbian ~/m/k8s> kubectl get pods -owide -A
NAMESPACE           NAME                                       READY   STATUS              RESTARTS   AGE     IP               NODE       NOMINATED NODE   READINESS GATES
default             nfs-client-provisioner-68c57c55f9-llxv5    0/1     ContainerCreating   0          3h26m   <none>           raspbian   <none>           <none>
kube-system         calico-kube-controllers-558995777d-tjqsw   1/1     Running             0          6h28m   192.168.209.2    raspbian   <none>           <none>
kube-system         calico-node-ncpfh                          1/1     Running             0          6h28m   192.168.31.141   raspbian   <none>           <none>
kube-system         coredns-7f89b7bc75-6hq5h                   1/1     Running             0          6h36m   192.168.209.1    raspbian   <none>           <none>
kube-system         coredns-7f89b7bc75-jld2p                   1/1     Running             0          6h36m   192.168.209.3    raspbian   <none>           <none>
kube-system         etcd-raspbian                              1/1     Running             1          6h36m   192.168.31.141   raspbian   <none>           <none>
kube-system         kube-apiserver-raspbian                    1/1     Running             2          6h36m   192.168.31.141   raspbian   <none>           <none>
kube-system         kube-controller-manager-raspbian           1/1     Running             6          6h36m   192.168.31.141   raspbian   <none>           <none>
kube-system         kube-proxy-d64nt                           1/1     Running             0          6h36m   192.168.31.141   raspbian   <none>           <none>
kube-system         kube-scheduler-raspbian                    1/1     Running             6          6h36m   192.168.31.141   raspbian   <none>           <none>
kube-system         metrics-server-594d97c4fd-6k7sq            1/1     Running             0          66m     192.168.209.11   raspbian   <none>           <none>
kubesphere-system   ks-installer-7fbc5d568f-lbvth              0/1     CrashLoopBackOff    7          17m     192.168.209.12   raspbian   <none>           <none>
pi@raspbian ~/m/k8s> 
pi@raspbian ~/m/k8s> kubectl describe pod ks-installer-7fbc5d568f-lbvth -n kubesphere-system
Name:         ks-installer-7fbc5d568f-lbvth

pi@raspbian ~/m/k8s> kubectl describe pod ks-installer-7fbc5d568f-lbvth -n kubesphere-system
Name:         ks-installer-7fbc5d568f-lbvth
Namespace:    kubesphere-system
Priority:     0
Node:         raspbian/192.168.31.141
Start Time:   Sat, 11 Dec 2021 22:36:03 +0800
Labels:       app=ks-install
              pod-template-hash=7fbc5d568f
Annotations:  cni.projectcalico.org/containerID: 50f3f33d6145cd6b4d0a9be1943672532f5831c4ef4b7e556806d19890da6c66
              cni.projectcalico.org/podIP: 192.168.209.12/32
              cni.projectcalico.org/podIPs: 192.168.209.12/32
Status:       Running
IP:           192.168.209.12
IPs:
  IP:           192.168.209.12
Controlled By:  ReplicaSet/ks-installer-7fbc5d568f
Containers:
  installer:
    Container ID:   docker://2979883af5de3b83ae2e66e8e677d560701b7fd839a8673be7fd6fc2da07c596
    Image:          kubesphere/ks-installer:v3.2.0
    Image ID:       docker-pullable://kubesphere/ks-installer@sha256:eaece46e558156834eedad726b35963375d5a2555f4b539a7461fd1367cee930
    Port:           <none>
    Host Port:      <none>
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Sat, 11 Dec 2021 22:49:25 +0800
      Finished:     Sat, 11 Dec 2021 22:49:25 +0800
    Ready:          False
    Restart Count:  7
    Limits:
      cpu:     1
      memory:  1Gi
    Requests:
      cpu:        20m
      memory:     100Mi
    Environment:  <none>
    Mounts:
      /etc/localtime from host-time (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from ks-installer-token-b979f (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  host-time:
    Type:          HostPath (bare host directory volume)
    Path:          /etc/localtime
    HostPathType:  
  ks-installer-token-b979f:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  ks-installer-token-b979f
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age                   From               Message
  ----     ------     ----                  ----               -------
  Normal   Scheduled  18m                   default-scheduler  Successfully assigned kubesphere-system/ks-installer-7fbc5d568f-lbvth to raspbian
  Normal   Pulled     18m                   kubelet            Successfully pulled image "kubesphere/ks-installer:v3.2.0" in 15.50069939s
  Normal   Pulled     17m                   kubelet            Successfully pulled image "kubesphere/ks-installer:v3.2.0" in 15.537466203s
  Normal   Pulled     17m                   kubelet            Successfully pulled image "kubesphere/ks-installer:v3.2.0" in 15.537262824s
  Normal   Created    16m (x4 over 18m)     kubelet            Created container installer
  Normal   Started    16m (x4 over 18m)     kubelet            Started container installer
  Normal   Pulled     16m                   kubelet            Successfully pulled image "kubesphere/ks-installer:v3.2.0" in 15.533138171s
  Normal   Pulling    15m (x5 over 18m)     kubelet            Pulling image "kubesphere/ks-installer:v3.2.0"
  Warning  BackOff    3m20s (x61 over 17m)  kubelet            Back-off restarting failed container
pi@raspbian ~/m/k8s> 
pi@raspbian ~/m/k8s> 
pi@raspbian ~/m/k8s> kubectl get sc
NAME                    PROVISIONER                                   RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
nfs-storage (default)   k8s-sigs.io/nfs-subdir-external-provisioner   Delete          Immediate           false                  3h27m
pi@raspbian ~/m/k8s> 
pi@raspbian ~/m/k8s> kubectl logs ks-installer-7fbc5d568f-lbvth -n kubesphere-system
standard_init_linux.go:219: exec user process caused: exec format error

关键截图

    目前 还不支持arm架构的安装. 这个是因为默认镜像下载的是amd的镜像

      6 天 后

      用kubesphere3.2.1部署kubernets1.21.5集群,在执行./kk create cluster -f config-sample.yaml报错:

      Error: Failed to download cluster config: Failed to unmarshal configuration: json: cannot unmarshal number into Go struct field HostCfg.spec.hosts.password of type string

      Usage:

      kk create cluster [flags]

      Flags:

        --container-manager string   Container runtime: docker, crio, containerd and isula. (default "docker                                                           ")
      
        --download-cmd string        The user defined command to download the necessary binary files. The fi                                                           rst param '%s' is output path, the second param '%s', is the URL (default "curl -L -o %s %s")

      -f, –filename string Path to a configuration file

      -h, –help help for cluster

        --skip-pull-images           Skip pre pull images
      
        --with-kubernetes string     Specify a supported version of kubernetes (default "v1.21.5")
      
        --with-kubesphere            Deploy a specific version of kubesphere (default v3.2.0)
      
        --with-local-storage         Deploy a local PV provisioner

      -y, –yes Skip pre-check of the installation

      Global Flags:

        --debug        Print detailed information (default true)
      
        --in-cluster   Running inside the cluster

      Failed to download cluster config: Failed to unmarshal configuration: json: cannot unmarshal number into G o struct field HostCfg.spec.hosts.password of type string

      不知道是什么原因,系统centos7.6 内核3.10.0-957.el7.x86_64

      你的config-sample.yaml 文件中password 字段 你填写的全是数字,如果你密码全是数字,用"" 包裹起来,再试试

      4 个月 后