首页 文章

KOPS:AWS VPC上具有专用网络的Kubernetes群集:错误列表节点

提问于
浏览
1

我按照本教程:Kubernetes Cluster with private networking on AWS using Kops

但是,在创建kubernetes集群后,我收到以下错误:

$ kops validate cluster
Using cluster from kubectl context: k8s-cluster.mydomain.com
Validating cluster k8s-cluster.mydomain.com

错误消息:

unexpected error during validation: error listing nodes: Get https://subdomain.eu-central-1.elb.amazonaws.com/api/v1/nodes: EOF

有关如何调试或解决此问题的任何想法?


我以前创建的步骤如下:

Setup VPC and Subnets

创建VPC

$ aws ec2 create-vpc --cidr-block 10.0.0.0/16 --region eu-central-1

允许DNS主机名

$ aws ec2 modify-vpc-attribute --vpc-id ${VPC_ID} --enable-dns-hostnames "{\"Value\":true}" --region ${REGION}

创建互联网网关

$ aws ec2 create-internet-gateway --region ${REGION}

将Internet网关连接到VPC

$ aws ec2 attach-internet-gateway --internet-gateway-id ${INTERNET_GATEWAY_ID} --vpc-id ${VPC_ID} --region ${REGION}

[公共子网]创建三个公共区域/子网(3x)

$ aws ec2 create-subnet --vpc-id ${VPC_ID} --cidr-block 10.0.0.0/20 --availability-zone ${AVAILABILITY_ZONE_1} --region ${REGION}

设置公共子网以将公共IP自动分配给实例(3x)

$ aws ec2 modify-subnet-attribute --subnet-id ${PUBLIC_SUBNET_1} --map-public-ip-on-launch --region ${REGION}

[PRIVATE SUBNETS]创建三个私有区/子网(3x)

$ aws ec2 create-subnet --vpc-id ${VPC_ID} --cidr-block 10.0.48.0/20 --availability-zone ${AVAILABILITY_ZONE_1} --region ${REGION}

[设置NAT网关]分配地址(3x)

$ aws ec2 allocate-address --domain vpc --region ${REGION}

为公共区域创建NAT网关(3x)

$ aws ec2 create-nat-gateway --subnet-id ${PUBLIC_SUBNET_1} --allocation-id ${EIP_ALLOCATION_ID_1} --region ${REGION}

[CONFIGURE ROUTE TABLES]创建路由表

$ aws ec2 create-route-table --vpc-id ${VPC_ID} --region ${REGION}

为Internet网关创建路由

$ aws ec2 create-route --route-table-id ${RTB_PUBLIC_1} --destination-cidr-block 0.0.0.0/0 --gateway-id ${INTERNET_GATEWAY_ID} --region ${REGION}

将公共子网与路由表关联(3x)

$ aws ec2 associate-route-table --route-table-id ${RTB_PUBLIC_1} --subnet-id ${PUBLIC_SUBNET_1} --region ${REGION}

[私有区域的路由表]为每个私有区域创建路由表(3x)

$ aws ec2 create-route-table --vpc-id ${VPC_ID} --region ${REGION}

创建到NAT网关的路由(3x)

$ aws ec2 create-route --route-table-id ${RTB_PRIVATE_1} --destination-cidr-block 0.0.0.0/0 --nat-gateway-id ${NAT_GW_1} --region ${REGION}

关联子网(3x)

$ aws ec2 associate-route-table --route-table-id ${RTB_PRIVATE_1} --subnet-id ${PRIVATE_SUBNET_1} --region ${REGION}

Other Configuration

将S3 Bucket设置为Kops状态存储

$ aws s3api create-bucket --bucket my-state-store --region ${REGION} --create-bucket-configuration LocationConstraint=eu-central-1

创建集群

$ kops create cluster --node-count 3 --zones ${AVAILABILITY_ZONE_1},${AVAILABILITY_ZONE_2},${AVAILABILITY_ZONE_3} --master-zones ${AVAILABILITY_ZONE_1},${AVAILABILITY_ZONE_2},${AVAILABILITY_ZONE_3} --state ${KOPS_STATE_STORE} --dns-zone=${DNS_ZONE_PRIVATE_ID} --dns private --node-size m5.large --master-size m5.large --topology private --networking weave --vpc=${VPC_ID} --bastion ${NAME}

编辑群集以配置子网

$ kops edit cluster ${NAME}

注意:更新子网以与上面创建的公共/私有子网相对应

$ kops update cluster ${NAME} --yes

1 回答

  • 1

    问题解决了 . 这不是 kops 问题,问题出在AWS M5和Linux版本上 .

    kops默认的Debian jessie映像不支持用于EBS卷的nvme,这是由AWS M5实例类型使用的 . 结果,主人无法启动,因为他们无法安装EBS卷 .

    资料来源:https://github.com/kubernetes/kops/issues/4873

相关问题