Kubernetes然后是牧场主超时

如何解决Kubernetes然后是牧场主超时

我已经使用k3s 1.18.4和MariaDB作为后端建立了一个rancher 2.4小基础设施。

一切都运行了25天,但是现在,我无法再登录rancher,这就像API在443上不再响应了,容器现在崩溃了,因为那时无法联系kubernetes集群。

我在另一台服务器上有一个Nginx负载均衡器,即使几天也可以正常工作,但现在一切都超时了:

==> https_lb.log

yyyy.yyy.yyy.yyy [18/Aug/2020:07:09:42 +0200] TCP 502 0 0 31.510 "xx.xx.xx.xx:443" "0" "0" "31.508"

==> error.log

2020/08/18 07:10:02 [error] 29966#29966: *81 connect() failed (110: Connection timed out) while connecting to upstream,client: yyyy.yyy.yyy.yyy,server: 0.0.0.0:443,upstream: "xx.xx.xx.xx:443",bytes from/to client:0/0,bytes from/to upstream:0/0

例如,该API在6443端口上的回答很好:

curl https://localhost:6443/ping --insecure
pong

服务似乎也很好:

kubectl get services
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.43.0.1    <none>        443/TCP   7h53m

kubectl get nodes
NAME    STATUS   ROLES    AGE   VERSION
k3sh1   Ready    master   32d   v1.18.4+k3s1
k3sw4   Ready    <none>   28d   v1.18.6+k3s1
k3sw3   Ready    <none>   28d   v1.18.6+k3s1
k3sw2   Ready    <none>   28d   v1.18.6+k3s1

当然,每个想法现在都是KO,因为到处都有超时,例如:

2020-08-17T22:40:04.421339807+02:00 stderr F ERROR: logging before flag.Parse: E0817 20:40:04.418868       1 reflector.go:251] github.com/kubernetes-incubator/external-storage/lib/controller/controller.go:603: Failed to watch *v1.PersistentVolumeClaim: Get https://10.43.0.1:443/api/v1/persistentvolumeclaims?resourceVersion=15748753&timeoutSeconds=499&watch=true: dial tcp 10.43.0.1:443: connect: connection refused
2020-08-17T22:40:04.421345285+02:00 stderr F ERROR: logging before flag.Parse: E0817 20:40:04.418809       1 reflector.go:251] github.com/kubernetes-incubator/external-storage/lib/controller/controller.go:609: Failed to watch *v1.StorageClass: Get https://10.43.0.1:443/apis/storage.k8s.io/v1/storageclasses?resourceVersion=15748753&timeoutSeconds=381&watch=true: dial tcp 10.43.0.1:443: connect: connection refused

依此类推...

有人可以帮我看看解决此问题的正确方向吗?

更新1

正在运行的豆荚列表

kubectl get pods --all-namespaces -owide
NAMESPACE       NAME                                       READY   STATUS             RESTARTS   AGE    IP               NODE    NOMINATED NODE   READINESS GATES
recette         app-test-65c94f999c-g6t56                  1/1     Running            0          15d    10.42.1.6        k3sw3   <none>           <none>
recette         database-proftpd-7c598d6698-mtp5m          1/1     Running            0          3d9h   10.42.2.3        k3sw4   <none>           <none>
recette         redis-d84785cf5-9t7sj                      1/1     Running            0          3d9h   10.42.1.7        k3sw3   <none>           <none>
kube-system     metrics-server-7566d596c8-tbfpp            1/1     Running            0          32h    10.42.1.15       k3sw3   <none>           <none>
cert-manager    cert-manager-webhook-746cf468-2t7c7        1/1     Running            0          8h     10.42.0.52       k3sh1   <none>           <none>
cert-manager    cert-manager-cainjector-5579468649-dj5fj   1/1     Running            0          8h     10.42.0.53       k3sh1   <none>           <none>
cert-manager    cert-manager-66bbb47c56-t5h6x              1/1     Running            0          8h     10.42.0.54       k3sh1   <none>           <none>
kube-system     local-path-provisioner-6d59f47c7-4vf2b     1/1     Running            0          8h     10.42.0.55       k3sh1   <none>           <none>
kube-system     coredns-8655855d6-lf2lt                    1/1     Running            0          8h     10.42.0.56       k3sh1   <none>           <none>
cattle-system   rancher-c5766f5f9-vnrht                    1/1     Running            0          8h     10.42.2.7        k3sw4   <none>           <none>
cattle-system   rancher-c5766f5f9-hqxvc                    1/1     Running            0          8h     10.42.3.6        k3sw2   <none>           <none>
recette         database-7fc89fc4bc-5xr7m                  1/1     Running            0          3d9h   10.42.2.4        k3sw4   <none>           <none>
cattle-system   rancher-c5766f5f9-n8fnm                    1/1     Running            0          8h     10.42.0.57       k3sh1   <none>           <none>
kube-system     traefik-758cd5fc85-2vdqr                   1/1     Running            0          8h     10.42.1.18       k3sw3   <none>           <none>
cattle-system   cattle-node-agent-6lrfg                    0/1     CrashLoopBackOff   359        32h    some_public_ip     k3sw4   <none>           <none>
cattle-system   cattle-node-agent-gd2mh                    0/1     CrashLoopBackOff   181        15h    some_other_public_ip   k3sw3   <none>           <none>
cattle-system   cattle-node-agent-67bqb                    0/1     CrashLoopBackOff   364        32h    some_other_public_ip     k3sh1   <none>           <none>
cattle-system   cattle-node-agent-vvfwm                    0/1     Error              361        32h    some_other_public_ip   k3sw2   <none>           <none>
cattle-system   cattle-cluster-agent-74b5586858-jnbv2      1/1     Running            100        8h     10.42.1.19       k3sw3   <none>           <none>

