Share via


az k8s-configuration flux

注意

此參考是 Azure CLI 的 k8s 組態 擴充功能的一部分 (2.15.0 版或更高版本)。 擴充功能會在您第一次執行 az k8s-configuration flux 命令時自動安裝。 深入了解擴充功能。

管理 Flux v2 Kubernetes 組態的命令。

命令

名稱 Description 類型 狀態
az k8s-configuration flux create

建立 Flux v2 Kubernetes 組態。

擴充 GA
az k8s-configuration flux delete

刪除 Flux v2 Kubernetes 組態。

擴充 GA
az k8s-configuration flux deployed-object

查看與 Flux v2 Kubernetes 組態相關聯的已部署物件命令。

擴充 GA
az k8s-configuration flux deployed-object list

列出與 Flux v2 Kubernetes 組態相關聯的已部署物件。

擴充 GA
az k8s-configuration flux deployed-object show

顯示與 Flux v2 Kubernetes 組態相關聯的已部署物件。

擴充 GA
az k8s-configuration flux kustomization

用來管理與 Flux v2 Kubernetes 組態相關聯的 Kustomizations 命令。

擴充 GA
az k8s-configuration flux kustomization create

建立與 Flux v2 Kubernetes 組態相關聯的 Kustomization。

擴充 GA
az k8s-configuration flux kustomization delete

刪除與 Flux v2 Kubernetes 組態相關聯的 Kustomization。

擴充 GA
az k8s-configuration flux kustomization list

列出與 Flux v2 Kubernetes 組態相關聯的 Kustomizations。

擴充 GA
az k8s-configuration flux kustomization show

顯示與 Flux v2 Kubernetes 組態相關聯的 Kustomization。

擴充 GA
az k8s-configuration flux kustomization update

更新與 Flux v2 Kubernetes 組態相關聯的 Kustomization。

擴充 GA
az k8s-configuration flux list

列出所有 Flux v2 Kubernetes 組態。

擴充 GA
az k8s-configuration flux show

顯示 Flux v2 Kubernetes 設定。

擴充 GA
az k8s-configuration flux update

更新 Flux v2 Kubernetes 設定。

擴充 GA

az k8s-configuration flux create

建立 Flux v2 Kubernetes 組態。

az k8s-configuration flux create --cluster-name
                                 --cluster-type {connectedClusters, managedClusters, provisionedClusters}
                                 --name
                                 --resource-group
                                 --url
                                 [--account-key]
                                 [--branch]
                                 [--bucket-access-key]
                                 [--bucket-insecure {false, true}]
                                 [--bucket-name]
                                 [--bucket-secret-key]
                                 [--cluster-resource-provider]
                                 [--commit]
                                 [--container-name]
                                 [--https-ca-cert]
                                 [--https-ca-cert-file]
                                 [--https-key]
                                 [--https-user]
                                 [--interval]
                                 [--kind {azblob, bucket, git}]
                                 [--known-hosts]
                                 [--known-hosts-file]
                                 [--kustomization]
                                 [--local-auth-ref]
                                 [--managed-identity-client-id]
                                 [--namespace]
                                 [--no-wait]
                                 [--sas-token]
                                 [--scope {cluster, namespace}]
                                 [--semver]
                                 [--service-principal-client-certificate]
                                 [--service-principal-client-certificate-password]
                                 [--service-principal-client-certificate-send-chain]
                                 [--service-principal-client-id]
                                 [--service-principal-client-secret]
                                 [--service-principal-tenant-id]
                                 [--ssh-private-key]
                                 [--ssh-private-key-file]
                                 [--suspend {false, true}]
                                 [--tag]
                                 [--timeout]

範例

建立 Flux v2 Kubernetes 設定

az k8s-configuration flux create --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters \
--name myconfig --scope cluster --namespace my-namespace \
--kind git --url https://github.com/Azure/arc-k8s-demo \
--branch main --kustomization name=my-kustomization

使用貯體來源種類建立 Kubernetes v2 Flux 設定

az k8s-configuration flux create --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters \
--name myconfig --scope cluster --namespace my-namespace \
--kind bucket --url https://bucket-provider.minio.io \
--bucket-name my-bucket --kustomization name=my-kustomization \
--bucket-access-key my-access-key --bucket-secret-key my-secret-key

