通过


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az aks maintenanceconfiguration

Note

此命令组具有在Azure CLI和至少一个扩展中定义的命令。 安装每个扩展,使其受益于其扩展功能。 了解更多关于扩展的信息。

用于管理托管 Kubernetes 群集中的维护配置的命令。

命令

名称 说明 类型 Status
az aks maintenanceconfiguration add

在托管 Kubernetes 群集中添加维护配置。

Core GA
az aks maintenanceconfiguration add (aks-preview 扩展)

在托管 Kubernetes 群集中添加维护配置。

Extension GA
az aks maintenanceconfiguration delete

删除托管 Kubernetes 群集中的维护配置。

Core GA
az aks maintenanceconfiguration delete (aks-preview 扩展)

删除托管 Kubernetes 群集中的维护配置。

Extension GA
az aks maintenanceconfiguration list

列出托管 Kubernetes 群集中的维护配置。

Core GA
az aks maintenanceconfiguration list (aks-preview 扩展)

列出托管 Kubernetes 群集中的维护配置。

Extension GA
az aks maintenanceconfiguration show

显示托管 Kubernetes 群集中维护配置的详细信息。

Core GA
az aks maintenanceconfiguration show (aks-preview 扩展)

显示托管 Kubernetes 群集中维护配置的详细信息。

Extension GA
az aks maintenanceconfiguration update

更新托管 Kubernetes 群集的维护配置。

Core GA
az aks maintenanceconfiguration update (aks-preview 扩展)

更新托管 Kubernetes 群集的维护配置。

Extension GA

az aks maintenanceconfiguration add

在托管 Kubernetes 群集中添加维护配置。

az aks maintenanceconfiguration add --cluster-name
                                    --name
                                    --resource-group
                                    [--acquire-policy-token]
                                    [--change-reference]
                                    [--config-file]
                                    [--day-of-month]
                                    [--day-of-week]
                                    [--duration]
                                    [--interval-days]
                                    [--interval-months]
                                    [--interval-weeks]
                                    [--schedule-type {AbsoluteMonthly, Daily, RelativeMonthly, Weekly}]
                                    [--start-date]
                                    [--start-hour]
                                    [--start-time]
                                    [--utc-offset]
                                    [--week-index {First, Fourth, Last, Second, Third}]
                                    [--weekday]

示例

使用 --weekday 和 --start-hour 添加默认维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n default --weekday Monday  --start-hour 1
  The maintenance is allowed on Monday 1:00am to 2:00am

使用 --weekday 添加默认维护配置。 允许在当天的任何时间进行维护。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n default --weekday Monday
  The maintenance is allowed on Monday.

使用维护配置 json 文件添加默认维护配置

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n default --config-file ./test.json
    The content of json file looks below. It means the maintenance is allowed on UTC time Tuesday 1:00am - 3:00 am and Wednesday 1:00am - 2:00am, 6:00am-7:00am
    No maintenance is allowed from 2020-11-26T03:00:00Z to 2020-11-30T12:00:00Z and from 2020-12-26T03:00:00Z to 2020-12-26T12:00:00Z even if they are allowed in the above weekly setting
    {
          "timeInWeek": [
            {
              "day": "Tuesday",
              "hourSlots": [
                1,
                2
              ]
            },
            {
              "day": "Wednesday",
              "hourSlots": [
                1,
                6
              ]
            }
          ],
          "notAllowedTime": [
            {
              "start": "2021-11-26T03:00:00Z",
              "end": "2021-11-30T12:00:00Z"
            },
            {
              "start": "2021-12-26T03:00:00Z",
              "end": "2021-12-26T12:00:00Z"
            }
          ]
  }

使用每日计划添加 aksManagedNodeOSUpgradeSchedule 维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n aksManagedNodeOSUpgradeSchedule --schedule-type Daily --interval-days 2 --duration 12 --utc-offset=-08:00 --start-date 2023-01-16 --start-time 00:00
  The maintenance is allowed from 00:00 to 12:00 (adjusted with UTC offset: -08:00) every two days, and this configuration will be effective from 2023-01-16.

