为什么创建kubernetes集群后/var/lib/cni/networks为null?
Why /var/lib/cni/networks is null after creating a kubernetes cluster?
安装了带有 Calico、CoreDNS 的 kubernetes 集群。
检查一个 CoreDNS 的事件消息得到
Readiness probe failed: HTTP probe failed with statuscode: 503
/var/lib/cni/networks/
目录下什么都没有。为什么?如何修复?
连pods的状态都是运行,但担心它的健康
日志
# kubectl logs coredns-1308140hfw -n kube-system
[INFO] plugin/ready: Still waiting on: "kubernetes"
.:53
[INFO] plugin/reload: Running configuration MD5 = 20328084ha6966e76816bcd928foa
CoreDNS-1.7.0
linux/amd64, go1.14.4, f59c03d
[INFO] plugin/ready: Still waiting on: "kubernetes"
[INFO] plugin/ready: Still waiting on: "kubernetes"
I0804 08:18:03.874045 1 trace.go:116] Trace[336122540]: "Reflector ListAndWatch" name:pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125 (started: 2020-08-04 08:17:33.872753993 +0000 UTC m=+0.038838328) (total time: 30.001059939s):
Trace[336122540]: [30.001059939s] [30.001059939s] END
E0804 08:18:03.874108 1 reflector.go:178] pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125: Failed to list *v1.Endpoints: Get "https://[IPv6]:443/api/v1/endpoints?limit=500&resourceVersion=0": dial tcp [IPv6]:443: i/o timeout
I0804 08:18:03.874047 1 trace.go:116] Trace[208240456]: "Reflector ListAndWatch" name:pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125 (started: 2020-08-04 08:17:33.872755558 +0000 UTC m=+0.038839930) (total time: 30.001213767s):
Trace[208240456]: [30.001213767s] [30.001213767s] END
E0804 08:18:03.874137 1 reflector.go:178] pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125: Failed to list *v1.Namespace: Get "https://[IPv6]:443/api/v1/namespaces?limit=500&resourceVersion=0": dial tcp [IPv6]:443: i/o timeout
I0804 08:18:03.874214 1 trace.go:116] Trace[1106410694]: "Reflector ListAndWatch" name:pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125 (started: 2020-08-04 08:17:33.872753715 +0000 UTC m=+0.038838086) (total time: 30.001438405s):
Trace[1106410694]: [30.001438405s] [30.001438405s] END
E0804 08:18:03.874248 1 reflector.go:178] pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125: Failed to list *v1.Service: Get "https://[IPv6]:443/api/v1/services?limit=500&resourceVersion=0": dial tcp [IPv6]:443: i/o timeout
就绪探测器如何工作?
Sometimes, applications are temporarily unable to serve traffic. For
example, an application might need to load large data or configuration
files during startup. In such cases, you don't want to kill the
application, but you don’t want to send it requests either. Kubernetes
provides readiness probes to detect and mitigate these situations. A
pod with containers reporting that they are not ready does not receive
traffic through Kubernetes Services.
当 pod 启动时,Kubernetes 可以配置为在执行第一次就绪检查之前等待一段可配置的时间。之后,它会定期调用探测器并根据就绪探测器的结果采取行动。如果一个 pod 报告它还没有准备好,它就会从服务中移除。如果 pod 然后再次准备就绪,则为 re-added。
这意味着在您的情况下,您的 coreDNS
pod 并不完全 运行,但 Kubernetes 已经开始发送探测器来检查它 readiness
。
多亏了这些探测,当你有几个副本时,Kubernetes 只会将流量定向到健康的副本(探测成功)。
PS。我的 /var/lib/cni/networks/
目录也是空的。
安装了带有 Calico、CoreDNS 的 kubernetes 集群。
检查一个 CoreDNS 的事件消息得到
Readiness probe failed: HTTP probe failed with statuscode: 503
/var/lib/cni/networks/
目录下什么都没有。为什么?如何修复?
连pods的状态都是运行,但担心它的健康
日志
# kubectl logs coredns-1308140hfw -n kube-system
[INFO] plugin/ready: Still waiting on: "kubernetes"
.:53
[INFO] plugin/reload: Running configuration MD5 = 20328084ha6966e76816bcd928foa
CoreDNS-1.7.0
linux/amd64, go1.14.4, f59c03d
[INFO] plugin/ready: Still waiting on: "kubernetes"
[INFO] plugin/ready: Still waiting on: "kubernetes"
I0804 08:18:03.874045 1 trace.go:116] Trace[336122540]: "Reflector ListAndWatch" name:pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125 (started: 2020-08-04 08:17:33.872753993 +0000 UTC m=+0.038838328) (total time: 30.001059939s):
Trace[336122540]: [30.001059939s] [30.001059939s] END
E0804 08:18:03.874108 1 reflector.go:178] pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125: Failed to list *v1.Endpoints: Get "https://[IPv6]:443/api/v1/endpoints?limit=500&resourceVersion=0": dial tcp [IPv6]:443: i/o timeout
I0804 08:18:03.874047 1 trace.go:116] Trace[208240456]: "Reflector ListAndWatch" name:pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125 (started: 2020-08-04 08:17:33.872755558 +0000 UTC m=+0.038839930) (total time: 30.001213767s):
Trace[208240456]: [30.001213767s] [30.001213767s] END
E0804 08:18:03.874137 1 reflector.go:178] pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125: Failed to list *v1.Namespace: Get "https://[IPv6]:443/api/v1/namespaces?limit=500&resourceVersion=0": dial tcp [IPv6]:443: i/o timeout
I0804 08:18:03.874214 1 trace.go:116] Trace[1106410694]: "Reflector ListAndWatch" name:pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125 (started: 2020-08-04 08:17:33.872753715 +0000 UTC m=+0.038838086) (total time: 30.001438405s):
Trace[1106410694]: [30.001438405s] [30.001438405s] END
E0804 08:18:03.874248 1 reflector.go:178] pkg/mod/k8s.io/client-go@v0.18.3/tools/cache/reflector.go:125: Failed to list *v1.Service: Get "https://[IPv6]:443/api/v1/services?limit=500&resourceVersion=0": dial tcp [IPv6]:443: i/o timeout
就绪探测器如何工作?
Sometimes, applications are temporarily unable to serve traffic. For example, an application might need to load large data or configuration files during startup. In such cases, you don't want to kill the application, but you don’t want to send it requests either. Kubernetes provides readiness probes to detect and mitigate these situations. A pod with containers reporting that they are not ready does not receive traffic through Kubernetes Services.
当 pod 启动时,Kubernetes 可以配置为在执行第一次就绪检查之前等待一段可配置的时间。之后,它会定期调用探测器并根据就绪探测器的结果采取行动。如果一个 pod 报告它还没有准备好,它就会从服务中移除。如果 pod 然后再次准备就绪,则为 re-added。
这意味着在您的情况下,您的 coreDNS
pod 并不完全 运行,但 Kubernetes 已经开始发送探测器来检查它 readiness
。
多亏了这些探测,当你有几个副本时,Kubernetes 只会将流量定向到健康的副本(探测成功)。
PS。我的 /var/lib/cni/networks/
目录也是空的。