共用方式為


az fleet namespace

備註

此參考是 Azure CLI 的 車隊 擴充功能一部分(2.61.0 版或更高版本)。 擴充功能會在您第一次執行 az fleet namespace 命令時自動安裝。 深入了解擴充功能。

此命令群組處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

管理叢集受管命名空間的命令。

命令

名稱 Description 類型 狀態
az fleet namespace create

建立叢集受管命名空間。

Extension Preview
az fleet namespace delete

刪除叢集受管命名空間。

Extension Preview
az fleet namespace get-credentials

取得叢集命名空間的 kubeconfig,並預先設定命名空間內容。

Extension Preview
az fleet namespace list

列出叢集的受管命名空間。

Extension Preview
az fleet namespace show

取得叢集受管命名空間。

Extension Preview
az fleet namespace update

更新叢集受管命名空間。

Extension Preview
az fleet namespace wait

等待叢集受管命名空間達到所需狀態。

Extension Preview

az fleet namespace create

預覽

命令群組「叢集命名空間」處於預覽階段,正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

建立叢集受管命名空間。

az fleet namespace create --fleet-name
                          --name
                          --resource-group
                          [--adoption-policy {Always, IfIdentical, Never}]
                          [--annotations]
                          [--cpu-limits]
                          [--cpu-requests]
                          [--delete-policy {Delete, Keep}]
                          [--egress-policy {AllowAll, AllowSameNamespace, DenyAll}]
                          [--ingress-policy {AllowAll, AllowSameNamespace, DenyAll}]
                          [--labels]
                          [--member-cluster-names]
                          [--memory-limits]
                          [--memory-requests]
                          [--no-wait]
                          [--tags]

範例

建立基本叢集受管命名空間。

az fleet namespace create -g MyFleetResourceGroup -f MyFleetName -n MyManagedNamespace

建立具有標籤的叢集受管命名空間。

az fleet namespace create -g MyFleetResourceGroup -f MyFleetName -n MyManagedNamespace --tags environment=production key=value

建立具有資源限制和政策的叢集受管命名空間。

az fleet namespace create -g MyFleetResourceGroup -f MyFleetName -n MyManagedNamespace --annotations key=value --labels key=value --cpu-requests 1m --cpu-limits 4m --memory-requests 1Mi --memory-limits 4Mi --ingress-policy AllowAll --egress-policy DenyAll --delete-policy Keep --adoption-policy Never

在特定成員叢集上建立叢集受管命名空間。

az fleet namespace create -g MyFleetResourceGroup -f MyFleetName -n MyManagedNamespace --member-cluster-names team-01 team-02 team-03 team-04

必要參數

--fleet-name -f

艦隊的名稱。

--name -n

要在成員叢集上建立的 Kubernetes 命名空間名稱。

--resource-group -g

資源群組的名稱。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--adoption-policy

命名空間的採用原則。

屬性
預設值: Never
接受的值: Always, IfIdentical, Never
--annotations

key=value 格式的空格分隔註釋。 範例:env=production region=us-west team=devops。

--cpu-limits

命名空間的 CPU 限制。 範例:1000m。

--cpu-requests

命名空間的 CPU 要求。 範例:1000m。

--delete-policy

刪除命名空間的原則。

屬性
預設值: Keep
接受的值: Delete, Keep
--egress-policy

命名空間的輸出原則。

屬性
接受的值: AllowAll, AllowSameNamespace, DenyAll
--ingress-policy

命名空間的輸入原則。

屬性
接受的值: AllowAll, AllowSameNamespace, DenyAll
--labels

索引鍵=value 格式的空間分隔標籤。 範例:env=production region=us-west team=devops。

--member-cluster-names

要套用名稱空間的成員叢集名稱以空格區隔的清單。

--memory-limits

命名空間的記憶體限制。 範例:500Mi。

--memory-requests

命名空間的記憶體要求。 範例:500Mi。

--no-wait

請勿等候長時間執行的作業完成。

屬性
預設值: False
--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

全域參數
--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 fleet namespace delete

預覽

命令群組「叢集命名空間」處於預覽階段,正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

刪除叢集受管命名空間。

az fleet namespace delete --fleet-name
                          --name
                          --resource-group
                          [--no-wait]
                          [--yes]

範例

刪除特定的受管理命名空間。

az fleet namespace delete -g MyFleetResourceGroup -f MyFleetName -n MyManagedNamespace

必要參數

--fleet-name -f

艦隊的名稱。

--name -n

受管理命名空間的名稱。

--resource-group -g

資源群組的名稱。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--no-wait

請勿等候長時間執行的作業完成。

屬性
預設值: False
--yes -y

請勿提示確認。

屬性
預設值: False
全域參數
--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 fleet namespace get-credentials

