Skip to content

Commit

Permalink
Migrate ConnectedKubernetes from generation to main (Azure#25804)
Browse files Browse the repository at this point in the history
* Move ConnectedKubernetes to main

* Add changelog for connectedKubernet

---------

Co-authored-by: azure-powershell-bot <[email protected]>
Co-authored-by: Xiaogang Ding <[email protected]>
  • Loading branch information
3 people authored Aug 14, 2024
1 parent b09e1ba commit 6d49acd
Show file tree
Hide file tree
Showing 163 changed files with 10,317 additions and 1,810 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ In this directory, run AutoRest:
> see https://aka.ms/autorest
``` yaml
commit: ac6324d13863e8157f4b392ef0ceef1e86eea935
commit: 0ce2859b2f018adcea3d14346951ff4270dcff3d
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2022-10-01-preview/connectedClusters.json
- $(repo)/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-07-01-preview/connectedClusters.json

title: ConnectedKubernetes
module-version: 0.1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "connectedClusters",
"apiVersion": "2022-10-01-preview",
"apiVersion": "2024-07-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.connectedkubernetes"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ New-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps
New-AzConnectedKubernetes -ClusterName azps_test_cluster1 -ResourceGroupName azps_test_group -Location eastus -KubeConfig $HOME\.kube\config -KubeContext azps_aks_t01
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedCluster
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.IConnectedCluster
.Link
https://learn.microsoft.com/powershell/module/az.connectedkubernetes/new-azconnectedkubernetes
#>
function New-AzConnectedKubernetes {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedCluster])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.IConnectedCluster])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
Expand Down Expand Up @@ -173,6 +173,24 @@ function New-AzConnectedKubernetes {
# OID of 'custom-locations' app.
${CustomLocationsOid},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
[System.Management.Automation.SwitchParameter]
# Whether to enable oidc issuer for workload identity integration.
${OidcIssuerProfileEnabled},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
[System.String]
# The issuer url for public cloud clusters - AKS, EKS, GKE - used for the workload identity feature.
${OidcIssuerProfileSelfHostedIssuerUrl},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
[System.Management.Automation.SwitchParameter]
# Whether to enable or disable the workload identity Webhook
${WorkloadIdentityEnabled},

[Parameter()]
[System.Management.Automation.SwitchParameter]
# Accept EULA of ConnectedKubernetes, legal term will pop up without this parameter provided
Expand Down Expand Up @@ -526,6 +544,26 @@ function New-AzConnectedKubernetes {
} catch {
throw "Unable to install helm chart at $ChartPath"
}

if ($PSBoundParameters.ContainsKey('OidcIssuerProfileEnabled') -or $PSBoundParameters.ContainsKey('WorkloadIdentityEnabled') ) {
$ExistConnectedKubernetes = Get-AzConnectedKubernetes -ResourceGroupName $ResourceGroupName -ClusterName $ClusterName @CommonPSBoundParameters

Write-Host "Cluster configuration is in progress..."
$timeout = [datetime]::Now.AddMinutes(60)

while (($ExistConnectedKubernetes.ArcAgentProfileAgentState -ne "Succeeded") -and ($ExistConnectedKubernetes.ArcAgentProfileAgentState -ne "Failed") -and ([datetime]::Now -lt $timeout)) {
Start-Sleep -Seconds 30
$ExistConnectedKubernetes = Get-AzConnectedKubernetes -ResourceGroupName $ResourceGroupName -ClusterName $ClusterName @CommonPSBoundParameters
}

if ($ExistConnectedKubernetes.ArcAgentProfileAgentState -eq "Succeeded") {
Write-Host "Cluster configuration succeeded."
} elseif ($ExistConnectedKubernetes.ArcAgentProfileAgentState -eq "Failed") {
Write-Error "Cluster configuration failed."
} else {
Write-Error "Cluster configuration timed out after 60 minutes."
}
}
Return $Response
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Get-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.IConnectedKubernetesIdentity
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedCluster
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.IConnectedCluster
.Notes
COMPLEX PARAMETER PROPERTIES
Expand All @@ -42,7 +42,7 @@ INPUTOBJECT <IConnectedKubernetesIdentity>: Identity Parameter
https://learn.microsoft.com/powershell/module/az.connectedkubernetes/update-azconnectedkubernetes
#>
function Update-AzConnectedKubernetes {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedCluster])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.IConnectedCluster])]
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
Expand Down Expand Up @@ -99,7 +99,7 @@ param(

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedClusterPatchTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.IConnectedClusterPatchTags]))]
[System.Collections.Hashtable]
# Resource tags.
${Tag},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ This command creates a connected kubernetes with parameters HttpProxy, HttpsProx

### Example 6: Create a connected kubernetes with parameters HttpProxy, HttpsProxy, NoProxy, Proxy and ProxyCredential.
```powershell
$pwd = ConvertTo-SecureString "proxy-password" -AsPlainText -Force
$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
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Get-AzConnectedKubernetes -InputObject $conAks
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.IConnectedKubernetesIdentity
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedCluster
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.IConnectedCluster
.Notes
COMPLEX PARAMETER PROPERTIES
Expand All @@ -47,7 +47,7 @@ INPUTOBJECT <IConnectedKubernetesIdentity>: Identity Parameter
https://learn.microsoft.com/powershell/module/az.connectedkubernetes/get-azconnectedkubernetes
#>
function Get-AzConnectedKubernetes {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedCluster])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.IConnectedCluster])]
[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Get-AzConnectedKubernetesUserCredential -ClusterName azps_test_cluster -Resource
Get-AzConnectedKubernetesUserCredential -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -AuthenticationMethod Token -ClientProxy:$false
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IListClusterUserCredentialProperties
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.IListClusterUserCredentialProperties
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.ICredentialResults
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.ICredentialResults
.Notes
COMPLEX PARAMETER PROPERTIES
Expand All @@ -40,7 +40,7 @@ PROPERTY <IListClusterUserCredentialProperties>: .
https://learn.microsoft.com/powershell/module/az.connectedkubernetes/get-azconnectedkubernetesusercredential
#>
function Get-AzConnectedKubernetesUserCredential {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.ICredentialResults])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.ICredentialResults])]
[CmdletBinding(DefaultParameterSetName='ListExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
Expand All @@ -66,7 +66,7 @@ param(

[Parameter(ParameterSetName='List', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IListClusterUserCredentialProperties]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.IListClusterUserCredentialProperties]
# .
# To construct, see NOTES section for PROPERTY properties and create a hash table.
${Property},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ New-AzConnectedKubernetes -ClusterName azps_test_cluster_ahb -ResourceGroupName
.Example
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"
.Example
$pwd = ConvertTo-SecureString "proxy-password" -AsPlainText -Force
$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
.Example
Expand All @@ -39,12 +39,12 @@ New-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps
New-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps_test_group -Location eastus -OnboardingTimeout 600
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedCluster
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.IConnectedCluster
.Link
https://learn.microsoft.com/powershell/module/az.connectedkubernetes/new-azconnectedkubernetes
#>
function New-AzConnectedKubernetes {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedCluster])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240701Preview.IConnectedCluster])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
Expand Down Expand Up @@ -186,6 +186,24 @@ param(
# OID of 'custom-locations' app.
${CustomLocationsOid},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
[System.Management.Automation.SwitchParameter]
# Whether to enable oidc issuer for workload identity integration.
${OidcIssuerProfileEnabled},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
[System.String]
# The issuer url for public cloud clusters - AKS, EKS, GKE - used for the workload identity feature.
${OidcIssuerProfileSelfHostedIssuerUrl},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
[System.Management.Automation.SwitchParameter]
# Whether to enable or disable the workload identity Webhook
${WorkloadIdentityEnabled},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
[System.Management.Automation.SwitchParameter]
Expand Down
Loading

0 comments on commit 6d49acd

Please sign in to comment.