使用每周计划添加 aksManagedNodeOSUpgradeSchedule 维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n aksManagedNodeOSUpgradeSchedule --schedule-type Weekly --day-of-week Friday --interval-weeks 3 --duration 8 --utc-offset +05:30 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on Friday from 09:30 to 17:30 (adjusted with UTC offset: +05:30) every three weeks, and this configuration will be effective from 2023-01-16.

使用绝对每月计划添加 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --schedule-type AbsoluteMonthly --day-of-month 15 --interval-months 1 --duration 6 --utc-offset +05:30 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on the 15th of the month from 09:30 to 15:30 (adjusted with UTC offset: +05:30) every month, and this configuration will be effective from 2023-01-16.

使用相对每月计划添加 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --schedule-type RelativeMonthly --day-of-week Tuesday --week-index Last --interval-months 3 --duration 6 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on the last Tuesday from 09:30 to 15:30 in default UTC time every 3 months, and this configuration will be effective from 2023-01-16.

使用 json 文件添加 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --config-file ./test.json
    The content of json file looks below. It means the maintenance is allowed on the 1st of the month from 09:00 to 13:00 (adjusted with UTC offset: -08:00) every 3 months, and this configuration will be effective from 2023-01-16.
    No maintenance is allowed from 2022-12-23 to 2023-01-05 and from 2023-11-23 to 2023-11-26 even if they are allowed in the above monthly setting
    {
        "maintenanceWindow": {
            "schedule": {
                "absoluteMonthly": {
                    "intervalMonths": 3,
                    "dayOfMonth": 1
                }
            },
            "durationHours": 4,
            "utcOffset": "-08:00",
            "startTime": "09:00",
            "notAllowedDates": [
                {
                    "start": "2022-12-23",
                    "end": "2023-01-05"
                },
                {
                    "start": "2023-11-23",
                    "end": "2023-11-26"
                }
            ]
        }
    }

必需参数

--cluster-name

群集名称。

--name -n

配置名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
--config-file

维护配置 json 文件。

--day-of-month

指定发生维护的月份哪一天。 例如,1 表示月份的第 1 个。 仅适用于绝对每月计划类型。

--day-of-week

指定发生维护的星期几。 例如“星期一”。 适用于每周和相对每月计划类型。

--duration

维护时段的长度从 4 小时到 24 小时不等。

--interval-days

每日计划类型的每组匹配项之间的天数。

--interval-months

每个匹配项集之间的月数。 适用于绝对和相对每月计划类型。

--interval-weeks

每个匹配项集之间的周数。 仅适用于每周计划类型。

--schedule-type

为维护计划选择“每日”、“每周”、“AbsoluteMonthly”或“RelativeMonthly”。 仅适用于“aksManagedAutoUpgradeSchedule”和“aksManagedNodeOSUpgradeSchedule”维护配置。

属性
接受的值: AbsoluteMonthly, Daily, RelativeMonthly, Weekly
--start-date

维护配置激活的日期。 如果未指定,则维护时段将立即处于活动状态。

--start-hour

允许维护的 1 小时时段的开始时间。 例如,1 表示允许在上午 1:00 到凌晨 2:00 之间。 仅适用于默认维护配置。

--start-time

维护时段的开始时间。 接受的值从“00:00”到“23:59”。 “--utc-offset”适用于此字段。 例如,带有“--utc-offset +02:00”的“02:00”表示 UTC 时间“00:00”。

--utc-offset

格式为 +/-HH:mm 的 UTC 偏移量。 例如,IST 的“+05:30”和 PST 的“-07:00”。 如果未指定,则默认值为“+00:00”。

--week-index

指定在“--day-of-week”中指定的允许天数实例时发生维护。 仅适用于相对每月计划类型。

属性
接受的值: First, Fourth, Last, Second, Third
--weekday

允许维护的一周中的一天。 例如星期一 仅适用于默认维护配置。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az aks maintenanceconfiguration add (aks-preview 扩展)

在托管 Kubernetes 群集中添加维护配置。