預覽

命令群組「叢集命名空間」處於預覽階段,正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

取得叢集命名空間的 kubeconfig,並預先設定命名空間內容。

az fleet namespace get-credentials --fleet-name
                                   --name
                                   --resource-group
                                   [--context]
                                   [--file]
                                   [--member]
                                   [--overwrite-existing]

範例

從中樞叢集取得叢集命名空間的 kubeconfig。

az fleet namespace get-credentials -g MyFleetResourceGroup -f MyFleetName -n MyManagedNamespace

從特定叢集成員取得叢集命名空間的 kubeconfig。

az fleet namespace get-credentials -g MyFleetResourceGroup -f MyFleetName -n MyManagedNamespace --member MyFleetMember

將 kubeconfig 儲存到特定檔案。

az fleet namespace get-credentials -g MyFleetResourceGroup -f MyFleetName -n MyManagedNamespace --file ~/my-namespace-config

必要參數

--fleet-name -f

艦隊的名稱。

--name -n

指定受管理命名空間名稱。

--resource-group -g

資源群組的名稱。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--context

如果指定,請覆寫預設內容名稱。

--file

要更新的 Kubernetes 組態檔。 請改用 「-」 列印 YAML 至 stdout。

屬性
預設值: ~\.kube\config
--member -m

指定叢集成員名稱,以從其相關聯的受管叢集取得登入資料。

--overwrite-existing

以相同名稱覆寫任何現有的叢集專案。

屬性
預設值: True
全域參數
--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 fleet namespace list

預覽

命令群組「叢集命名空間」處於預覽階段,正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

列出叢集的受管命名空間。

az fleet namespace list --fleet-name
                        --resource-group

範例

列出指定叢集的所有受管命名空間。

az fleet namespace list -g MyFleetResourceGroup -f MyFleetName

必要參數

--fleet-name -f

艦隊的名稱。

--resource-group -g

資源群組的名稱。

全域參數
--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 fleet namespace show

預覽

命令群組「叢集命名空間」處於預覽階段,正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

取得叢集受管命名空間。

az fleet namespace show --fleet-name
                        --name
                        --resource-group

範例

顯示特定受管理命名空間的詳細資料。

az fleet namespace show -g MyFleetResourceGroup -f MyFleetName -n MyManagedNamespace

必要參數

--fleet-name -f

艦隊的名稱。

--name -n

受管理命名空間的名稱。

--resource-group -g

資源群組的名稱。

全域參數
--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 fleet namespace update

預覽

命令群組「叢集命名空間」處於預覽階段,正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

更新叢集受管命名空間。

az fleet namespace update --fleet-name
                          --name
                          --resource-group
                          [--no-wait]
                          [--tags]

範例

更新叢集受管命名空間。

az fleet namespace update -g MyFleetResourceGroup -f MyFleetName -n MyManagedNamespace

更新叢集受管命名空間的標籤。

az fleet namespace update -g MyFleetResourceGroup -f MyFleetName -n MyManagedNamespace --tags environment=production

必要參數

--fleet-name -f

艦隊的名稱。

--name -n

受管理命名空間的名稱。

--resource-group -g

資源群組的名稱。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--no-wait

請勿等候長時間執行的作業完成。

屬性
預設值: False
--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

全域參數
--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 fleet namespace wait

預覽

命令群組「叢集命名空間」處於預覽階段,正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

等待叢集受管命名空間達到所需狀態。

如果叢集受管命名空間上的作業中斷或以 啟動 --no-wait,請使用此命令來等待其完成。

az fleet namespace wait --fleet-name
                        --name
                        --resource-group
                        [--created]
                        [--custom]
                        [--deleted]
                        [--exists]
                        [--interval]
                        [--timeout]
                        [--updated]

必要參數

--fleet-name -f

艦隊的名稱。

--name -n

受管理命名空間的名稱。

--resource-group -g

資源群組的名稱。

選擇性參數

下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。

--created

請等候在 'Succeeded' 使用 'provisioningState' 建立。

屬性
參數群組: Wait Condition Arguments
預設值: False
--custom

等到條件符合自定義 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

屬性
參數群組: Wait Condition Arguments
--deleted

等到刪除為止。

屬性
參數群組: Wait Condition Arguments
預設值: False
--exists

等候資源存在。

屬性
參數群組: Wait Condition Arguments
預設值: False
--interval

輪詢間隔以秒為單位。

屬性
參數群組: Wait Condition Arguments
預設值: 30
--timeout

以秒為單位的等候上限。

屬性
參數群組: Wait Condition Arguments
預設值: 3600
--updated

等到 provisioningState 更新為 'Succeeded'。

屬性
參數群組: Wait Condition Arguments
預設值: False
全域參數
--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