跳转到主要内容

Amazon EKS集群升级工具

项目描述

Amazon EKS升级工具

Validation Status E2E Cluster Upgrade Coverage Status PyPI Downloads

Amazon EKS集群升级是一个自动化Amazon EKS集群升级过程的工具。

自v0.9.0之后的检查

移除了预/后飞行检查,以引导用户使用现有的、处理此类问题更好的工具(如 eksup)来评估他们的集群。现有的预/后检查将被与升级相关的特定检查所取代(根据之前的理解,集群符合此类升级的资格)。

集群升级

  1. 控制平面升级 - 这在请求版本升级后完全由AWS处理。
  2. 识别托管和自托管节点 - 工作节点被标识为EKS托管和自托管以执行升级。
  3. 托管节点组更新 - 将托管节点组更新到指定版本。
  4. 自托管节点组更新
    • 启动具有升级版本的新的节点,并等待它们达到就绪状态以进行下一步操作。
    • 将现有节点标记为不可调度。
    • 如果存在pod中断预算(PDB),则检查用户提供的强制驱逐标志(--force),然后驱逐Pod或继续流程。

先决条件

在运行eksupgrade之前,您需要拥有AWS和Kubernetes集群本身的权限。

  1. 本地安装eksupgrade
python -m pip install eksupgrade
  1. 确保您有必要的AWS权限;以下列出了所需权限的示例策略
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "iam",
      "Effect": "Allow",
      "Action": [
        "iam:GetRole",
        "sts:GetAccessKeyInfo",
        "sts:GetCallerIdentity",
        "sts:GetSessionToken"
      ],
      "Resource": "*"
    },
    {
      "Sid": "ec2",
      "Effect": "Allow",
      "Action": [
        "autoscaling:CreateLaunchConfiguration",
        "autoscaling:Describe*",
        "autoscaling:SetDesiredCapacity",
        "autoscaling:TerminateInstanceInAutoScalingGroup",
        "autoscaling:UpdateAutoScalingGroup",
        "ec2:Describe*",
        "ssm:*"
      ],
      "Resource": "*"
    },
    {
      "Sid": "eks",
      "Effect": "Allow",
      "Action": [
        "eks:Describe*",
        "eks:List*",
        "eks:UpdateAddon",
        "eks:UpdateClusterVersion",
        "eks:UpdateNodegroupVersion"
      ],
      "Resource": "*"
    }
  ]
}
  1. 更新您的本地kubeconfig以验证集群
aws eks update-kubeconfig --name <CLUSTER-NAME> --region <REGION>

用法

要查看参数和选项,请运行

eksupgrade --help
 Usage: eksupgrade [OPTIONS] CLUSTER_NAME CLUSTER_VERSION REGION

 Run eksupgrade against a target cluster.

╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    cluster_name         TEXT  The name of the cluster to be upgraded [default: None] [required]                                                                                                                                                        │
│ *    cluster_version      TEXT  The target Kubernetes version to upgrade the cluster to [default: None] [required]                                                                                                                                       │
│ *    region               TEXT  The AWS region where the target cluster resides [default: None] [required]                                                                                                                                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --max-retry                                    INTEGER  The most number of times to retry an upgrade [default: 2]                                                                                                                                        │
│ --force                 --no-force                      Force the upgrade (e.g. pod eviction with PDB) [default: no-force]                                                                                                                               │
│ --preflight             --no-preflight                  Run pre-upgrade checks without upgrade [default: no-preflight]                                                                                                                                   │
│ --parallel              --no-parallel                   Upgrade all nodegroups in parallel [default: no-parallel]                                                                                                                                        │
│ --latest-addons         --no-latest-addons              Upgrade addons to the latest eligible version instead of default [default: no-latest-addons]                                                                                                     │
│ --disable-checks        --no-disable-checks             Disable the pre-upgrade and post-upgrade checks during upgrade scenarios [default: no-disable-checks]                                                                                            │
│ --interactive           --no-interactive                If enabled, prompt the user for confirmations [default: interactive]                                                                                                                             │
│ --version                                               Display the current eksupgrade version                                                                                                                                                           │
│ --install-completion                                    Install completion for the current shell.                                                                                                                                                        │
│ --show-completion                                       Show completion for the current shell, to copy it or customize the installation.                                                                                                                 │
│ --help                                                  Show this message and exit.                                                                                                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

支持 & 反馈

此项目由AWS解决方案架构师和顾问维护。它不是AWS服务的一部分,维护者提供最佳努力支持。要提交反馈、提交功能想法或报告错误,请使用此仓库的问题部分。如果您有兴趣贡献,请参阅贡献指南

安全

有关更多信息,请参阅CONTRIBUTING

许可证

此库根据MIT-0许可证授权。请参阅LICENSE文件。

项目详情


下载文件

下载您平台上的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分发

eksupgrade-0.9.0.tar.gz (31.6 kB 查看哈希值)

上传时间

构建分发

eksupgrade-0.9.0-py3-none-any.whl (40.1 kB 查看哈希值)

上传时间 Python 3

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面