1

I am using eksctl to create our EKS cluster.

For the first run, it works out good, but if I want to upgrade the cluster-config later in the future, it's not working.

I have a cluster-config file with me, but any changes made to it are not reflect with update/upgrade command.

What am I missing?

Cluster.yaml :

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata: 
  name: supplier-service
  region: eu-central-1

vpc:
  subnets:
    public: 
      eu-central-1a: {id: subnet-1}
      eu-central-1b: {id: subnet-2}
      eu-central-1c: {id: subnet-2}

nodeGroups:
  - name: ng-1
    instanceType: t2.medium
    desiredCapacity: 3
    ssh: 
      allow: true
    securityGroups:
      withShared: true
      withLocal: true
      attachIDs: ['sg-1', 'sg-2']
    iam:
      withAddonPolicies:
        autoScaler: true

Now, if in the future, I would like to make change to instance.type or replicas, I have to destroy entire cluster and recreate...which becomes quite cumbersome.

How can I do in-place upgrades with clusters created by EksCtl? Thank you.

4

2 回答 2

2

我正在研究与您完全相同的问题。

在对 Internet 进行大量搜索后,我发现尚无法就地升级 EKS 中的现有节点组。

首先,eksctl update已被弃用。当我执行eksctl upgrade --help时,它给出了这样的警告:

DEPRECATED: use 'upgrade cluster' instead. Upgrade control plane to the next version.

其次,正如这个 GitHub issueeksctl 文档中提到的,到目前为止,eksctl upgrade nodegroup它仅用于升级托管节点组的版本

所以不幸的是,您必须创建一个新的节点组来应用您的更改、迁移您的工作负载/将您的流量切换到新的节点组并停用旧的节点组。在您的情况下,没有必要对整个集群进行核攻击并重新创建。

如果您正在寻求以最少/零停机时间进行无缝升​​级/迁移,我建议您尝试managed node group,其中工作负载的优雅排出似乎很有希望:

Node updates and terminations gracefully drain nodes to ensure that your applications stay available.

注意:在上面的配置文件中,如果您指定nodeGroups而不是managedNodeGroups,将提供一个非托管节点组。

但是,不要失去希望。eksctl GitHub 存储库中的一个活跃问题已提交以添加选项。在这个阶段,它还没有发布。如果这成为现实,那就太好了。eksctl apply

于 2021-01-21T09:10:00.187 回答
0

使用 eksctl 升级集群:

  1. 升级控制平面版本
  2. 升级 coredns、kube-proxy 和 aws-node
  3. 升级工作节点

如果您只想更新节点组并保持相同的配置,您只需更改节点组名称,例如将 -v2 附加到名称。[0]

如果要更改节点组配置“实例类型”,只需创建一个新节点组:eksctl create nodegroup --config-file=dev-cluster.yaml[1]

[0] https://eksctl.io/usage/cluster-upgrade/#updating-multiple-nodegroups-with-config-file

[1] https://eksctl.io/usage/managing-nodegroups/#creating-a-nodegroup-from-a-config-file

于 2020-05-27T06:17:54.817 回答