使用 Azure Blob 來源種類建立 Kubernetes v2 Flux 設定

az k8s-configuration flux create --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters \
--name myconfig --scope cluster --namespace my-namespace \
--kind azblob --url https://mystorageaccount.blob.core.windows.net \
--container-name my-container --kustomization name=my-kustomization \
--account-key my-account-key

必要參數

--cluster-name -c

Kubernetes 叢集的名稱。

--cluster-type -t

指定 Arc 連線的叢集或 AKS 受控叢集或布建的叢集。

接受的值: connectedClusters, managedClusters, provisionedClusters
--name -n

flux 組態的名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--url -u

要協調的來源 URL。

選擇性參數

--account-key

用於驗證的 Azure Blob 共用金鑰。

--branch

Git 來源內的分支,以與叢集協調。

--bucket-access-key

用來向貯體進行驗證的存取金鑰識別碼。

--bucket-insecure

與不含 TLS 的貯體通訊。

接受的值: false, true
預設值: False
--bucket-name

要同步處理的 S3 貯體名稱。

--bucket-secret-key

用來向貯體進行驗證的秘密金鑰。

--cluster-resource-provider --cluster-rp

此 clusterType 的叢集資源提供者名稱(provisionedClusters 的必要專案)。

--commit

在 Git 來源內認可以與叢集協調。

--container-name

要同步Azure Blob 儲存體容器的名稱。

--https-ca-cert

Base64 編碼的 HTTPS CA 憑證,用於與私人存放庫同步的 TLS 通訊。

--https-ca-cert-file

HTTPS CA 憑證檔案的檔案路徑,用於與私人存放庫同步的 TLS 通訊。

--https-key

私人存放庫同步處理的 HTTPS 權杖/密碼。

--https-user

私人存放庫同步處理的 HTTPS 使用者名稱。

--interval --sync-interval

叢集上來源的對帳時間。

--kind

要調和的來源種類。

接受的值: azblob, bucket, git
預設值: git
--known-hosts

Base64 編碼known_hosts資料,其中包含存取私人 Git 實例所需的公用 SSH 金鑰。

--known-hosts-file

known_hosts內容的檔路徑,其中包含存取私人 Git 實例所需的公用 SSH 金鑰。

--kustomization -k

定義 kustomizations 以同步處理來源與參數 ['name', 'path', 'depends_on', 'timeout', 'sync_interval', 'retry_interval', 'prune', 'force']。

--local-auth-ref --local-ref

組態命名空間中 Kubernetes 秘密的本機參考,以用於與來源的通訊。

--managed-identity-client-id --mi-client-id

使用 Azure Blob 進行驗證之受控識別的用戶端識別碼。

--namespace --ns

部署組態的命名空間。

預設值: default
--no-wait

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

預設值: False
--sas-token

用於驗證的 Azure Blob SAS 權杖。

--scope -s

將運算子的範圍指定為 'namespace' 或 'cluster'。

接受的值: cluster, namespace
預設值: cluster
--semver

Git 來源內的 Semver 範圍,以與叢集協調。

--service-principal-client-certificate --sp-client-cert

使用 Azure Blob 驗證服務主體的 Base64 編碼用戶端憑證。

--service-principal-client-certificate-password --sp-cert-password

用來向 Azure Blob 驗證服務主體之用戶端憑證的密碼。

--service-principal-client-certificate-send-chain --sp-cert-send-chain

指定在取得權杖時是否要在用戶端宣告中包含 x5c 標頭,以啟用用戶端憑證的主體名稱/簽發者型驗證。

預設值: False
--service-principal-client-id --sp-client-id

使用 Azure Blob 驗證服務主體的用戶端識別碼,此驗證方法是必要的。

--service-principal-client-secret --sp-client-secret

使用 Azure Blob 驗證服務主體的用戶端密碼。

--service-principal-tenant-id --sp-tenant-id

此驗證方法所需的租使用者識別碼,用來向 Azure Blob 驗證服務主體。

--ssh-private-key

適用于私人存放庫同步處理的 Base64 編碼私密金鑰。

--ssh-private-key-file

私人存放庫同步處理私人 SSH 金鑰的檔案路徑。

--suspend

暫停與此組態相關聯的來源和 kustomization 的對帳。

接受的值: false, true
預設值: False
--tag

Git 來源內的標記,以與叢集協調。

--timeout