az aks maintenanceconfiguration add --cluster-name
                                    --name
                                    --resource-group
                                    [--acquire-policy-token]
                                    [--change-reference]
                                    [--config-file]
                                    [--day-of-month]
                                    [--day-of-week]
                                    [--duration]
                                    [--interval-days]
                                    [--interval-months]
                                    [--interval-weeks]
                                    [--schedule-type {AbsoluteMonthly, Daily, RelativeMonthly, Weekly}]
                                    [--start-date]
                                    [--start-hour]
                                    [--start-time]
                                    [--utc-offset]
                                    [--week-index {First, Fourth, Last, Second, Third}]
                                    [--weekday]

示例

使用 --weekday 和 --start-hour 添加默认维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n default --weekday Monday  --start-hour 1
  The maintenance is allowed on Monday 1:00am to 2:00am

使用 --weekday 添加默认维护配置。 允许在当天的任何时间进行维护。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n default --weekday Monday
  The maintenance is allowed on Monday.

使用维护配置 json 文件添加默认维护配置

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n default --config-file ./test.json
    The content of json file looks below. It means the maintenance is allowed on UTC time Tuesday 1:00am - 3:00 am and Wednesday 1:00am - 2:00am, 6:00am-7:00am
    No maintenance is allowed from 2020-11-26T03:00:00Z to 2020-11-30T12:00:00Z and from 2020-12-26T03:00:00Z to 2020-12-26T12:00:00Z even if they are allowed in the above weekly setting
    {
          "timeInWeek": [
            {
              "day": "Tuesday",
              "hourSlots": [
                1,
                2
              ]
            },
            {
              "day": "Wednesday",
              "hourSlots": [
                1,
                6
              ]
            }
          ],
          "notAllowedTime": [
            {
              "start": "2021-11-26T03:00:00Z",
              "end": "2021-11-30T12:00:00Z"
            },
            {
              "start": "2021-12-26T03:00:00Z",
              "end": "2021-12-26T12:00:00Z"
            }
          ]
  }

使用每日计划添加 aksManagedNodeOSUpgradeSchedule 维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n aksManagedNodeOSUpgradeSchedule --schedule-type Daily --interval-days 2 --duration 12 --utc-offset=-08:00 --start-date 2023-01-16 --start-time 00:00
  The maintenance is allowed from 00:00 to 12:00 (adjusted with UTC offset: -08:00) every two days, and this configuration will be effective from 2023-01-16.

使用每周计划添加 aksManagedNodeOSUpgradeSchedule 维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n aksManagedNodeOSUpgradeSchedule --schedule-type Weekly --day-of-week Friday --interval-weeks 3 --duration 8 --utc-offset +05:30 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on Friday from 09:30 to 17:30 (adjusted with UTC offset: +05:30) every three weeks, and this configuration will be effective from 2023-01-16.

使用绝对每月计划添加 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --schedule-type AbsoluteMonthly --day-of-month 15 --interval-months 1 --duration 6 --utc-offset +05:30 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on the 15th of the month from 09:30 to 15:30 (adjusted with UTC offset: +05:30) every month, and this configuration will be effective from 2023-01-16.

使用相对每月计划添加 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --schedule-type RelativeMonthly --day-of-week Tuesday --week-index Last --interval-months 3 --duration 6 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on the last Tuesday from 09:30 to 15:30 in default UTC time every 3 months, and this configuration will be effective from 2023-01-16.

使用 json 文件添加 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --config-file ./test.json
    The content of json file looks below. It means the maintenance is allowed on the 1st of the month from 09:00 to 13:00 (adjusted with UTC offset: -08:00) every 3 months, and this configuration will be effective from 2023-01-16.
    No maintenance is allowed from 2022-12-23 to 2023-01-05 and from 2023-11-23 to 2023-11-26 even if they are allowed in the above monthly setting
    {
        "maintenanceWindow": {
            "schedule": {
                "absoluteMonthly": {
                    "intervalMonths": 3,
                    "dayOfMonth": 1
                }
            },
            "durationHours": 4,
            "utcOffset": "-08:00",
            "startTime": "09:00",
            "notAllowedDates": [
                {
                    "start": "2022-12-23",
                    "end": "2023-01-05"
                },
                {
                    "start": "2023-11-23",
                    "end": "2023-11-26"
                }
            ]
        }
    }

必需参数

--cluster-name

群集名称。

--name -n

配置名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
--config-file

维护配置 json 文件。

--day-of-month

