Bearbeiten

Freigeben über


Set-AzConnectedKubernetes

API to set properties of the connected cluster resource

Syntax

Set-AzConnectedKubernetes
   -ClusterName <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   [-HttpProxy <Uri>]
   [-HttpsProxy <Uri>]
   [-NoProxy <String>]
   [-ProxyCert <String>]
   [-DisableAutoUpgrade]
   [-ContainerLogPath <String>]
   -Location <String>
   [-KubeConfig <String>]
   [-KubeContext <String>]
   [-AzureHybridBenefit <AzureHybridBenefit>]
   [-Distribution <String>]
   [-DistributionVersion <String>]
   [-Infrastructure <String>]
   [-PrivateLinkScopeResourceId <String>]
   [-PrivateLinkState <PrivateLinkState>]
   [-ProvisioningState <ProvisioningState>]
   [-Tag <Hashtable>]
   [-CustomLocationsOid <String>]
   [-OidcIssuerProfileEnabled]
   [-OidcIssuerProfileSelfHostedIssuerUrl <String>]
   [-WorkloadIdentityEnabled]
   [-AcceptEULA]
   [-ConfigurationSetting <Hashtable>]
   [-ConfigurationProtectedSetting <Hashtable>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzConnectedKubernetes
   -ClusterName <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   [-HttpProxy <Uri>]
   [-HttpsProxy <Uri>]
   [-NoProxy <String>]
   [-ProxyCert <String>]
   [-DisableAutoUpgrade]
   [-ContainerLogPath <String>]
   -Location <String>
   [-KubeConfig <String>]
   [-KubeContext <String>]
   [-AzureHybridBenefit <AzureHybridBenefit>]
   [-Distribution <String>]
   [-DistributionVersion <String>]
   [-Infrastructure <String>]
   [-PrivateLinkScopeResourceId <String>]
   [-PrivateLinkState <PrivateLinkState>]
   [-ProvisioningState <ProvisioningState>]
   [-Tag <Hashtable>]
   [-CustomLocationsOid <String>]
   [-OidcIssuerProfileEnabled]
   [-OidcIssuerProfileSelfHostedIssuerUrl <String>]
   [-WorkloadIdentityEnabled]
   [-AcceptEULA]
   [-ConfigurationSetting <Hashtable>]
   [-ConfigurationProtectedSetting <Hashtable>]
   [-DisableGateway]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzConnectedKubernetes
   -ClusterName <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   [-HttpProxy <Uri>]
   [-HttpsProxy <Uri>]
   [-NoProxy <String>]
   [-ProxyCert <String>]
   [-DisableAutoUpgrade]
   [-ContainerLogPath <String>]
   -Location <String>
   [-KubeConfig <String>]
   [-KubeContext <String>]
   [-AzureHybridBenefit <AzureHybridBenefit>]
   [-Distribution <String>]
   [-DistributionVersion <String>]
   [-Infrastructure <String>]
   [-PrivateLinkScopeResourceId <String>]
   [-PrivateLinkState <PrivateLinkState>]
   [-ProvisioningState <ProvisioningState>]
   [-Tag <Hashtable>]
   [-CustomLocationsOid <String>]
   [-OidcIssuerProfileEnabled]
   [-OidcIssuerProfileSelfHostedIssuerUrl <String>]
   [-WorkloadIdentityEnabled]
   [-AcceptEULA]
   [-ConfigurationSetting <Hashtable>]
   [-ConfigurationProtectedSetting <Hashtable>]
   -GatewayResourceId <String>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzConnectedKubernetes
   [-SubscriptionId <String>]
   [-HttpProxy <Uri>]
   [-HttpsProxy <Uri>]
   [-NoProxy <String>]
   [-ProxyCert <String>]
   [-DisableAutoUpgrade]
   [-ContainerLogPath <String>]
   [-KubeConfig <String>]
   [-KubeContext <String>]
   [-AzureHybridBenefit <AzureHybridBenefit>]
   [-Distribution <String>]
   [-DistributionVersion <String>]
   [-Infrastructure <String>]
   [-PrivateLinkScopeResourceId <String>]
   [-PrivateLinkState <PrivateLinkState>]
   [-ProvisioningState <ProvisioningState>]
   [-Tag <Hashtable>]
   [-CustomLocationsOid <String>]
   [-OidcIssuerProfileEnabled]
   [-OidcIssuerProfileSelfHostedIssuerUrl <String>]
   [-WorkloadIdentityEnabled]
   [-AcceptEULA]
   [-ConfigurationSetting <Hashtable>]
   [-ConfigurationProtectedSetting <Hashtable>]
   -GatewayResourceId <String>
   -InputObject <IConnectedCluster>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzConnectedKubernetes
   [-SubscriptionId <String>]
   [-HttpProxy <Uri>]
   [-HttpsProxy <Uri>]
   [-NoProxy <String>]
   [-ProxyCert <String>]
   [-DisableAutoUpgrade]
   [-ContainerLogPath <String>]
   [-KubeConfig <String>]
   [-KubeContext <String>]
   [-AzureHybridBenefit <AzureHybridBenefit>]
   [-Distribution <String>]
   [-DistributionVersion <String>]
   [-Infrastructure <String>]
   [-PrivateLinkScopeResourceId <String>]
   [-PrivateLinkState <PrivateLinkState>]
   [-ProvisioningState <ProvisioningState>]
   [-Tag <Hashtable>]
   [-CustomLocationsOid <String>]
   [-OidcIssuerProfileEnabled]
   [-OidcIssuerProfileSelfHostedIssuerUrl <String>]
   [-WorkloadIdentityEnabled]
   [-AcceptEULA]
   [-ConfigurationSetting <Hashtable>]
   [-ConfigurationProtectedSetting <Hashtable>]
   [-DisableGateway]
   -InputObject <IConnectedCluster>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzConnectedKubernetes
   [-SubscriptionId <String>]
   [-HttpProxy <Uri>]
   [-HttpsProxy <Uri>]
   [-NoProxy <String>]
   [-ProxyCert <String>]
   [-DisableAutoUpgrade]
   [-ContainerLogPath <String>]
   [-KubeConfig <String>]
   [-KubeContext <String>]
   [-AzureHybridBenefit <AzureHybridBenefit>]
   [-Distribution <String>]
   [-DistributionVersion <String>]
   [-Infrastructure <String>]
   [-PrivateLinkScopeResourceId <String>]
   [-PrivateLinkState <PrivateLinkState>]
   [-ProvisioningState <ProvisioningState>]
   [-Tag <Hashtable>]
   [-CustomLocationsOid <String>]
   [-OidcIssuerProfileEnabled]
   [-OidcIssuerProfileSelfHostedIssuerUrl <String>]
   [-WorkloadIdentityEnabled]
   [-AcceptEULA]
   [-ConfigurationSetting <Hashtable>]
   [-ConfigurationProtectedSetting <Hashtable>]
   -InputObject <IConnectedCluster>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

API to set properties of the connected cluster resource. Replaces all configuration of an existing connected cluster; any properties not specified will be reset to their default values.

Examples

Example 1: Disable gateway for a connected Kubernetes cluster

Set-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -Location eastus -DisableGateway

Location Name              ResourceGroupName
-------- ----              -----------------
eastus   azps_test_cluster azps_test_group

This command disable gateway feature of a connected kubernete cluster.

Example 2: Enable gateway for a connected Kubernetes cluster

Set-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -Location eastus -GatewayResourceId $gatewayResourceId

Location Name              ResourceGroupName
-------- ----              -----------------
eastus   azps_test_cluster azps_test_group

This command enables gateway feature of a connected kubernetes cluster.

Example 3: Enable gateway for a connected Kubernetes cluster with InputObject

# Get an existing cluster first
$inputObject = Get-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -SubscriptionId $subscriptionId
# Enable gateway and set gateway resource Id 
$inputObject.GatewayEnabled=$true
$inputObject.GatewayResourceId=$gatewayResourceId
Set-AzConnectedKubernetes -InputObject $inputObject

Location Name              ResourceGroupName
-------- ----              -----------------
eastus   azps_test_cluster azps_test_group

This command enables gateway feature of a connected kubernetes cluster.

Example 4: Enable workload identity of a connected kubernetes cluster with InputObject

# Get an existing cluster first
$inputObject = Get-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -SubscriptionId $subscriptionId
# Enable workload identity and OIDC issuer profile
$inputObject.WorkloadIdentityEnabled=$true
$inputObject.OidcIssuerProfileEnabled=$true
Set-AzConnectedKubernetes -InputObject $inputObject

Location Name              ResourceGroupName
-------- ----              -----------------
eastus   azps_test_cluster azps_test_group

This command enables workload identity and OIDC Issuer Profile for a connected Kubernetes cluster

Example 5: Disable workload identity of a connected kubernetes cluster with InputOjbect

# Get an existing cluster first
$inputObject = Get-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -SubscriptionId $subscriptionId
# Disable workload identity 
$inputObject.WorkloadIdentityEnabled=$falue
Set-AzConnectedKubernetes -InputObject $inputObject

Location Name              ResourceGroupName
-------- ----              -----------------
eastus   azps_test_cluster azps_test_group

This command disables workload identity of a connected kubernetes cluster

Example 6: Disable workload identity of a connected kubernetes cluster

Get-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -SubscriptionId $subscriptionId | Set-AzConnectedKubernetes -WorkloadIdentityEnabled:$false

Location Name              ResourceGroupName
-------- ----              -----------------
eastus   azps_test_cluster azps_test_group

This command disables workload identity of a connected kubernetes cluster

Parameters

-AcceptEULA

Accept EULA of ConnectedKubernetes, legal term will pop up without this parameter provided

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AsJob

Run the command as a job

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AzureHybridBenefit

Indicates whether Azure Hybrid Benefit is opted in

Type:AzureHybridBenefit
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ClusterName

The name of the Kubernetes cluster on which get is called.

Type:String
Aliases:Name
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ConfigurationProtectedSetting

Arc Agentry System Protected Configuration

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ConfigurationSetting

Arc Agentry System Configuration

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ContainerLogPath

Override the default container log path to enable fluent-bit logging.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomLocationsOid

OID of 'custom-locations' app.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableAutoUpgrade

Flag to disable auto upgrade of arc agents.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisableGateway

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Distribution

The Kubernetes distribution running on this connected cluster.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DistributionVersion

The Kubernetes distribution version on this connected cluster.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GatewayResourceId

Arc Gateway resource Id, providing this will enable the gateway

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-HttpProxy

The http URI of the proxy server for the kubernetes cluster to use

Type:Uri
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-HttpsProxy

The https URI of the proxy server for the kubernetes cluster to use

Type:Uri
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Infrastructure

The infrastructure on which the Kubernetes cluster represented by this connected cluster is running on.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Type:IConnectedCluster
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-KubeConfig

Path to the kube config file

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-KubeContext

Kubconfig context from current machine

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

The geo-location where the resource lives

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NoProxy

The comma-separated list of hostnames that should be excluded from the proxy server for the kubernetes cluster to use

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NoWait

Run the command asynchronously

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OidcIssuerProfileEnabled

Whether to enable oidc issuer for workload identity integration.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OidcIssuerProfileSelfHostedIssuerUrl

The issuer url for public cloud clusters - AKS, EKS, GKE - used for the workload identity feature.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PrivateLinkScopeResourceId

The resource id of the private link scope this connected cluster is assigned to, if any.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PrivateLinkState

Property which describes the state of private link on a connected cluster resource.

Type:PrivateLinkState
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ProvisioningState

Provisioning state of the connected cluster resource.

Type:ProvisioningState
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ProxyCert

The path to the certificate file for proxy or custom Certificate Authority.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group. The name is case insensitive.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Tag

Resource tags.

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WorkloadIdentityEnabled

Enable the workload identity Webhook

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

IConnectedCluster

Outputs

IConnectedCluster