New-AzConnectedKubernetes
用于注册新的 Kubernetes 群集并在 Azure 资源管理器(ARM)中创建跟踪资源的 API。
语法
Default (默认值)
New-AzConnectedKubernetes
-ClusterName <String>
-ResourceGroupName <String>
[-SubscriptionId <String>]
[-HttpProxy <Uri>]
[-HttpsProxy <Uri>]
[-NoProxy <String>]
[-ProxyCert <String>]
[-OnboardingTimeout <Int32>]
[-DisableAutoUpgrade]
[-ContainerLogPath <String>]
-Location <String>
[-AadProfileAdminGroupObjectID <String[]>]
[-AadProfileEnableAzureRbac]
[-AadProfileTenantId <String>]
[-ArcAgentProfileAgentError <IAgentError[]>]
[-ArcAgentProfileDesiredAgentVersion <String>]
[-ArcAgentProfileSystemComponent <ISystemComponent[]>]
[-KubeConfig <String>]
[-KubeContext <String>]
[-AzureHybridBenefit <String>]
[-Distribution <String>]
[-DistributionVersion <String>]
[-GatewayEnabled]
[-Infrastructure <String>]
[-Kind <String>]
[-PrivateLinkScopeResourceId <String>]
[-PrivateLinkState <String>]
[-ProvisioningState <String>]
[-Tag <Hashtable>]
[-CustomLocationsOid <String>]
[-OidcIssuerProfileEnabled]
[-OidcIssuerProfileSelfHostedIssuerUrl <String>]
[-WorkloadIdentityEnabled]
[-AcceptEULA]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-ConfigurationSetting <Hashtable>]
[-ConfigurationProtectedSetting <Hashtable>]
[-GatewayResourceId <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
用于注册新的 Kubernetes 群集并在 Azure 资源管理器(ARM)中创建跟踪资源的 API。
示例
示例 1:创建连接的 kubernetes。
New-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -Location eastus
Location Name ResourceGroupName
-------- ---- -----------------
eastus azps_test_cluster azps_test_group
此命令创建连接的 kubernetes。
示例 2:使用参数 kubeConfig 和 kubeContext 创建连接的 kubernetes。
New-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -Location eastus -KubeConfig $HOME\.kube\config -KubeContext azps_aks_t01
Location Name ResourceGroupName
-------- ---- -----------------
eastus azps_test_cluster azps_test_group
此命令使用参数 kubeConfig 和 kubeContext 创建连接的 kubernetes。
示例 3:创建 ConnectedKubernetes 的 AzureHybridBenefit。
New-AzConnectedKubernetes -ClusterName azps_test_cluster_ahb -ResourceGroupName azps_test_group -Location eastus -KubeConfig $HOME\.kube\config -KubeContext azps_aks_t01 -PrivateLinkState 'Enabled' -Distribution "AKS_Management" -DistributionVersion "1.0" -PrivateLinkScopeResourceId "/subscriptions/{subscriptionId}/resourceGroups/azps_test_group/providers/Microsoft.HybridCompute/privateLinkScopes/azps-privatelinkscope" -infrastructure "azure_stack_hci" -ProvisioningState 'Succeeded' -AzureHybridBenefit 'True'
I confirm I have an eligible Windows Server license with Azure Hybrid Benefit to apply this benefit to AKS on Azure Stack HCI or Windows Server. Visit https://aka.ms/ahb-aks for details.
[Y] Yes [N] No (default is "N"): Y
Location Name ResourceGroupName
-------- ---- -----------------
eastus azps_test_cluster_ahb azps_test_group
创建 ConnectedKubernetes 的 AzureHybridBenefit。
示例 4:使用 [-AcceptEULA] 将默认接受我们的法律协议条款并创建连接的 kubernetes。
New-AzConnectedKubernetes -ClusterName azps_test_cluster_ahb -ResourceGroupName azps_test_group -Location eastus -KubeConfig $HOME\.kube\config -KubeContext azps_aks_t01 -PrivateLinkState 'Enabled' -Distribution "AKS_Management" -DistributionVersion "1.0" -PrivateLinkScopeResourceId "/subscriptions/{subscriptionId}/resourceGroups/azps_test_group/providers/Microsoft.HybridCompute/privateLinkScopes/azps-privatelinkscope" -infrastructure "azure_stack_hci" -ProvisioningState 'Succeeded' -AzureHybridBenefit 'True' -AcceptEULA
Location Name ResourceGroupName
-------- ---- -----------------
eastus azps_test_cluster_ahb azps_test_group
使用 [-AcceptEULA] 将默认接受我们的法律协议条款并创建连接的 kubernetes。
示例 5:使用参数 HttpProxy、HttpsProxy、NoProxy 和 Proxy 创建连接的 Kubernetes。
New-AzConnectedKubernetes -ClusterName azps_test_cluster_ahb -ResourceGroupName azps_test_group -Location eastus -KubeConfig $HOME\.kube\config -KubeContext azps_aks_t01 -HttpProxy "http://proxy-user:proxy-password@proxy-ip:port" -HttpsProxy "http://proxy-user:proxy-password@proxy-ip:port" -NoProxy "localhost,127.0.0.0/8,192.168.0.0/16,172.17.0.0/16,10.96.0.0/12,10.244.0.0/16,10.43.0.0/24,.svc" -Proxy "http://proxy-user:proxy-password@proxy-ip:port"
Location Name ResourceGroupName
-------- ---- -----------------
eastus azps_test_cluster_ahb azps_test_group
此命令使用参数 HttpProxy、HttpsProxy、NoProxy 和 Proxy 创建连接的 kubernetes。
示例 6:使用参数 HttpProxy、HttpsProxy、NoProxy、Proxy 和 ProxyCredential 创建连接的 Kubernetes。
$pwd = ConvertTo-SecureString -String "****" -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ("proxy-user", $pwd)
New-AzConnectedKubernetes -ClusterName azps_test_cluster_ahb -ResourceGroupName azps_test_group -Location eastus -KubeConfig $HOME\.kube\config -KubeContext azps_aks_t01 -HttpProxy "http://proxy-user:proxy-password@proxy-ip:port" -HttpsProxy "http://proxy-user:proxy-password@proxy-ip:port" -NoProxy "localhost,127.0.0.0/8,192.168.0.0/16,172.17.0.0/16,10.96.0.0/12,10.244.0.0/16,10.43.0.0/24,.svc" -Proxy "http://proxy-ip:port" -ProxyCredential $cred
Location Name ResourceGroupName
-------- ---- -----------------
eastus azps_test_cluster_ahb azps_test_group
此命令使用参数 HttpProxy、HttpsProxy、NoProxy、Proxy 和 ProxyCredential 创建连接的 kubernetes。
示例 7:创建连接的 kubernetes 并禁用 Arc 代理的自动升级。
New-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -Location eastus -DisableAutoUpgrade
Location Name ResourceGroupName
-------- ---- -----------------
eastus azps_test_cluster azps_test_group
此命令创建连接的 kubernetes 并禁用 Arc 代理的自动升级。
示例 8:使用自定义载入超时创建连接的 Kubernetes。
New-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -Location eastus -OnboardingTimeout 600
Location Name ResourceGroupName
-------- ---- -----------------
eastus azps_test_cluster azps_test_group
此命令使用自定义载入超时创建连接的 kubernetes。
参数
-AadProfileAdminGroupObjectID
将具有群集管理员角色的 AAD 组对象 ID 的列表。
参数属性
类型: String [ ]
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-AadProfileEnableAzureRbac
是否为 Kubernetes 授权启用 Azure RBAC。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-AadProfileTenantId
用于身份验证的 AAD 租户 ID。
如果未指定,将使用部署订阅的租户。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-AcceptEULA
接受 ConnectedKubernetes 的 EULA,法律术语将在未提供此参数的情况下弹出
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ArcAgentProfileAgentError
群集资源上的 arc 代理和系统组件错误列表。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ArcAgentProfileDesiredAgentVersion
要安装在群集资源上的 Arc 代理的版本
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ArcAgentProfileSystemComponent
群集资源上安装的系统扩展列表。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-AsJob
以作业身份运行命令
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-AzureHybridBenefit
指示是否选择加入 Azure 混合权益
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ClusterName
调用其获取的 Kubernetes 群集的名称。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
别名: Name
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ConfigurationProtectedSetting
Arc Agentry System Protected Configuration(哈希表的哈希表)。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ConfigurationSetting
Arc 代理系统配置(哈希表的哈希表)。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Confirm
在运行 cmdlet 之前,提示你进行确认。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ContainerLogPath
重写默认容器日志路径以启用 fluent-bit 日志记录。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-CustomLocationsOid
“custom-locations”应用的 OID。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-DefaultProfile
DefaultProfile 参数不起作用。
如果对其他订阅执行 cmdlet,请使用 SubscriptionId 参数。
参数属性
类型: PSObject
默认值: None
支持通配符: False
不显示: False
别名: AzureRMContext, AzureCredential
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-DisableAutoUpgrade
用于禁用 Arc 代理自动升级的标志。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Distribution
在此连接的群集上运行的 Kubernetes 分发版。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-DistributionVersion
此连接的群集上的 Kubernetes 分发版本。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-GatewayEnabled
指示是否启用了 Arc 路由器连接的网关。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-GatewayResourceId
Arc 网关资源 ID
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-HttpProxy
要使用的 kubernetes 群集的代理服务器的 http URI
参数属性
类型: Uri
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-HttpsProxy
要使用的 kubernetes 群集的代理服务器的 https URI
参数属性
类型: Uri
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Infrastructure
在此连接的群集所表示的 Kubernetes 群集上运行的基础结构。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Kind
连接的群集类型。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-KubeConfig
kube 配置文件的路径
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-KubeContext
当前计算机的 Kubeconfig 上下文
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Location
资源所在的地理位置
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-NoProxy
应从代理服务器中排除的主机名的逗号分隔列表,供 kubernetes 群集使用
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-NoWait
异步运行命令
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-OidcIssuerProfileEnabled
是否为工作负荷标识集成启用 oidc 颁发者。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-OidcIssuerProfileSelfHostedIssuerUrl
用于工作负荷标识功能的公有云群集(AKS、EKS、GKE)的颁发者 URL。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-OnboardingTimeout
在 kubernetes 群集上安装 arc-agent pod 所需的时间(以秒为单位)。
参数属性
类型: Int32
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-PrivateLinkScopeResourceId
仅当启用了 privateLinkState 时,才会填充此值。
此连接的群集分配给专用链接范围的资源 ID(如果有)。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-PrivateLinkState
描述已连接群集资源上的专用链接状态的属性。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ProvisioningState
连接的群集资源的预配状态。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ProxyCert
代理或自定义证书颁发机构的证书文件的路径。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ResourceGroupName
资源组的名称。
此名称不区分大小写。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-SubscriptionId
目标订阅的 ID。
参数属性
类型: String
默认值: (Get-AzContext).Subscription.Id
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Tag
资源标记。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-WhatIf
显示 cmdlet 运行时会发生什么情况。
命令脚本未运行。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-WorkloadIdentityEnabled
是启用或禁用工作负荷标识 Webhook
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters 。
输出