指定发生维护的月份哪一天。 例如,1 表示月份的第 1 个。 仅适用于绝对每月计划类型。

--day-of-week

指定发生维护的星期几。 例如“星期一”。 适用于每周和相对每月计划类型。

--duration

维护时段的长度从 4 小时到 24 小时不等。

--interval-days

每日计划类型的每组匹配项之间的天数。

--interval-months

每个匹配项集之间的月数。 适用于绝对和相对每月计划类型。

--interval-weeks

每个匹配项集之间的周数。 仅适用于每周计划类型。

--schedule-type

为维护计划选择“每日”、“每周”、“AbsoluteMonthly”或“RelativeMonthly”。 仅适用于“aksManagedAutoUpgradeSchedule”和“aksManagedNodeOSUpgradeSchedule”维护配置。

属性
接受的值: AbsoluteMonthly, Daily, RelativeMonthly, Weekly
--start-date

维护配置激活的日期。 如果未指定,则维护时段将立即处于活动状态。

--start-hour

允许维护的 1 小时时段的开始时间。 例如,1 表示允许在上午 1:00 到凌晨 2:00 之间。 仅适用于默认维护配置。

--start-time

维护时段的开始时间。 接受的值从“00:00”到“23:59”。 “--utc-offset”适用于此字段。 例如,带有“--utc-offset +02:00”的“02:00”表示 UTC 时间“00:00”。

--utc-offset

格式为 +/-HH:mm 的 UTC 偏移量。 例如,IST 的“+05:30”和 PST 的“-07:00”。 如果未指定,则默认值为“+00:00”。

--week-index

指定在“--day-of-week”中指定的允许天数实例时发生维护。 仅适用于相对每月计划类型。

属性
接受的值: First, Fourth, Last, Second, Third
--weekday

允许维护的一周中的一天。 例如星期一 仅适用于默认维护配置。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az aks maintenanceconfiguration delete

删除托管 Kubernetes 群集中的维护配置。

az aks maintenanceconfiguration delete --cluster-name
                                       --name
                                       --resource-group
                                       [--acquire-policy-token]
                                       [--change-reference]

必需参数

--cluster-name

群集名称。

--name -n

配置名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az aks maintenanceconfiguration delete (aks-preview 扩展)

删除托管 Kubernetes 群集中的维护配置。

az aks maintenanceconfiguration delete --cluster-name
                                       --name
                                       --resource-group
                                       [--acquire-policy-token]
                                       [--change-reference]

必需参数

--cluster-name

群集名称。

--name -n

配置名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az aks maintenanceconfiguration list

列出托管 Kubernetes 群集中的维护配置。

az aks maintenanceconfiguration list --cluster-name
                                     --resource-group

必需参数

--cluster-name

群集名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az aks maintenanceconfiguration list (aks-preview 扩展)

列出托管 Kubernetes 群集中的维护配置。

az aks maintenanceconfiguration list --cluster-name
                                     --resource-group

必需参数

--cluster-name

群集名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az aks maintenanceconfiguration show

显示托管 Kubernetes 群集中维护配置的详细信息。

az aks maintenanceconfiguration show --cluster-name
                                     --name
                                     --resource-group

必需参数

--cluster-name

群集名称。

--name -n

配置名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az aks maintenanceconfiguration show (aks-preview 扩展)

显示托管 Kubernetes 群集中维护配置的详细信息。

az aks maintenanceconfiguration show --cluster-name
                                     --name
                                     --resource-group

必需参数

--cluster-name

群集名称。

--name -n

配置名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az aks maintenanceconfiguration update

更新托管 Kubernetes 群集的维护配置。

az aks maintenanceconfiguration update --cluster-name
                                       --name
                                       --resource-group
                                       [--acquire-policy-token]
                                       [--change-reference]
                                       [--config-file]
                                       [--day-of-month]
                                       [--day-of-week]
                                       [--duration]
                                       [--interval-days]
                                       [--interval-months]
                                       [--interval-weeks]
                                       [--schedule-type {AbsoluteMonthly, Daily, RelativeMonthly, Weekly}]
                                       [--start-date]
                                       [--start-hour]
                                       [--start-time]
                                       [--utc-offset]
                                       [--week-index {First, Fourth, Last, Second, Third}]
                                       [--weekday]

