-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Modules] Updated KubernetesConfiguration/FluxConfigurations to new d…
…ependency approach (#1828) * [Modules] Updated KubernetesConfiguration/FluxConfigurations to new dependency approach * Update to latest * Update to latest * Updated folder default to common. * Update to latest * Update to latest * Update to latest * Update modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep * Update modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep
- Loading branch information
1 parent
842330c
commit cfd4b3d
Showing
8 changed files
with
263 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/dependencies.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
@description('Optional. The location to deploy resources to.') | ||
param location string = resourceGroup().location | ||
|
||
@description('Required. The name of the AKS cluster to create.') | ||
param clusterName string | ||
|
||
@description('Required. The name of the AKS cluster extension to create.') | ||
param clusterExtensionName string | ||
|
||
@description('Required. The name of the AKS cluster nodes resource group to create.') | ||
param clusterNodeResourceGroupName string | ||
|
||
resource cluster 'Microsoft.ContainerService/managedClusters@2022-06-01' = { | ||
name: clusterName | ||
location: location | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
properties: { | ||
dnsPrefix: clusterName | ||
nodeResourceGroup: clusterNodeResourceGroupName | ||
agentPoolProfiles: [ | ||
{ | ||
name: 'agentpool' | ||
count: 1 | ||
vmSize: 'Standard_DS2_v2' | ||
osType: 'Linux' | ||
mode: 'System' | ||
} | ||
] | ||
} | ||
} | ||
|
||
resource extension 'Microsoft.KubernetesConfiguration/extensions@2022-03-01' = { | ||
scope: cluster | ||
name: clusterExtensionName | ||
properties: { | ||
extensionType: 'microsoft.flux' | ||
releaseTrain: 'Stable' | ||
scope: { | ||
cluster: { | ||
releaseNamespace: 'flux-system' | ||
} | ||
} | ||
} | ||
} | ||
|
||
@description('The name of the created AKS cluster.') | ||
output clusterName string = cluster.name |
70 changes: 70 additions & 0 deletions
70
modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/common/deploy.test.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
targetScope = 'subscription' | ||
|
||
// ========== // | ||
// Parameters // | ||
// ========== // | ||
@description('Optional. The name of the resource group to deploy for testing purposes.') | ||
@maxLength(90) | ||
param resourceGroupName string = 'ms.kubernetesconfiguration.fluxconfigurations-${serviceShort}-rg' | ||
|
||
@description('Optional. The location to deploy resources to.') | ||
param location string = deployment().location | ||
|
||
@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') | ||
param serviceShort string = 'kcfccom' | ||
|
||
// =========== // | ||
// Deployments // | ||
// =========== // | ||
|
||
// General resources | ||
// ================= | ||
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { | ||
name: resourceGroupName | ||
location: location | ||
} | ||
|
||
module resourceGroupResources 'dependencies.bicep' = { | ||
scope: resourceGroup | ||
name: '${uniqueString(deployment().name, location)}-paramNested' | ||
params: { | ||
clusterName: 'dep-carml-aks-${serviceShort}' | ||
clusterExtensionName: '<<namePrefix>>${serviceShort}001' | ||
clusterNodeResourceGroupName: 'nodes-${resourceGroupName}' | ||
} | ||
} | ||
|
||
// ============== // | ||
// Test Execution // | ||
// ============== // | ||
|
||
module testDeployment '../../deploy.bicep' = { | ||
scope: resourceGroup | ||
name: '${uniqueString(deployment().name)}-test-${serviceShort}' | ||
params: { | ||
name: '<<namePrefix>>${serviceShort}001' | ||
clusterName: resourceGroupResources.outputs.clusterName | ||
namespace: 'flux-system' | ||
scope: 'cluster' | ||
sourceKind: 'GitRepository' | ||
gitRepository: { | ||
repositoryRef: { | ||
branch: 'main' | ||
} | ||
sshKnownHosts: '' | ||
syncIntervalInSeconds: 300 | ||
timeoutInSeconds: 180 | ||
url: 'https://github.com/mspnp/aks-baseline' | ||
} | ||
kustomizations: { | ||
unified: { | ||
dependsOn: [] | ||
force: false | ||
path: './cluster-manifests' | ||
prune: true | ||
syncIntervalInSeconds: 300 | ||
timeoutInSeconds: 300 | ||
} | ||
} | ||
} | ||
} |
32 changes: 0 additions & 32 deletions
32
modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min.parameters.json
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/dependencies.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
@description('Optional. The location to deploy resources to.') | ||
param location string = resourceGroup().location | ||
|
||
@description('Required. The name of the AKS cluster to create.') | ||
param clusterName string | ||
|
||
@description('Required. The name of the AKS cluster extension to create.') | ||
param clusterExtensionName string | ||
|
||
@description('Required. The name of the AKS cluster nodes resource group to create.') | ||
param clusterNodeResourceGroupName string | ||
|
||
resource cluster 'Microsoft.ContainerService/managedClusters@2022-06-01' = { | ||
name: clusterName | ||
location: location | ||
identity: { | ||
type: 'SystemAssigned' | ||
} | ||
properties: { | ||
dnsPrefix: clusterName | ||
nodeResourceGroup: clusterNodeResourceGroupName | ||
agentPoolProfiles: [ | ||
{ | ||
name: 'agentpool' | ||
count: 1 | ||
vmSize: 'Standard_DS2_v2' | ||
osType: 'Linux' | ||
mode: 'System' | ||
} | ||
] | ||
} | ||
} | ||
|
||
resource extension 'Microsoft.KubernetesConfiguration/extensions@2022-03-01' = { | ||
scope: cluster | ||
name: clusterExtensionName | ||
properties: { | ||
extensionType: 'microsoft.flux' | ||
releaseTrain: 'Stable' | ||
scope: { | ||
cluster: { | ||
releaseNamespace: 'flux-system' | ||
} | ||
} | ||
} | ||
} | ||
|
||
@description('The name of the created AKS cluster.') | ||
output clusterName string = cluster.name |
60 changes: 60 additions & 0 deletions
60
modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/min/deploy.test.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
targetScope = 'subscription' | ||
|
||
// ========== // | ||
// Parameters // | ||
// ========== // | ||
@description('Optional. The name of the resource group to deploy for testing purposes.') | ||
@maxLength(90) | ||
param resourceGroupName string = 'ms.kubernetesconfiguration.fluxconfigurations-${serviceShort}-rg' | ||
|
||
@description('Optional. The location to deploy resources to.') | ||
param location string = deployment().location | ||
|
||
@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') | ||
param serviceShort string = 'kcfcmin' | ||
|
||
// =========== // | ||
// Deployments // | ||
// =========== // | ||
|
||
// General resources | ||
// ================= | ||
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { | ||
name: resourceGroupName | ||
location: location | ||
} | ||
|
||
module resourceGroupResources 'dependencies.bicep' = { | ||
scope: resourceGroup | ||
name: '${uniqueString(deployment().name, location)}-paramNested' | ||
params: { | ||
clusterName: 'dep-carml-aks-${serviceShort}' | ||
clusterExtensionName: '<<namePrefix>>${serviceShort}001' | ||
clusterNodeResourceGroupName: 'nodes-${resourceGroupName}' | ||
} | ||
} | ||
|
||
// ============== // | ||
// Test Execution // | ||
// ============== // | ||
|
||
module testDeployment '../../deploy.bicep' = { | ||
scope: resourceGroup | ||
name: '${uniqueString(deployment().name)}-test-${serviceShort}' | ||
params: { | ||
name: '<<namePrefix>>${serviceShort}001' | ||
clusterName: resourceGroupResources.outputs.clusterName | ||
namespace: 'flux-system' | ||
scope: 'cluster' | ||
sourceKind: 'GitRepository' | ||
gitRepository: { | ||
repositoryRef: { | ||
branch: 'main' | ||
} | ||
sshKnownHosts: '' | ||
syncIntervalInSeconds: 300 | ||
timeoutInSeconds: 180 | ||
url: 'https://github.com/mspnp/aks-baseline' | ||
} | ||
} | ||
} |
44 changes: 0 additions & 44 deletions
44
modules/Microsoft.KubernetesConfiguration/fluxConfigurations/.test/parameters.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.