Skip to content

Commit 1bb53d4

Browse files
authored
Add test cases and examples for kubernetes configuration. (#12318)
1 parent c553795 commit 1bb53d4

19 files changed

+1525
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
Module Name: Az.KubernetesConfiguration
3+
Module Guid: 5a3ae8d3-8682-4ae7-8ec2-d41c0383da2b
4+
Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.kubernetesconfiguration
5+
Help Version: 1.0.0.0
6+
Locale: en-US
7+
---
8+
9+
# Az.KubernetesConfiguration Module
10+
## Description
11+
Microsoft Azure PowerShell: KubernetesConfiguration cmdlets
12+
13+
## Az.KubernetesConfiguration Cmdlets
14+
### [Get-AzKubernetesConfiguration](Get-AzKubernetesConfiguration.md)
15+
Gets details of the Source Control Configuration.
16+
17+
### [New-AzKubernetesConfiguration](New-AzKubernetesConfiguration.md)
18+
Create a new Kubernetes Source Control Configuration.
19+
20+
### [Remove-AzKubernetesConfiguration](Remove-AzKubernetesConfiguration.md)
21+
This will delete the YAML file used to set up the Source control configuration, thus stopping future sync from the source repo.
22+
Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
---
2+
external help file:
3+
Module Name: Az.KubernetesConfiguration
4+
online version: https://docs.microsoft.com/en-us/powershell/module/az.kubernetesconfiguration/get-azkubernetesconfiguration
5+
schema: 2.0.0
6+
---
7+
8+
# Get-AzKubernetesConfiguration
9+
10+
## SYNOPSIS
11+
Gets details of the Source Control Configuration.
12+
13+
## SYNTAX
14+
15+
### List (Default)
16+
```
17+
Get-AzKubernetesConfiguration -ClusterName <String> -ClusterRp <String> -ClusterType <String>
18+
-ResourceGroupName <String> [-SubscriptionId <String[]>] [-DefaultProfile <PSObject>] [<CommonParameters>]
19+
```
20+
21+
### Get
22+
```
23+
Get-AzKubernetesConfiguration -ClusterName <String> -ClusterRp <String> -ClusterType <String> -Name <String>
24+
-ResourceGroupName <String> [-SubscriptionId <String[]>] [-DefaultProfile <PSObject>] [<CommonParameters>]
25+
```
26+
27+
### GetViaIdentity
28+
```
29+
Get-AzKubernetesConfiguration -InputObject <IKubernetesConfigurationIdentity> [-DefaultProfile <PSObject>]
30+
[<CommonParameters>]
31+
```
32+
33+
## DESCRIPTION
34+
Gets details of the Source Control Configuration.
35+
36+
## EXAMPLES
37+
38+
### Example 1: Get all configurations of kubernetes cluster
39+
```powershell
40+
PS C:\> Get-AzKubernetesConfiguration -ResourceGroupName azureps-manual-test -ClusterName ps-connaks-t02 -ClusterRp Microsoft.Kubernetes -ClusterType ConnectedClusters
41+
42+
Name Type
43+
---- ----
44+
conf-test01 Microsoft.KubernetesConfiguration/sourceControlConfigurations
45+
```
46+
47+
This command gets all configurations of kubernetes cluster.
48+
49+
### Example 2: Get a configuration of kubernetes cluster by name
50+
```powershell
51+
PS C:\> Get-AzKubernetesConfiguration -ResourceGroupName azureps-manual-test -ClusterName ps-connaks-t02 -ClusterRp Microsoft.Kubernetes -ClusterType ConnectedClusters -Name conf-t02
52+
53+
Name Type
54+
---- ----
55+
conf-t02 Microsoft.KubernetesConfiguration/sourceControlConfigurations
56+
```
57+
58+
This command gets a configuration of kubernetes cluster by name.
59+
60+
### Example 3: Get a configuration of kubernetes cluster by object
61+
```powershell
62+
PS C:\> $kubConf = New-AzKubernetesConfiguration -Name conf-test02 -ClusterName connaks-dkc29c -ResourceGroupName connaks-rg-w9vlnp -RepositoryUrl http://github.com/xxxx
63+
PS C:\> Get-AzKubernetesConfiguration -InputObject $kubConf
64+
65+
Name Type
66+
---- ----
67+
conf-t02 Microsoft.KubernetesConfiguration/sourceControlConfigurations
68+
```
69+
70+
This command gets a configuration of kubernetes cluster by object.
71+
72+
### Example 4: Get a configuration of kubernetes cluster by pipeline
73+
```powershell
74+
PS C:\> @{Id='/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/connaks-rg-w9vlnp/providers/Microsoft.Kubernetes/connectedClusters/connaks-d983yc/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/conf-test01'} | Get-AzKubernetesConfiguration
75+
76+
Name Type
77+
---- ----
78+
conf-test01 Microsoft.KubernetesConfiguration/sourceControlConfigurations
79+
```
80+
81+
This command gets a configuration of kubernetes cluster by pipeline.
82+
83+
## PARAMETERS
84+
85+
### -ClusterName
86+
The name of the kubernetes cluster.
87+
88+
```yaml
89+
Type: System.String
90+
Parameter Sets: Get, List
91+
Aliases:
92+
93+
Required: True
94+
Position: Named
95+
Default value: None
96+
Accept pipeline input: False
97+
Accept wildcard characters: False
98+
```
99+
100+
### -ClusterRp
101+
The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters).
102+
103+
```yaml
104+
Type: System.String
105+
Parameter Sets: Get, List
106+
Aliases:
107+
108+
Required: True
109+
Position: Named
110+
Default value: None
111+
Accept pipeline input: False
112+
Accept wildcard characters: False
113+
```
114+
115+
### -ClusterType
116+
The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters).
117+
118+
```yaml
119+
Type: System.String
120+
Parameter Sets: Get, List
121+
Aliases:
122+
123+
Required: True
124+
Position: Named
125+
Default value: None
126+
Accept pipeline input: False
127+
Accept wildcard characters: False
128+
```
129+
130+
### -DefaultProfile
131+
The credentials, account, tenant, and subscription used for communication with Azure.
132+
133+
```yaml
134+
Type: System.Management.Automation.PSObject
135+
Parameter Sets: (All)
136+
Aliases: AzureRMContext, AzureCredential
137+
138+
Required: False
139+
Position: Named
140+
Default value: None
141+
Accept pipeline input: False
142+
Accept wildcard characters: False
143+
```
144+
145+
### -InputObject
146+
Identity Parameter
147+
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
148+
149+
```yaml
150+
Type: Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.IKubernetesConfigurationIdentity
151+
Parameter Sets: GetViaIdentity
152+
Aliases:
153+
154+
Required: True
155+
Position: Named
156+
Default value: None
157+
Accept pipeline input: True (ByValue)
158+
Accept wildcard characters: False
159+
```
160+
161+
### -Name
162+
Name of the Source Control Configuration.
163+
164+
```yaml
165+
Type: System.String
166+
Parameter Sets: Get
167+
Aliases: SourceControlConfigurationName
168+
169+
Required: True
170+
Position: Named
171+
Default value: None
172+
Accept pipeline input: False
173+
Accept wildcard characters: False
174+
```
175+
176+
### -ResourceGroupName
177+
The name of the resource group.
178+
179+
```yaml
180+
Type: System.String
181+
Parameter Sets: Get, List
182+
Aliases:
183+
184+
Required: True
185+
Position: Named
186+
Default value: None
187+
Accept pipeline input: False
188+
Accept wildcard characters: False
189+
```
190+
191+
### -SubscriptionId
192+
The Azure subscription ID.
193+
This is a GUID-formatted string (e.g.
194+
00000000-0000-0000-0000-000000000000)
195+
196+
```yaml
197+
Type: System.String[]
198+
Parameter Sets: Get, List
199+
Aliases:
200+
201+
Required: False
202+
Position: Named
203+
Default value: (Get-AzContext).Subscription.Id
204+
Accept pipeline input: False
205+
Accept wildcard characters: False
206+
```
207+
208+
### CommonParameters
209+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
210+
211+
## INPUTS
212+
213+
### Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.IKubernetesConfigurationIdentity
214+
215+
## OUTPUTS
216+
217+
### Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.Api20191101Preview.ISourceControlConfiguration
218+
219+
## NOTES
220+
221+
ALIASES
222+
223+
COMPLEX PARAMETER PROPERTIES
224+
225+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
226+
227+
228+
INPUTOBJECT <IKubernetesConfigurationIdentity>: Identity Parameter
229+
- `[ClusterName <String>]`: The name of the kubernetes cluster.
230+
- `[ClusterResourceName <String>]`: The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters).
231+
- `[ClusterRp <String>]`: The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters).
232+
- `[Id <String>]`: Resource identity path
233+
- `[ResourceGroupName <String>]`: The name of the resource group.
234+
- `[SourceControlConfigurationName <String>]`: Name of the Source Control Configuration.
235+
- `[SubscriptionId <String>]`: The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
236+
237+
## RELATED LINKS
238+

0 commit comments

Comments
 (0)