示例

使用 --weekday 和 --start-hour 更新默认维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n default --weekday Monday  --start-hour 1
  The maintenance is allowed on Monday 1:00am to 2:00am

使用 --weekday 更新默认维护配置。允许在当天的任何时间进行维护。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n default --weekday Monday
  The maintenance is allowed on Monday.

使用维护配置文件 json 文件更新默认维护配置

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n default --config-file ./test.json
    The content of json file looks below. It means the maintenance is allowed on UTC time Tuesday 1:00am - 3:00 am and Wednesday 1:00am - 2:00am, 6:00am-7:00am
    No maintenance is allowed from 2020-11-26T03:00:00Z to 2020-11-30T12:00:00Z and from 2020-12-26T03:00:00Z to 2020-12-26T12:00:00Z even if they are allowed in the above weekly setting
    {
          "timeInWeek": [
            {
              "day": "Tuesday",
              "hourSlots": [
                1,
                2
              ]
            },
            {
              "day": "Wednesday",
              "hourSlots": [
                1,
                6
              ]
            }
          ],
          "notAllowedTime": [
            {
              "start": "2021-11-26T03:00:00Z",
              "end": "2021-11-30T12:00:00Z"
            },
            {
              "start": "2021-12-26T03:00:00Z",
              "end": "2021-12-26T12:00:00Z"
            }
          ]
  }

使用每日计划更新 aksManagedNodeOSUpgradeSchedule 维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n aksManagedNodeOSUpgradeSchedule --schedule-type Daily --interval-days 2 --duration 12 --utc-offset=-08:00 --start-date 2023-01-16 --start-time 00:00
  The maintenance is allowed from 00:00 to 12:00 (adjusted with UTC offset: -08:00) every two days. This configuration will be effective from 2023-01-16.

使用每周计划更新 aksManagedNodeOSUpgradeSchedule 维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n aksManagedNodeOSUpgradeSchedule --schedule-type Weekly --day-of-week Friday --interval-weeks 3 --duration 8 --utc-offset +05:30 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on Friday from 09:30 to 17:30 (adjusted with UTC offset: +05:30) every three weeks. This configuration will be effective from 2023-01-16.

使用绝对每月计划更新 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --schedule-type AbsoluteMonthly --day-of-month 15 --interval-months 1 --duration 6 --utc-offset +05:30 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on the 15th of the month from 09:30 to 15:30 (adjusted with UTC offset: +05:30) every month. This configuration will be effective from 2023-01-16.

使用相对每月计划更新 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --schedule-type RelativeMonthly --day-of-week Tuesday --week-index Last --interval-months 3 --duration 6 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on the last Tuesday from 09:30 to 15:30 in default UTC time every 3 months. This configuration will be effective from 2023-01-16.

使用 json 文件更新 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --config-file ./test.json
    The content of json file looks below. It means the maintenance is allowed on the 1st of the month from 09:00 to 13:00 (adjusted with UTC offset: -08:00) every 3 months, and this configuration will be effective from 2023-01-16.
    No maintenance is allowed from 2022-12-23 to 2023-01-05 and from 2023-11-23 to 2023-11-26 even if they are allowed in the above monthly setting
    {
        "maintenanceWindow": {
            "schedule": {
                "absoluteMonthly": {
                    "intervalMonths": 3,
                    "dayOfMonth": 1
                }
            },
            "durationHours": 4,
            "utcOffset": "-08:00",
            "startTime": "09:00",
            "notAllowedDates": [
                {
                    "start": "2022-12-23",
                    "end": "2023-01-05"
                },
                {
                    "start": "2023-11-23",
                    "end": "2023-11-26"
                }
            ]
        }
    }

必需参数

--cluster-name

群集名称。

--name -n

配置名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
--config-file

维护配置 json 文件。

--day-of-month

指定发生维护的月份哪一天。 例如,1 表示月份的第 1 个。 仅适用于绝对每月计划类型。

--day-of-week

指定发生维护的星期几。 例如“星期一”。 适用于每周和相对每月计划类型。

--duration

维护时段的长度从 4 小时到 24 小时不等。

--interval-days

每日计划类型的每组匹配项之间的天数。

--interval-months

