水上冰石 2022-08-05 18:44 采纳率: 0%
浏览 1067
已结题

etcd发现错误: kubelet, k8smaster Liveness probe failed: HTTP probe failed with statuscode: 503

问题遇到的现象和发生背景

树莓派arm64版本用kubeadm方式部署k8s,一切正常,不过查看etcd的时候,发现错误:

 有错误503: 


###### 问题相关代码,请勿粘贴截图 


```bash
[root@k8smaster ~]# kubectl describe pods etcd-k8smaster  -n kube-system





###### 运行结果及报错内容 



```bash
Name:                 etcd-k8smaster
Namespace:            kube-system
Priority:             2000000000
Priority Class Name:  system-cluster-critical
Node:                 k8smaster/192.168.0.200
Start Time:           Fri, 05 Aug 2022 14:19:59 +0800
Labels:               component=etcd
                      tier=control-plane
Annotations:          kubeadm.kubernetes.io/etcd.advertise-client-urls: https://192.168.0.200:2379
                      kubernetes.io/config.hash: 20226498f18eda5486f418f7d909e916
                      kubernetes.io/config.mirror: 20226498f18eda5486f418f7d909e916
                      kubernetes.io/config.seen: 2022-07-28T17:58:49.915164955+08:00
                      kubernetes.io/config.source: file
Status:               Running
IP:                   192.168.0.200
IPs:
  IP:           192.168.0.200
Controlled By:  Node/k8smaster
Containers:
  etcd:
    Container ID:  docker://b013638179154125b2fa23a54dd4a923f8c37a2adcbc4e4acc93101b6222e148
    Image:         registry.aliyuncs.com/google_containers/etcd:3.4.3-0
    Image ID:      docker-pullable://registry.aliyuncs.com/google_containers/etcd@sha256:4afb99b4690b418ffc2ceb67e1a17376457e441c1f09ab55447f0aaf992fa646
    Port:          <none>
    Host Port:     <none>
    Command:
      etcd
      --advertise-client-urls=https://192.168.0.200:2379
      --cert-file=/etc/kubernetes/pki/etcd/server.crt
      --client-cert-auth=true
      --data-dir=/var/lib/etcd
      --initial-advertise-peer-urls=https://192.168.0.200:2380
      --initial-cluster=k8smaster=https://192.168.0.200:2380
      --key-file=/etc/kubernetes/pki/etcd/server.key
      --listen-client-urls=https://127.0.0.1:2379,https://192.168.0.200:2379
      --listen-metrics-urls=http://127.0.0.1:2381
      --listen-peer-urls=https://192.168.0.200:2380
      --name=k8smaster
      --peer-cert-file=/etc/kubernetes/pki/etcd/peer.crt
      --peer-client-cert-auth=true
      --peer-key-file=/etc/kubernetes/pki/etcd/peer.key
      --peer-trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt
      --snapshot-count=10000
      --trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt
    State:          Running
      Started:      Fri, 05 Aug 2022 14:20:04 +0800
    Last State:     Terminated
      Reason:       Completed
      Exit Code:    0
      Started:      Thu, 04 Aug 2022 10:12:17 +0800
      Finished:     Fri, 05 Aug 2022 14:19:02 +0800
    Ready:          True
    Restart Count:  18
    Liveness:       http-get http://127.0.0.1:2381/health delay=15s timeout=15s period=10s #success=1 #failure=8
    Environment:    <none>
    Mounts:
      /etc/kubernetes/pki/etcd from etcd-certs (rw)
      /var/lib/etcd from etcd-data (rw)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  etcd-certs:
    Type:          HostPath (bare host directory volume)
    Path:          /etc/kubernetes/pki/etcd
    HostPathType:  DirectoryOrCreate
  etcd-data:
    Type:          HostPath (bare host directory volume)
    Path:          /var/lib/etcd
    HostPathType:  DirectoryOrCreate
QoS Class:         BestEffort
Node-Selectors:    <none>
Tolerations:       :NoExecute
Events:
  Type     Reason     Age                   From                Message
  ----     ------     ----                  ----                -------
  Warning  Unhealthy  53s (x46 over 3h55m)  kubelet, k8smaster  Liveness probe failed: HTTP probe failed with statuscode: 503

错误:






###### 我的解答思路和尝试过的方法 


[root@k8smaster ~]#  kubectl get all -o wide



```bash
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE   SELECTOR
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   8d    <none>

我想要达到的结果

etcd 探测可以显示正常

  • 写回答

1条回答 默认 最新

  • 优质网络系统领域创作者 网络领域新星创作者 2022-08-10 08:19
    关注

    原来是liveness probe(存活探针)报错,观察yaml文件:
    ……
    livenessProbe:
    failureThreshold: 3
    httpGet:
    path: /
    port: 1880
    scheme: HTTP
    periodSeconds: 10
    successThreshold: 1
    timeoutSeconds: 1
    ……
    而应用中没有对GET请求的处理,所以会出错,删除yaml文件中的livenessProbe相关配置,重启部署解决。

    评论

报告相同问题?

问题事件

  • 系统已结题 8月13日
  • 创建了问题 8月5日

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置