我已经在AWS上使用Kubeadm工具创建了Kubernetes集群。自动缩放节点的所有可能方式有哪些?
答案 0 :(得分:2)
我不知道在AWS上扩展Kubernetes集群的所有方法。但是,我认为最好的方法是使用Kubernetes Cluster Autoscaler。它可以根据集群中的计划pod来动态扩展集群(与之相反,像自动缩放组之类的东西只能根据节点资源使用情况进行计划)。即使对于AWS EKS,它现在也the documented approach to autoscaling。
答案 1 :(得分:0)
如果在aws集群中具有用于从属节点的自动缩放组,那么您当然可以安装Kubernetes集群自动缩放器。 请查看此cluster-autoscaler bash script,因为它适用于kops,实际上您可以使用它来了解安装自动定标器必须遵循/配置的步骤和资源。
printf " a) Creating IAM policy to allow aws-cluster-autoscaler access to AWS autoscaling groups…\n"
cat > asg-policy.json << EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup"
],
"Resource": "*"
}
]
}
EOF
aws iam attach-role-policy --policy-arn $ASG_POLICY_ARN --role-name $IAM_ROLE the policy
有关更多详细信息,请检查此document。