每个匹配项集之间的月数。 适用于绝对和相对每月计划类型。

--interval-weeks

每个匹配项集之间的周数。 仅适用于每周计划类型。

--schedule-type

为维护计划选择“每日”、“每周”、“AbsoluteMonthly”或“RelativeMonthly”。 仅适用于“aksManagedAutoUpgradeSchedule”和“aksManagedNodeOSUpgradeSchedule”维护配置。

属性
接受的值: AbsoluteMonthly, Daily, RelativeMonthly, Weekly
--start-date

维护配置激活的日期。 如果未指定,则维护时段将立即处于活动状态。

--start-hour

允许维护的 1 小时时段的开始时间。 例如,1 表示允许在上午 1:00 到凌晨 2:00 之间。 仅适用于默认维护配置。

--start-time

维护时段的开始时间。 接受的值从“00:00”到“23:59”。 “--utc-offset”适用于此字段。 例如,带有“--utc-offset +02:00”的“02:00”表示 UTC 时间“00:00”。

--utc-offset

格式为 +/-HH:mm 的 UTC 偏移量。 例如,IST 的“+05:30”和 PST 的“-07:00”。 如果未指定,则默认值为“+00:00”。

--week-index

指定在“--day-of-week”中指定的允许天数实例时发生维护。 仅适用于相对每月计划类型。

属性
接受的值: First, Fourth, Last, Second, Third
--weekday

允许维护的一周中的一天。 例如星期一 仅适用于默认维护配置。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az aks maintenanceconfiguration update (aks-preview 扩展)

更新托管 Kubernetes 群集的维护配置。

az aks maintenanceconfiguration update --cluster-name
                                       --name
                                       --resource-group
                                       [--acquire-policy-token]
                                       [--change-reference]
                                       [--config-file]
                                       [--day-of-month]
                                       [--day-of-week]
                                       [--duration]
                                       [--interval-days]
                                       [--interval-months]
                                       [--interval-weeks]
                                       [--schedule-type {AbsoluteMonthly, Daily, RelativeMonthly, Weekly}]
                                       [--start-date]
                                       [--start-hour]
                                       [--start-time]
                                       [--utc-offset]
                                       [--week-index {First, Fourth, Last, Second, Third}]
                                       [--weekday]

示例

使用 --weekday 和 --start-hour 更新默认维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n default --weekday Monday  --start-hour 1
  The maintenance is allowed on Monday 1:00am to 2:00am

使用 --weekday 更新默认维护配置。允许在当天的任何时间进行维护。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n default --weekday Monday
  The maintenance is allowed on Monday.

使用维护配置文件 json 文件更新默认维护配置

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n default --config-file ./test.json
    The content of json file looks below. It means the maintenance is allowed on UTC time Tuesday 1:00am - 3:00 am and Wednesday 1:00am - 2:00am, 6:00am-7:00am
    No maintenance is allowed from 2020-11-26T03:00:00Z to 2020-11-30T12:00:00Z and from 2020-12-26T03:00:00Z to 2020-12-26T12:00:00Z even if they are allowed in the above weekly setting
    {
          "timeInWeek": [
            {
              "day": "Tuesday",
              "hourSlots": [
                1,
                2
              ]
            },
            {
              "day": "Wednesday",
              "hourSlots": [
                1,
                6
              ]
            }
          ],
          "notAllowedTime": [
            {
              "start": "2021-11-26T03:00:00Z",
              "end": "2021-11-30T12:00:00Z"
            },
            {
              "start": "2021-12-26T03:00:00Z",
              "end": "2021-12-26T12:00:00Z"
            }
          ]
  }

使用每日计划更新 aksManagedNodeOSUpgradeSchedule 维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n aksManagedNodeOSUpgradeSchedule --schedule-type Daily --interval-days 2 --duration 12 --utc-offset=-08:00 --start-date 2023-01-16 --start-time 00:00
  The maintenance is allowed from 00:00 to 12:00 (adjusted with UTC offset: -08:00) every two days. This configuration will be effective from 2023-01-16.

