az aks maintenanceconfiguration

Note

這個指令群組的指令在 Azure CLI 和至少一個擴充功能中都有定義。 安裝每個擴充功能以受益於其擴充功能。 深入了解擴充功能。

管理受控 Kubernetes 叢集中維護設定的命令。

命令

名稱 Description 類型 狀態
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"
            }
          ]
  }

新增預設維護配置與每週維護視窗排程。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n default --schedule-type Weekly --day-of-week Monday --duration 4 --start-time 09:00
  The maintenance is allowed on Monday from 09:00 to 13:00 (UTC) every week. Use --utc-offset to adjust the timezone and --start-date to set an activation date.

使用每日排程新增 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 原則 令牌以進行此資源操作。

屬性
參數群組: 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

為您的維護排程選擇 [每日]、[每周]、[絕對月刊] 或 [RelativeMonthly]。 預設維護設定只支援「每週一次」。

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

維護組態啟動的日期。 如果未指定,則維護期間會立即處於作用中狀態。 支援所有配置類型,包括預設配置。」

--start-hour

1 小時維護視窗的開始,例如 1 表示凌晨 1:00 到 2:00(舊版 timeInWeek 格式,僅預設設定)。 請參閱 maintenanceWindow 替代方案的範例。

--start-time

維護時段的開始時間。 接受的值是從 『00:00』 到 『23:59』。 '--utc-offset' 適用於此字段。 例如,『02:00』 與 『--utc-offset +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

允許維護的某一天(舊版 timeInWeek 格式,僅預設設定)。 請參閱 maintenanceWindow 替代方案的範例。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

輸出格式。

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 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]
                                    [--maintenance-window-id]
                                    [--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.

將維護設定連結到共用的 MaintenanceWindow 資源。

az aks maintenanceconfiguration add -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --maintenance-window-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.ContainerService/maintenanceWindows/myWindow
  The schedule lives in the referenced MaintenanceWindow resource and is shared across configurations. Inline schedule arguments cannot be combined with --maintenance-window-id.

使用 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 原則 令牌以進行此資源操作。

屬性
參數群組: 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

每組發生次數之間的周數。 僅適用於每周排程類型。

--maintenance-window-id

共用的 MaintenanceWindow 資源 ID 用於連結此維護配置。 設定後,排程會存在於參考的 MaintenanceWindow 中,且無法使用內嵌排程參數。 無法與 --config-file 合併(改用 JSON 中的 maintenanceWindowId 屬性)。 省略,因為沒有共享資源。

--schedule-type

為您的維護排程選擇 [每日]、[每周]、[絕對月刊] 或 [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' 適用於此字段。 例如,『02:00』 與 『--utc-offset +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

訂用帳戶的名稱或標識碼。 您可以使用 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 原則 令牌以進行此資源操作。

屬性
參數群組: 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

訂用帳戶的名稱或標識碼。 您可以使用 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 原則 令牌以進行此資源操作。

屬性
參數群組: 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

訂用帳戶的名稱或標識碼。 您可以使用 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

訂用帳戶的名稱或標識碼。 您可以使用 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

訂用帳戶的名稱或標識碼。 您可以使用 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

訂用帳戶的名稱或標識碼。 您可以使用 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

訂用帳戶的名稱或標識碼。 您可以使用 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"
            }
          ]
  }

更新預設維護設定,使用每週維護視窗排程。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n default --schedule-type Weekly --day-of-week Monday --duration 4 --start-time 09:00
  The maintenance is allowed on Monday from 09:00 to 13:00 (UTC) every week. Use --utc-offset to adjust the timezone and --start-date to set an activation date.

使用每日排程更新 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 原則 令牌以進行此資源操作。

屬性
參數群組: 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

為您的維護排程選擇 [每日]、[每周]、[絕對月刊] 或 [RelativeMonthly]。 預設維護設定只支援「每週一次」。

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

維護組態啟動的日期。 如果未指定,則維護期間會立即處於作用中狀態。 支援所有配置類型,包括預設配置。」

--start-hour

1 小時維護視窗的開始,例如 1 表示凌晨 1:00 到 2:00(舊版 timeInWeek 格式,僅預設設定)。 請參閱 maintenanceWindow 替代方案的範例。

--start-time

維護時段的開始時間。 接受的值是從 『00:00』 到 『23:59』。 '--utc-offset' 適用於此字段。 例如,『02:00』 與 『--utc-offset +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

允許維護的某一天(舊版 timeInWeek 格式,僅預設設定)。 請參閱 maintenanceWindow 替代方案的範例。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

屬性
預設值: False
--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

屬性
預設值: False
--output -o

輸出格式。

屬性
預設值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 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]
                                       [--maintenance-window-id]
                                       [--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.

將維護設定連結到共用的 MaintenanceWindow 資源。

az aks maintenanceconfiguration update -g MyResourceGroup --cluster-name test1 -n aksManagedAutoUpgradeSchedule --maintenance-window-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.ContainerService/maintenanceWindows/myWindow
  The schedule lives in the referenced MaintenanceWindow resource and is shared across configurations. Inline schedule arguments cannot be combined with --maintenance-window-id.

使用 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 原則 令牌以進行此資源操作。

屬性
參數群組: 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

每組發生次數之間的周數。 僅適用於每周排程類型。

--maintenance-window-id

共用的 MaintenanceWindow 資源 ID 用於連結此維護配置。 設定後,排程會存在於參考的 MaintenanceWindow 中,且無法使用內嵌排程參數。 無法與 --config-file 合併(改用 JSON 中的 maintenanceWindowId 屬性)。 省略,因為沒有共享資源。

--schedule-type

為您的維護排程選擇 [每日]、[每周]、[絕對月刊] 或 [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' 適用於此字段。 例如,『02:00』 與 『--utc-offset +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

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

屬性
預設值: False