在我的牧场主豆荚里,我看到他们不能互相交谈:

kubectl logs -f -n cattle-system rancher-c5766f5f9-vnrht
2020/08/19 05:18:36 [ERROR] Failed to connect to peer wss://10.42.3.6/v3/connect [local ID=10.42.2.7]: dial tcp 10.42.3.6:443: i/o timeout
2020/08/19 05:18:37 [ERROR] Failed to connect to peer wss://10.42.0.57/v3/connect [local ID=10.42.2.7]: dial tcp 10.42.0.57:443: i/o timeout
2020/08/19 05:18:51 [ERROR] Failed to connect to peer wss://10.42.3.6/v3/connect [local ID=10.42.2.7]: dial tcp 10.42.3.6:443: i/o timeout
2020/08/19 05:18:52 [ERROR] Failed to connect to peer wss://10.42.0.57/v3/connect [local ID=10.42.2.7]: dial tcp 10.42.0.57:443: i/o timeout
2020/08/19 05:19:06 [ERROR] Failed to connect to peer wss://10.42.3.6/v3/connect [local ID=10.42.2.7]: dial tcp 10.42.3.6:443: i/o timeout
2020/08/19 05:19:07 [ERROR] Failed to connect to peer wss://10.42.0.57/v3/connect [local ID=10.42.2.7]: dial tcp 10.42.0.57:443: i/o timeout

更新2:

我设法通过重置所有iptables规则来修复拨号错误,然后重新启动k3s。我现在遇到了阻止牧场主启动的错误:

E0819 06:35:44.274663       7 reflector.go:178] github.com/rancher/steve/pkg/clustercache/controller.go:164: Failed to list *summary.SummarizedObject: conversion webhook for cert-manager.io/v1alpha2,Kind=CertificateRequest failed: Post https://cert-manager-webhook.cert-manager.svc:443/convert?timeout=30s: service "cert-manager-webhook" not found                                                                   │
│ E0819 06:35:45.324406       7 reflector.go:178] github.com/rancher/steve/pkg/clustercache/controller.go:164: Failed to list *summary.SummarizedObject: conversion webhook for acme.cert-manager.io/v1alpha2,Kind=Order failed: Post https://cert-manager-webhook.cert-manager.svc:443/convert?timeout=30s: service "cert-manager-webhook" not found                                                                           │
│ E0819 06:35:49.022959       7 reflector.go:178] github.com/rancher/steve/pkg/clustercache/controller.go:164: Failed to list *summary.SummarizedObject: conversion webhook for cert-manager.io/v1alpha2,Kind=Certificate failed: Post https://cert-manager-webhook.cert-manager.svc:443/convert?timeout=30s: service "cert-manager-webhook" not found  

解决方法

重新安装了证书管理器,并发布了自签名证书来解决此问题。

,

将其发布为Community Wiki以获得更好的可见性。

K3sLightweight Kubernetes,此处描述的情况与reset之后的Kubeadm行为非常相似。

kubeadm reset负责从使用kubeadm initkubeadm join命令创建的文件中清除节点本地文件系统。对于控制平面节点,重置还会从etcd群集中删除该节点的本地堆叠etcd成员,也将从kubeadm ClusterStatus对象中删除此节点的信息。 ClusterStatuskubeadm托管的Kubernetes API对象,其中包含kube-apiserver端点的列表。

意思是,当您使用reset时,它将删除许多配置,同时也会删除certificates。正如我在评论中提到的那样,该问题与缺少证书有关:

Failed to list *summary.SummarizedObject: conversion webhook for acme.cert-manager.io/v1alpha2,Kind=Order failed: Post https://cert-manager-webhook.cert-manager.svc:443/convert?timeout=30s: service "cert-manager-webhook" not found

使用reset命令将其删除。

解决方案已重新安装Cert-Manager并重新创建certificate

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-