使用每周计划更新 aksManagedNodeOSUpgradeSchedule 维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n aksManagedNodeOSUpgradeSchedule --schedule-type Weekly --day-of-week Friday --interval-weeks 3 --duration 8 --utc-offset +05:30 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on Friday from 09:30 to 17:30 (adjusted with UTC offset: +05:30) every three weeks. This configuration will be effective from 2023-01-16.

使用绝对每月计划更新 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --schedule-type AbsoluteMonthly --day-of-month 15 --interval-months 1 --duration 6 --utc-offset +05:30 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on the 15th of the month from 09:30 to 15:30 (adjusted with UTC offset: +05:30) every month. This configuration will be effective from 2023-01-16.

使用相对每月计划更新 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --schedule-type RelativeMonthly --day-of-week Tuesday --week-index Last --interval-months 3 --duration 6 --start-date 2023-01-16 --start-time 09:30
  The maintenance is allowed on the last Tuesday from 09:30 to 15:30 in default UTC time every 3 months. This configuration will be effective from 2023-01-16.

使用 json 文件更新 aksManagedAutoUpgradeSchedule 维护配置。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --config-file ./test.json
    The content of json file looks below. It means the maintenance is allowed on the 1st of the month from 09:00 to 13:00 (adjusted with UTC offset: -08:00) every 3 months, and this configuration will be effective from 2023-01-16.
    No maintenance is allowed from 2022-12-23 to 2023-01-05 and from 2023-11-23 to 2023-11-26 even if they are allowed in the above monthly setting
    {
        "maintenanceWindow": {
            "schedule": {
                "absoluteMonthly": {
                    "intervalMonths": 3,
                    "dayOfMonth": 1
                }
            },
            "durationHours": 4,
            "utcOffset": "-08:00",
            "startTime": "09:00",
            "notAllowedDates": [
                {
                    "start": "2022-12-23",
                    "end": "2023-01-05"
                },
                {
                    "start": "2023-11-23",
                    "end": "2023-11-26"
                }
            ]
        }
    }

必需参数

--cluster-name

群集名称。

--name -n

配置名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

可选参数

以下参数是可选的,但根据上下文,命令可能需要一个或多个参数才能成功执行。

--acquire-policy-token

为此资源操作自动获取Azure Policy令牌。

属性
参数组: Global Policy Arguments
--change-reference

此资源操作的相关更改引用 ID。

属性
参数组: Global Policy Arguments
--config-file

维护配置 json 文件。

--day-of-month

指定发生维护的月份哪一天。 例如,1 表示月份的第 1 个。 仅适用于绝对每月计划类型。

--day-of-week

指定发生维护的星期几。 例如“星期一”。 适用于每周和相对每月计划类型。

--duration

维护时段的长度从 4 小时到 24 小时不等。

--interval-days

每日计划类型的每组匹配项之间的天数。

--interval-months

每个匹配项集之间的月数。 适用于绝对和相对每月计划类型。

--interval-weeks

每个匹配项集之间的周数。 仅适用于每周计划类型。

--schedule-type

为维护计划选择“每日”、“每周”、“AbsoluteMonthly”或“RelativeMonthly”。 仅适用于“aksManagedAutoUpgradeSchedule”和“aksManagedNodeOSUpgradeSchedule”维护配置。

属性
接受的值: AbsoluteMonthly, Daily, RelativeMonthly, Weekly
--start-date

维护配置激活的日期。 如果未指定,则维护时段将立即处于活动状态。

--start-hour

允许维护的 1 小时时段的开始时间。 例如,1 表示允许在上午 1:00 到凌晨 2:00 之间。 仅适用于默认维护配置。

--start-time

维护时段的开始时间。 接受的值从“00:00”到“23:59”。 “--utc-offset”适用于此字段。 例如,带有“--utc-offset +02:00”的“02:00”表示 UTC 时间“00:00”。

--utc-offset

格式为 +/-HH:mm 的 UTC 偏移量。 例如,IST 的“+05:30”和 PST 的“-07:00”。 如果未指定,则默认值为“+00:00”。

--week-index

指定在“--day-of-week”中指定的允许天数实例时发生维护。 仅适用于相对每月计划类型。

属性
接受的值: First, Fourth, Last, Second, Third
--weekday

允许维护的一周中的一天。 例如星期一 仅适用于默认维护配置。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

输出格式。

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False