在逾時之前協調來源的時間上限。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az k8s-configuration flux delete

刪除 Flux v2 Kubernetes 組態。

az k8s-configuration flux delete --cluster-name
                                 --cluster-type {connectedClusters, managedClusters, provisionedClusters}
                                 --name
                                 --resource-group
                                 [--cluster-resource-provider]
                                 [--force {false, true}]
                                 [--no-wait]
                                 [--yes]

範例

刪除現有的 Flux v2 Kubernetes 設定

az k8s-configuration flux delete --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters --name myconfig

必要參數

--cluster-name -c

Kubernetes 叢集的名稱。

--cluster-type -t

指定 Arc 連線的叢集或 AKS 受控叢集或布建的叢集。

接受的值: connectedClusters, managedClusters, provisionedClusters
--name -n

flux 組態的名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--cluster-resource-provider --cluster-rp

此 clusterType 的叢集資源提供者名稱(provisionedClusters 的必要專案)。

--force

強制從叢集刪除 flux 組態。

接受的值: false, true
預設值: False
--no-wait

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

預設值: False
--yes -y

不提示確認。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az k8s-configuration flux list

列出所有 Flux v2 Kubernetes 組態。

az k8s-configuration flux list --cluster-name
                               --cluster-type {connectedClusters, managedClusters, provisionedClusters}
                               --resource-group
                               [--cluster-resource-provider]

範例

列出叢集上的 Flux v2 Kubernetes 組態

az k8s-configuration flux list --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters

必要參數

--cluster-name -c

Kubernetes 叢集的名稱。

--cluster-type -t

指定 Arc 連線的叢集或 AKS 受控叢集或布建的叢集。

接受的值: connectedClusters, managedClusters, provisionedClusters
--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--cluster-resource-provider --cluster-rp

此 clusterType 的叢集資源提供者名稱(provisionedClusters 的必要專案)。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az k8s-configuration flux show

顯示 Flux v2 Kubernetes 設定。

az k8s-configuration flux show --cluster-name
                               --cluster-type {connectedClusters, managedClusters, provisionedClusters}
                               --name
                               --resource-group
                               [--cluster-resource-provider]

範例

顯示 Flux v2 Kubernetes 設定的詳細資料

az k8s-configuration flux show --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters --name myconfig

必要參數

--cluster-name -c

Kubernetes 叢集的名稱。

--cluster-type -t

指定 Arc 連線的叢集或 AKS 受控叢集或布建的叢集。

接受的值: connectedClusters, managedClusters, provisionedClusters
--name -n

flux 組態的名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--cluster-resource-provider --cluster-rp

此 clusterType 的叢集資源提供者名稱(provisionedClusters 的必要專案)。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az k8s-configuration flux update

更新 Flux v2 Kubernetes 設定。

az k8s-configuration flux update --cluster-name
                                 --cluster-type {connectedClusters, managedClusters, provisionedClusters}
                                 --name
                                 --resource-group
                                 [--account-key]
                                 [--branch]
                                 [--bucket-access-key]
                                 [--bucket-insecure {false, true}]
                                 [--bucket-name]
                                 [--bucket-secret-key]
                                 [--cluster-resource-provider]
                                 [--commit]
                                 [--container-name]
                                 [--https-ca-cert]
                                 [--https-ca-cert-file]
                                 [--https-key]
                                 [--https-user]
                                 [--interval]
                                 [--kind {azblob, bucket, git}]
                                 [--known-hosts]
                                 [--known-hosts-file]
                                 [--kustomization]
                                 [--local-auth-ref]
                                 [--managed-identity-client-id]
                                 [--no-wait]
                                 [--sas-token]
                                 [--semver]
                                 [--service-principal-client-certificate]
                                 [--service-principal-client-certificate-password]
                                 [--service-principal-client-certificate-send-chain]
                                 [--service-principal-client-id]
                                 [--service-principal-client-secret]
                                 [--service-principal-tenant-id]
                                 [--ssh-private-key]
                                 [--ssh-private-key-file]
                                 [--suspend {false, true}]
                                 [--tag]
                                 [--timeout]
                                 [--url]
                                 [--yes]

範例

更新 Flux v2 Kubernetes 設定

az k8s-configuration flux update --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters --name myconfig \
--url https://github.com/Azure/arc-k8s-demo --branch main \
--kustomization name=my-kustomization path=./my/new-path

