az fleet updaterun
Note
此參考資料是Azure CLIfleet擴充套件(版本2.61.0或更高版本)的一部分。 擴充功能會在您第一次 執行 az fleet updaterun 命令時自動安裝。 深入了解擴充功能。
管理更新執行的命令。
命令
| 名稱 | Description | 類型 | 狀態 |
|---|---|---|---|
| az fleet updaterun create |
建立或更新更新執行。 |
Extension | GA |
| az fleet updaterun delete |
刪除更新執行。 |
Extension | GA |
| az fleet updaterun list |
列出車隊的更新執行。 |
Extension | GA |
| az fleet updaterun show |
顯示更新執行。 |
Extension | GA |
| az fleet updaterun skip |
設定在 UpdateRun 內要略過的目標。 |
Extension | GA |
| az fleet updaterun start |
啟動更新執行。 |
Extension | GA |
| az fleet updaterun stop |
停止更新執行。 |
Extension | GA |
| az fleet updaterun wait |
等候更新執行資源達到所需的狀態。 |
Extension | GA |
az fleet updaterun create
建立或更新更新執行。
az fleet updaterun create --fleet-name
--name
--resource-group
--upgrade-type {ControlPlaneOnly, Full, NodeImageOnly}
[--acquire-policy-token]
[--change-reference]
[--kubernetes-version]
[--no-wait]
[--node-image-selection {Consistent, Latest}]
[--stages]
[--update-strategy-name]
範例
為具有「完整」升級類型的車隊建立更新執行。
az fleet updaterun create -g MyResourceGroup -f MyFleet -n MyUpdateRun --upgrade-type Full --kubernetes-version 1.25.0 --node-image-selection Latest
為具有 『NodeImageOnly』 升級類型的車隊建立更新執行。
az fleet updaterun create -g MyResourceGroup -f MyFleet -n MyUpdateRun --upgrade-type NodeImageOnly --node-image-selection Latest
針對具有「完整」升級類型 & 階段的車隊建立更新執行。
az fleet updaterun create -g MyResourceGroup -f MyFleet -n MyUpdateRun --upgrade-type Full --kubernetes-version 1.25.0 --node-image-selection Latest --stages ./test/stages.json
The following JSON structure represents example contents of the parameter '--stages ./test/stages.json'.
A stages array is composed of one or more stages, each containing one or more groups and/or a memberSelector.
Each group contains the 'name' property, which represents the group to which a cluster belongs (see 'az fleet member create --help').
Stages and groups can optionally include a 'memberSelector' to filter members by label. A 'memberSelector' contains a 'byLabel' property with a Kubernetes-style label selector string (e.g., "env=production"). When set on a group, it overrides name-based matching.
Stage memberSelector: pre-filters members for the entire stage. Only matching members are candidates for group-level matching.
Group memberSelector: selects members by label instead of matching by FleetMember.Group name. When set, overrides name-based matching.
Stages have an optional 'afterStageWaitInSeconds' integer property, acting as a delay between stage execution.
Stages and groups have an optional 'maxConcurrency' string property that sets the maximum number of concurrent upgrades allowed. It acts as a ceiling (not a quota)—actual concurrency may be lower due to other limits or member conditions. Minimum is 1.
Stage maxConcurrency: applies across all groups in the stage (total concurrent upgrades for the whole stage).
Group maxConcurrency: applies within a single group, and is additionally constrained by the stage limit (effective max is min(group cluster count, stage maxConcurrency)). Minimum is 1.
Stages and groups also have an optional 'maxAllowedFailures' string property.
Stage maxAllowedFailures: The maximum number of member (cluster) upgrade failures tolerated in this stage. Accepts a non-negative integer (e.g. '3') or a percentage (e.g. '25%'). Defaults to 0 if unset, meaning any failure fails the stage.
Group maxAllowedFailures: The maximum number of member (cluster) upgrade failures tolerated in this group. Accepts a non-negative integer (e.g. '3') or a percentage (e.g. '25%'). Defaults to 0 if unset, meaning any failure fails the group.
Value formats:
Fixed count (e.g., 3)
Percentage (e.g., 25%, 1–100) of the relevant cluster total (stage total for stage, group total for group).
Examples: 0, 3, 25%, 100%
Example stages JSON, with optional properties maxConcurrency, maxAllowedFailures and before/after gates:
{
"stages": [
{
"name": "stage1",
"memberSelector": { "byLabel": "env=staging" },
"maxConcurrency": "7%",
"maxAllowedFailures": "50%",
"beforeGates": [
{
"displayName": "stage before gate",
"type": "Approval"
}
],
"afterGates": [
{
"displayName": "stage after gate",
"type": "Approval"
}
],
"groups": [
{
"name": "group-a1",
"memberSelector": { "byLabel": "tier=frontend" },
"maxConcurrency": "100%",
"maxAllowedFailures": "5",
"beforeGates": [
{
"displayName": "group before gate",
"type": "Approval"
}
],
"afterGates": [
{
"displayName": "group after gate",
"type": "Approval"
}
]
},
{
"name": "group-a2",
"memberSelector": { "byLabel": "tier=backend" },
"maxConcurrency": "1",
"maxAllowedFailures": "25%",
"beforeGates": [
{
"displayName": "group before gate",
"type": "Approval"
}
],
"afterGates": [
{
"displayName": "group after gate",
"type": "Approval"
}
]
},
{
"name": "group-a3",
"maxConcurrency": "1",
"beforeGates": [
{
"displayName": "group before gate",
"type": "Approval"
}
],
"afterGates": [
{
"displayName": "group after gate",
"type": "Approval"
}
]
}
],
"afterStageWaitInSeconds": 3600
},
{
"name": "stage2",
"memberSelector": { "byLabel": "env=production" },
"beforeGates": [
{
"displayName": "Wait until Friday evening",
"type": "ScheduledStart",
"scheduledStartConfiguration": {
"startDay": "Friday",
"startTime": "18:00",
"utcOffset": "-05:00"
}
}
],
"groups": [
{
"name": "group-b1"
},
{
"name": "group-b2"
},
{
"name": "group-b3"
}
]
}
]
}
必要參數
指定車隊名稱。
指定更新執行的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
指定成員的升級類型。 可接受的值為 『Full』、'ControlPlaneOnly' 和 'NodeImageOnly'。
| 屬性 | 值 |
|---|---|
| 接受的值: | ControlPlaneOnly, Full, NodeImageOnly |
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
自動取得 Azure 原則 令牌以進行此資源操作。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
相關變更的 ID 是為此資源操作所參考的。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
當 --upgrade-type 設定為 'Full' 或 'ControlPlaneOnly' 時,指定要升級成員的 kubernetes 版本。 可接受的格式為 x.x.x(例如 1.2.3)。
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
[節點影像選取] 是一個選項,可讓您選擇如何升級叢集的節點。
| 屬性 | 值 |
|---|---|
| 接受的值: | Consistent, Latest |
定義升級車隊階段的 JSON 檔案路徑。 如需參考,請參閱範例。
要用於此更新執行的更新原則名稱。 如果未指定,則會使用預設更新策略。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az fleet updaterun delete
刪除更新執行。
az fleet updaterun delete --fleet-name
--name
--resource-group
[--acquire-policy-token]
[--change-reference]
[--no-wait]
[--yes]
範例
刪除更新執行。
az fleet updaterun delete -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun
必要參數
指定車隊名稱。
指定更新執行的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
自動取得 Azure 原則 令牌以進行此資源操作。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
相關變更的 ID 是為此資源操作所參考的。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
請勿提示確認。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az fleet updaterun list
列出車隊的更新執行。
az fleet updaterun list --fleet-name
--resource-group
範例
顯示更新執行的詳細數據。
az fleet updaterun list -g MyFleetResourceGroup -f MyFleetName
必要參數
指定車隊名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az fleet updaterun show
顯示更新執行。
az fleet updaterun show --fleet-name
--name
--resource-group
範例
顯示更新執行的詳細數據。
az fleet updaterun show -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun
必要參數
指定車隊名稱。
指定更新執行的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az fleet updaterun skip
設定在 UpdateRun 內要略過的目標。
az fleet updaterun skip --fleet-name
--name
--resource-group
[--acquire-policy-token]
[--change-reference]
[--no-wait]
[--targets]
範例
將兩個目標設定為略過。
az fleet updaterun skip -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun --targets Group:my-group-name Stage:my-stage-name
必要參數
指定車隊名稱。
指定更新執行的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
自動取得 Azure 原則 令牌以進行此資源操作。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
相關變更的 ID 是為此資源操作所參考的。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
要略過之目標的空間分隔清單。 目標必須是 『targetType:targetName』 格式,例如 Group:MyGroup。 有效的目標類型為(『Member』、『Group』、『Stage』、『AfterStageWait』)。 目標類型區分大小寫。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az fleet updaterun start
啟動更新執行。
az fleet updaterun start --fleet-name
--name
--resource-group
[--acquire-policy-token]
[--change-reference]
[--no-wait]
範例
啟動更新執行。
az fleet updaterun start -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun
必要參數
指定車隊名稱。
指定更新執行的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
自動取得 Azure 原則 令牌以進行此資源操作。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
相關變更的 ID 是為此資源操作所參考的。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az fleet updaterun stop
停止更新執行。
az fleet updaterun stop --fleet-name
--name
--resource-group
[--acquire-policy-token]
[--change-reference]
[--no-wait]
範例
停止更新執行。
az fleet updaterun stop -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun
必要參數
指定車隊名稱。
指定更新執行的名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
自動取得 Azure 原則 令牌以進行此資源操作。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
相關變更的 ID 是為此資源操作所參考的。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
請勿等候長時間執行的作業完成。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az fleet updaterun wait
等候更新執行資源達到所需的狀態。
如果更新執行上的作業中斷或以 --no-wait啟動,請使用此命令等候它完成。
az fleet updaterun wait --fleet-name
--resource-group
--update-run-name
[--acquire-policy-token]
[--change-reference]
[--created]
[--custom]
[--deleted]
[--exists]
[--interval]
[--timeout]
[--updated]
必要參數
指定車隊名稱。
資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。
UpdateRun 資源的名稱。 Required.
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
自動取得 Azure 原則 令牌以進行此資源操作。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
相關變更的 ID 是為此資源操作所參考的。
| 屬性 | 值 |
|---|---|
| 參數群組: | Global Policy Arguments |
請等候在 'Succeeded' 使用 'provisioningState' 建立。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
等到條件符合自定義 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
等到刪除為止。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
等候資源存在。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
輪詢間隔以秒為單位。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | 30 |
以秒為單位的等候上限。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | 3600 |
等到 provisioningState 更新為 'Succeeded'。
| 屬性 | 值 |
|---|---|
| 參數群組: | Wait Condition Arguments |
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |