Skip to content

Commit

Permalink
ensure AKS managed RG has perist:true tag (#1303)
Browse files Browse the repository at this point in the history
an AKS clusters RG inherits the tags of the AKS resource itself. but even if an ARO HCP environment is set up with `persist: false`, the managed RG of the AKS clusters should not be touched by our RG cleanup job as they are lifecycled together with their AKS cluster anyways.

therefore we will set `persist:true` on all AKS clusters we create, regardless of the nature of the environment.

Signed-off-by: Gerd Oberlechner <goberlec@redhat.com>
  • Loading branch information
geoberle authored Feb 11, 2025
1 parent 92d2f37 commit a9a8cb5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
5 changes: 1 addition & 4 deletions dev-infrastructure/modules/aks-cluster-base.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ param location string
param locationAvailabilityZones array
var locationHasAvailabilityZones = length(locationAvailabilityZones) > 0

@description('Set to true to prevent resources from being pruned after 48 hours')
param persist bool = false

param kubernetesVersion string
param deployIstio bool
param istioVersions array = []
Expand Down Expand Up @@ -288,7 +285,7 @@ resource aksCluster 'Microsoft.ContainerService/managedClusters@2024-04-02-previ
tier: 'Standard'
}
tags: {
persist: toLower(string(persist))
persist: 'true'
clusterType: clusterType
}
identity: {
Expand Down
4 changes: 0 additions & 4 deletions dev-infrastructure/templates/mgmt-cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ param location string = resourceGroup().location
@description('List of Availability Zones to use for the AKS cluster')
param locationAvailabilityZones array = getLocationAvailabilityZones(location)

@description('Set to true to prevent resources from being pruned after 48 hours')
param persist bool = false

@description('AKS cluster name')
param aksClusterName string = 'aro-hcp-aks'

Expand Down Expand Up @@ -106,7 +103,6 @@ module mgmtCluster '../modules/aks-cluster-base.bicep' = {
params: {
location: location
locationAvailabilityZones: locationAvailabilityZones
persist: persist
aksClusterName: aksClusterName
aksNodeResourceGroupName: aksNodeResourceGroupName
aksEtcdKVEnableSoftDelete: aksEtcdKVEnableSoftDelete
Expand Down
4 changes: 0 additions & 4 deletions dev-infrastructure/templates/svc-cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ param location string = resourceGroup().location
param locationAvailabilityZones array = getLocationAvailabilityZones(location)
var locationHasAvailabilityZones = length(locationAvailabilityZones) > 0

@description('Set to true to prevent resources from being pruned after 48 hours')
param persist bool = false

@description('AKS cluster name')
param aksClusterName string

Expand Down Expand Up @@ -199,7 +196,6 @@ module svcCluster '../modules/aks-cluster-base.bicep' = {
params: {
location: location
locationAvailabilityZones: locationAvailabilityZones
persist: persist
aksClusterName: aksClusterName
aksNodeResourceGroupName: aksNodeResourceGroupName
aksEtcdKVEnableSoftDelete: aksEtcdKVEnableSoftDelete
Expand Down

0 comments on commit a9a8cb5

Please sign in to comment.