更新时间:2020-11-24 21:45
本文主要介绍添加已有的ECS实例到Kubernetes集群的常见问题。
阿里云提醒您:
- 如果您对实例或数据有修改、变更等风险操作,务必注意实例的容灾、容错能力,确保数据安全。
- 如果您对实例(包括但不限于ECS、RDS)等进行配置与数据修改,建议提前创建快照或开启RDS日志备份等功能。
- 如果您在阿里云平台授权或者提交过登录账号、密码等安全信息,建议您及时修改。
若出现节点添加失败的问题,请确认是否满足以下条件:
下图是通过API添加集群节点的流程图。
cat /var/log/messages | grep cloud-init
报错信息 |
解决方法 |
Code: ForbiddenAttachInstance, Message: Forbidden attach instance |
子账号没有Kubernetes集群运维权限,如何给RAM用户授权请参见Kubernetes集群访问控制授权概述。 |
Code: ErrorNoAttachEcsInstance, Message: ecs instances invalid |
没有符合条件的ECS实例,请根据前置条件,调整节点配置。 |
Throttling Message: Request was denied due to request throttling. |
底层API限流,请稍后重试。 |
Code: 404 Code: InvalidImageId.NotFound Message: The specified ImageId does not exist |
自定义镜像ID不存在,请确认自定义镜像ID是否正确。 |
Code: IncorrectInstanceStatus Message: The specified instance is in an incorrect status for the requested action |
ECS实例状态校验不通过,ECS实例需要是运行中的状态。 |
Code: OperationDenied.UnpaidOrder Message: The specified instance has unpaid order. |
存在未支付账单,请先处理未支付账单。 |
error on the server ("Get https://XXXX:XX/api/v1/namespaces/kube-system/services/kube-dns: net/http: request canceled while waiting for connection |
确保kube-dns服务可用,且执行 |
OperationDenied Message: The specified image contains the snapshot of the data disk,does not support this operation. |
自定义镜像中包含了数据盘,需要将数据盘从ECS实例解绑后,再生成自定义镜像。 |
Failed to config security group: wait for ecs instance join to security group i-xx running timeout |
ECS实例加入集群默认安全组失败,需要您手动添加ECS实例的安全组。 |
Failed to start instance i-xx: Aliyun API Error: RequestId: 909DA063-0BAE-4C40-844C-01FDAA502F80 Status Code: 403 Code: IncorrectInstanceStatus Message: The specified instance is in an incorrect status for the requested action; Status of the specified instance is Running but the expected status is in (Stopped). |
添加节点i-xx过程中,ECS状态不符合预期,该问题一般是因为人为因素干扰。需要您重新添加一次,避免人为干扰因素。 |
Failed to attach node i-xxxx, err Aliyun API Error: RequestId: 7CE63A45-7932-493D-AE54-D1F199FD1EC7 Status Code: 403 Code: OperationDenied.UnpaidOrder Message: The specified instance has unpaid order.
|
存在未支付账单,只需要您支付该类订单即可。 |
mout: unknown filesystem type 'swap' |
您的磁盘格式化过,且格式化成了Swap格式的分区,需要您先将Swap格式化成ext4格式,或者直接删除所有分区。 |
error ipv4 ip_forward not set to 1 |
建议将每个节点的ip_forward都修改为1,修改ip_forward命令以下所示。 echo 1 > /proc/sys/net/ipv4/ip_forward |
May 27 17:11:32 iZuXXXz2lZ cloud-init: [kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get http://localhost:10248/healthz: dial tcp 127.0.0.1:10248: connect: connection refused. May 27 17:11:32 iZuXXXz2lZ cloud-init: Unfortunately, an error has occurred: May 27 17:11:32 iZuXXXz2lZ cloud-init: timed out waiting for the condition May 27 17:11:32 iZuXXXz2lZ cloud-init: This error is likely caused by: May 27 17:11:32 iZuXXXz2lZ cloud-init: - The kubelet is not running May 27 17:11:32 iZuXXXz2lZ cloud-init: - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled) |
kubelet启动失败,您可以通过以下命令,定位该问题。 journalctl -u kubelet |
curl -k --connect-timeout 4 https://172.XXX.XXX.184:XXXX/version curl: (28) Connection timed out after 4001 milliseconds |
API SERVER不通:
|
在文档使用中是否遇到以下问题
更多建议
匿名提交