Rke2集群上helm 部署rancher,部署成功但是pod,有时候会重启,附有pod日志,其中rancher-webhook是什么有什么作用

环境信息:
RKE2 版本:

rke2 version v1.25.10+rke2r1 (e0c376c606754f1ae6a1c2401f4f6e9146bda0f3)

节点 CPU 架构,操作系统和版本:

集群配置:

问题描述:

重现步骤:

  • 安装 RKE2 的命令:

预期结果:
iwEcAqNwbmcDAQTRAg4FXgaw-YkRvjF1xiYFYPmPXisaAgfSK1Y7SQgACaJpbQoAC9Egmw.png_720x720q90

实际结果:

日志

rancher-webhook-66dc765c9c-p8g4t的日志
1722d9636a3527fd0954ff828da987cf0bdd122898876d650ec9bb8ca9380a18QzpcVXNlcnNcREVMTFxBcHBEYXRhXFJvYW1pbmdcRGluZ1RhbGtcNzI3MDcxNTYxX3YyXEltYWdlRmlsZXNcMTcwMTc3MzQwMDMzN19BRDU3MjhFMC1BN0M2LTQ5NzQtQkI0Mi00QTJCODM2RTU1QzcucG5n|539x500
两个pod的日志
rancher-5446bcb7f8-rlhb7的日志
[ERROR] Failed to connect to peer wss://10.42.0.15/v3/connect [local ID=10.42.1.26]: websocket: bad handshake
2023/12/06 02:16:07 [INFO] Starting management.cattle.io/v3, Kind=User controller
2023/12/06 02:16:07 [INFO] Starting management.cattle.io/v3, Kind=Token controller
2023/12/06 02:16:07 [INFO] Starting management.cattle.io/v3, Kind=GroupMember controller
2023/12/06 02:16:07 [INFO] Starting /v1, Kind=ConfigMap controller
2023/12/06 02:16:07 [INFO] Starting management.cattle.io/v3, Kind=Cluster controller
2023/12/06 02:16:07 [INFO] Starting management.cattle.io/v3, Kind=UserAttribute controller
2023/12/06 02:16:07 [INFO] Starting /v1, Kind=Secret controller
2023/12/06 02:16:07 [INFO] Starting management.cattle.io/v3, Kind=Group controller
2023/12/06 02:16:10 [INFO] Active TLS secret cattle-system/serving-cert (ver=733796) (count 8): map[field.cattle.io/projectId:local:p-fmqb9 listener.cattle.io/cn-10.42.0.15:10.42.0.15 listener.cattle.io/cn-10.42.1.26:10.42.1.26 listener.cattle.io/cn-10.42.1.4:10.42.1.4 listener.cattle.io/cn-127.0.0.1:127.0.0.1 listener.cattle.io/cn-localhost:localhost listener.cattle.io/cn-rancher.cattle-system:rancher.cattle-system listener.cattle.io/cn-rke2-rancher.test.top:rke2-rancher.test.top listener.cattle.io/fingerprint:SHA1=8A1706816FF3A70D6F60D83B8EA0D5869403A365]
2023/12/06 02:16:11 [ERROR] Failed to connect to peer wss://10.42.0.15/v3/connect [local ID=10.42.1.26]: websocket: bad handshake
2023/12/06 02:16:11 [INFO] Listening on :443
2023/12/06 02:16:11 [INFO] Listening on :80
2023/12/06 02:16:12 [INFO] Starting cluster agent for local [owner=false]
2023/12/06 02:16:12 [INFO] Starting /v1, Kind=Secret controller
2023/12/06 02:16:12 [INFO] Starting /v1, Kind=ServiceAccount controller
2023/12/06 02:16:12 [INFO] Starting rbac.authorization.k8s.io/v1, Kind=ClusterRole controller
2023/12/06 02:16:12 [INFO] Starting rbac.authorization.k8s.io/v1, Kind=RoleBinding controller
2023/12/06 02:16:12 [INFO] Starting rbac.authorization.k8s.io/v1, Kind=Role controller
2023/12/06 02:16:12 [INFO] Starting /v1, Kind=Namespace controller
2023/12/06 02:16:12 [INFO] Starting rbac.authorization.k8s.io/v1, Kind=ClusterRoleBinding controller
2023/12/06 02:16:12 [INFO] Active TLS secret cattle-system/tls-rancher-internal (ver=62680) (count 4): map[field.cattle.io/projectId:local:p-fmqb9 listener.cattle.io/cn-10.42.0.15:10.42.0.15 listener.cattle.io/cn-10.42.1.4:10.42.1.4 listener.cattle.io/cn-10.43.7.60:10.43.7.60 listener.cattle.io/fingerprint:SHA1=83C0FC40C72D8652C6A745711A9AEAA53D77F695]
2023/12/06 02:16:13 [INFO] Listening on :444
2023/12/06 02:16:16 [INFO] Starting /v1, Kind=Secret controller
2023/12/06 02:16:16 [ERROR] Failed to connect to peer wss://10.42.0.15/v3/connect [local ID=10.42.1.26]: websocket: bad handshake
2023/12/06 02:16:16 [INFO] Updating TLS secret for cattle-system/tls-rancher-internal (count: 4): map[field.cattle.io/projectId:local:p-fmqb9 listener.cattle.io/cn-10.42.0.15:10.42.0.15 listener.cattle.io/cn-10.42.1.4:10.42.1.4 listener.cattle.io/cn-10.43.7.60:10.43.7.60 listener.cattle.io/fingerprint:SHA1=83C0FC40C72D8652C6A745711A9AEAA53D77F695]
2023/12/06 02:16:16 [INFO] Updating TLS secret for cattle-system/serving-cert (count: 8): map[field.cattle.io/projectId:local:p-fmqb9 listener.cattle.io/cn-10.42.0.15:10.42.0.15 listener.cattle.io/cn-10.42.1.26:10.42.1.26 listener.cattle.io/cn-10.42.1.4:10.42.1.4 listener.cattle.io/cn-127.0.0.1:127.0.0.1 listener.cattle.io/cn-localhost:localhost listener.cattle.io/cn-rancher.cattle-system:rancher.cattle-system listener.cattle.io/cn-rke2-rancher.test.top:rke2-rancher.test.top listener.cattle.io/fingerprint:SHA1=8A1706816FF3A70D6F60D83B8EA0D5869403A365]
2023/12/06 02:16:23 [INFO] Stopping cluster agent for local
rancher-5446bcb7f8-bhhqn的日志:
2023/12/06 01:37:07 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: unexpected error when reading response body. Please retry. Original error: unexpected EOF
time=“2023-12-06 01:37:08” level=error msg=“Failed to get Cluster Loggings err=Unknown schema type [clusterLogging]”
2023/12/06 01:37:09 [INFO] Loaded configuration from /var/lib/rancher-data/driver-metadata/data.json in [0x7840ce0 /var/lib/rancher-data/driver-metadata/data.json]
2023/12/06 01:37:09 [INFO] Loaded configuration from /var/lib/rancher-data/driver-metadata/data.json in [0x7840ce0 /var/lib/rancher-data/driver-metadata/data.json]
2023/12/06 01:37:29 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: proxy error from 127.0.0.1:9345 while dialing 10.42.1.12:9443, code 503: 503 Service Unavailable
time=“2023-12-06 01:37:36” level=error msg=“Failed to get Pipelines for project local:p-fmqb9 err=Unknown schema type [pipeline]”
time=“2023-12-06 01:37:36” level=error msg=“Failed to get SourceCodeProvider for project local:p-fmqb9 err=Unknown schema type [sourceCodeProvider]”
2023/12/06 01:37:37 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: proxy error from 127.0.0.1:9345 while dialing 10.42.1.12:9443, code 503: 503 Service Unavailable
time=“2023-12-06 01:37:40” level=error msg=“Failed to get Pipelines for project local:p-lkkt2 err=Unknown schema type [pipeline]”
time=“2023-12-06 01:37:40” level=error msg=“Failed to get SourceCodeProvider for project local:p-lkkt2 err=Unknown schema type [sourceCodeProvider]”
time=“2023-12-06 01:37:41” level=error msg=“Failed to get Pipelines for project local:p-xf4cc err=Unknown schema type [pipeline]”
time=“2023-12-06 01:37:41” level=error msg=“Failed to get SourceCodeProvider for project local:p-xf4cc err=Unknown schema type [sourceCodeProvider]”
2023/12/06 01:37:48 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: proxy error from 127.0.0.1:9345 while dialing 10.42.1.12:9443, code 503: 503 Service Unavailable
2023/12/06 01:38:02 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: proxy error from 127.0.0.1:9345 while dialing 10.42.1.12:9443, code 503: 503 Service Unavailable
2023/12/06 01:38:17 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: proxy error from 127.0.0.1:9345 while dialing 10.42.1.12:9443, code 503: 503 Service Unavailable
2023/12/06 01:38:32 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: proxy error from 127.0.0.1:9345 while dialing 10.42.1.12:9443, code 503: 503 Service Unavailable
2023/12/06 01:38:47 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: no endpoints available for service “rancher-webhook”
2023/12/06 01:39:02 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: no endpoints available for service “rancher-webhook”
2023/12/06 01:39:17 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: no endpoints available for service “rancher-webhook”
2023/12/06 01:39:32 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: no endpoints available for service “rancher-webhook”
2023/12/06 01:39:47 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: no endpoints available for service “rancher-webhook”
2023/12/06 01:40:02 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: no endpoints available for service “rancher-webhook”
2023/12/06 01:40:17 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: no endpoints available for service “rancher-webhook”
2023/12/06 01:40:42 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: context deadline exceeded
2023/12/06 01:40:50 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: EOF
2023/12/06 01:41:02 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: no endpoints available for service “rancher-webhook”
2023/12/06 01:41:17 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: no endpoints available for service “rancher-webhook”
2023/12/06 01:41:32 [ERROR] [updateClusterHealth] Failed to update cluster [local]: Internal error occurred: failed calling webhook “rancher.cattle.io.clusters.management.cattle.io”: failed to call webhook: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/mutation/clusters.management.cattle.io?timeout=10s”: no endpoints available for service “rancher-webhook”
W1206 01:42:56.008427 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 Cluster is deprecated; use cluster.x-k8s.io/v1beta1 Cluster
W1206 01:43:22.173672 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineDeployment is deprecated; use cluster.x-k8s.io/v1beta1 MachineDeployment
W1206 01:44:02.028262 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 Machine is deprecated; use cluster.x-k8s.io/v1beta1 Machine
W1206 01:44:47.842402 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineHealthCheck is deprecated; use cluster.x-k8s.io/v1beta1 MachineHealthCheck
W1206 01:44:52.920081 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineSet is deprecated; use cluster.x-k8s.io/v1beta1 MachineSet
W1206 01:48:31.923035 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 Cluster is deprecated; use cluster.x-k8s.io/v1beta1 Cluster
W1206 01:50:18.927083 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineSet is deprecated; use cluster.x-k8s.io/v1beta1 MachineSet
W1206 01:51:44.179537 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineDeployment is deprecated; use cluster.x-k8s.io/v1beta1 MachineDeployment
W1206 01:52:01.030481 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 Machine is deprecated; use cluster.x-k8s.io/v1beta1 Machine
W1206 01:52:27.844142 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineHealthCheck is deprecated; use cluster.x-k8s.io/v1beta1 MachineHealthCheck
W1206 01:55:57.927510 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 Cluster is deprecated; use cluster.x-k8s.io/v1beta1 Cluster
W1206 01:57:13.033303 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 Machine is deprecated; use cluster.x-k8s.io/v1beta1 Machine
W1206 01:58:07.930110 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineSet is deprecated; use cluster.x-k8s.io/v1beta1 MachineSet
W1206 01:58:56.180240 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineDeployment is deprecated; use cluster.x-k8s.io/v1beta1 MachineDeployment
W1206 02:02:25.848590 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineHealthCheck is deprecated; use cluster.x-k8s.io/v1beta1 MachineHealthCheck
W1206 02:04:17.034471 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 Machine is deprecated; use cluster.x-k8s.io/v1beta1 Machine
W1206 02:04:43.928466 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 Cluster is deprecated; use cluster.x-k8s.io/v1beta1 Cluster
W1206 02:04:53.934026 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineSet is deprecated; use cluster.x-k8s.io/v1beta1 MachineSet
W1206 02:05:53.271884 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineDeployment is deprecated; use cluster.x-k8s.io/v1beta1 MachineDeployment
W1206 02:07:54.852777 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineHealthCheck is deprecated; use cluster.x-k8s.io/v1beta1 MachineHealthCheck
W1206 02:11:24.930553 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 Cluster is deprecated; use cluster.x-k8s.io/v1beta1 Cluster
W1206 02:13:33.245184 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineDeployment is deprecated; use cluster.x-k8s.io/v1beta1 MachineDeployment
W1206 02:13:46.037470 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 Machine is deprecated; use cluster.x-k8s.io/v1beta1 Machine
W1206 02:14:19.940434 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineSet is deprecated; use cluster.x-k8s.io/v1beta1 MachineSet
W1206 02:15:02.858123 33 warnings.go:80] cluster.x-k8s.io/v1alpha3 MachineHealthCheck is deprecated; use cluster.x-k8s.io/v1beta1 MachineHealthCheck
2023/12/06 02:15:59 [ERROR] Failed to handle tunnel request from remote address 10.42.1.26:35116: response 400: cluster not found
2023/12/06 02:16:06 [ERROR] Failed to handle tunnel request from remote address 10.42.1.26:35166: response 400: cluster not found
2023/12/06 02:16:11 [ERROR] Failed to handle tunnel request from remote address 10.42.1.26:35198: response 400: cluster not found
2023/12/06 02:16:16 [ERROR] Failed to handle tunnel request from remote address 10.42.1.26:35232: response 400: cluster not found
2023/12/06 02:16:22 [INFO] Adding peer wss://10.42.1.26/v3/connect, 10.42.1.26