使用貯體來源種類更新 Flux v2 Kubernetes 設定,以不安全地連線

az k8s-configuration flux update --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters --name myconfig \
--bucket-insecure

使用 Azure Blob 來源種類,以另一個容器名稱更新 Flux v2 Kubernetes 設定

az k8s-configuration flux update --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters --name myconfig \
--container-name other-container

必要參數

--cluster-name -c

Kubernetes 叢集的名稱。

--cluster-type -t

指定 Arc 連線的叢集或 AKS 受控叢集或布建的叢集。

接受的值: connectedClusters, managedClusters, provisionedClusters
--name -n

flux 組態的名稱。

--resource-group -g

資源組名。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--account-key

用於驗證的 Azure Blob 共用金鑰。

--branch

Git 來源內的分支,以與叢集協調。

--bucket-access-key

用來向貯體進行驗證的存取金鑰識別碼。

--bucket-insecure

與不含 TLS 的貯體通訊。

接受的值: false, true
--bucket-name

要同步處理的 S3 貯體名稱。

--bucket-secret-key

用來向貯體進行驗證的秘密金鑰。

--cluster-resource-provider --cluster-rp

此 clusterType 的叢集資源提供者名稱(provisionedClusters 的必要專案)。

--commit

在 Git 來源內認可以與叢集協調。

--container-name

要同步Azure Blob 儲存體容器的名稱。

--https-ca-cert

Base64 編碼的 HTTPS CA 憑證,用於與私人存放庫同步的 TLS 通訊。

--https-ca-cert-file

HTTPS CA 憑證檔案的檔案路徑,用於與私人存放庫同步的 TLS 通訊。

--https-key

私人存放庫同步處理的 HTTPS 權杖/密碼。

--https-user

私人存放庫同步處理的 HTTPS 使用者名稱。

--interval --sync-interval

叢集上來源的對帳時間。

--kind

要調和的來源種類。

接受的值: azblob, bucket, git
--known-hosts

Base64 編碼known_hosts資料,其中包含存取私人 Git 實例所需的公用 SSH 金鑰。

--known-hosts-file

known_hosts內容的檔路徑,其中包含存取私人 Git 實例所需的公用 SSH 金鑰。

--kustomization -k

定義 kustomizations 以同步處理來源與參數 ['name', 'path', 'depends_on', 'timeout', 'sync_interval', 'retry_interval', 'prune', 'force']。

--local-auth-ref --local-ref

組態命名空間中 Kubernetes 秘密的本機參考,以用於與來源的通訊。

--managed-identity-client-id --mi-client-id

使用 Azure Blob 進行驗證之受控識別的用戶端識別碼。

--no-wait

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

預設值: False
--sas-token

用於驗證的 Azure Blob SAS 權杖。

--semver

Git 來源內的 Semver 範圍,以與叢集協調。

--service-principal-client-certificate --sp-client-cert

使用 Azure Blob 驗證服務主體的 Base64 編碼用戶端憑證。

--service-principal-client-certificate-password --sp-cert-password

用來向 Azure Blob 驗證服務主體之用戶端憑證的密碼。

--service-principal-client-certificate-send-chain --sp-cert-send-chain

指定在取得權杖時是否要在用戶端宣告中包含 x5c 標頭,以啟用用戶端憑證的主體名稱/簽發者型驗證。

預設值: False
--service-principal-client-id --sp-client-id

使用 Azure Blob 驗證服務主體的用戶端識別碼,此驗證方法是必要的。

--service-principal-client-secret --sp-client-secret

使用 Azure Blob 驗證服務主體的用戶端密碼。

--service-principal-tenant-id --sp-tenant-id

此驗證方法所需的租使用者識別碼,用來向 Azure Blob 驗證服務主體。

--ssh-private-key

適用于私人存放庫同步處理的 Base64 編碼私密金鑰。

--ssh-private-key-file

私人存放庫同步處理私人 SSH 金鑰的檔案路徑。

--suspend

暫停與此組態相關聯的來源和 kustomization 的對帳。

接受的值: false, true
--tag

Git 來源內的標記,以與叢集協調。

--timeout

在逾時之前協調來源的時間上限。

--url -u

要協調的來源 URL。

--yes -y

不提示確認。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

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

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

--subscription

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

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。