diff --git a/.github/workflows/aro-hcp-cd.yml b/.github/workflows/aro-hcp-cd.yml index 60f00b28d..eb6ab2624 100644 --- a/.github/workflows/aro-hcp-cd.yml +++ b/.github/workflows/aro-hcp-cd.yml @@ -2,6 +2,7 @@ name: ARO HCP Continuous Deployment env: DEPLOY_ENV: dev + PERSIST: true SKIP_CONFIRM: true on: workflow_dispatch: diff --git a/config/config.yaml b/config/config.yaml index 40abe87e0..c4e82cb2b 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -11,7 +11,6 @@ defaults: kubernetesVersion: 1.30.5 istioVersion: "['asm-1-22']" vnetAddressPrefix: "10.128.0.0/14" - persist: true subnetPrefix: "10.128.8.0/21" podSubnetPrefix: "10.128.64.0/18" aksName: aro-hcp-aks @@ -149,8 +148,6 @@ clouds: # this is the personal DEV environment defaults: <<: *rh-dev-tmpl - # saving money! - persist: false # Cluster Service clusterServicePostgresDeploy: false # DNS diff --git a/dev-infrastructure/Makefile b/dev-infrastructure/Makefile index 3fbf259c1..cbb18910f 100644 --- a/dev-infrastructure/Makefile +++ b/dev-infrastructure/Makefile @@ -9,6 +9,8 @@ ifndef SKIP_CONFIRM PROMPT_TO_CONFIRM = "--confirm-with-what-if" endif +PERSIST ?= false + MGMT_KUBECONFIG_FILE ?= ${HOME}/.kube/${MGMT_RESOURCEGROUP}.kubeconfig SVC_KUBECONFIG_FILE ?= ${HOME}/.kube/${SVC_RESOURCEGROUP}.kubeconfig @@ -159,6 +161,8 @@ region: region.wait regional.rg $(PROMPT_TO_CONFIRM) \ --parameters \ configurations/region.bicepparam + --parameters \ + persist=${PERSIST} .PHONY: region region.clean: @@ -202,6 +206,8 @@ svc: svc.wait svc.rg $(PROMPT_TO_CONFIRM) \ --parameters \ configurations/svc-cluster.bicepparam + --parameters \ + persist=${PERSIST} .PHONY: svc svc.enable-aks-metrics: @@ -294,6 +300,8 @@ mgmt: mgmt.wait mgmt.rg $(PROMPT_TO_CONFIRM) \ --parameters \ configurations/mgmt-cluster.bicepparam + --parameters \ + persist=${PERSIST} .PHONY: mgmt mgmt.enable-aks-metrics: diff --git a/dev-infrastructure/configurations/mgmt-cluster.tmpl.bicepparam b/dev-infrastructure/configurations/mgmt-cluster.tmpl.bicepparam index 51982d795..75f5de7d8 100644 --- a/dev-infrastructure/configurations/mgmt-cluster.tmpl.bicepparam +++ b/dev-infrastructure/configurations/mgmt-cluster.tmpl.bicepparam @@ -16,7 +16,6 @@ param userAgentMaxCount = {{ .mgmtUserAgentPoolMaxCount }} param userAgentVMSize = '{{ .mgmtUserAgentPoolVmSize }}' param aksUserOsDiskSizeGB = {{ .mgmtUserAgentPoolOsDiskSizeGB }} param userAgentPoolAZCount = {{ .mgmtUserAgentPoolAzCount }} -param persist = {{ .persist }} param maestroConsumerName = '{{ .maestroConsumerName }}' param maestroKeyVaultName = '{{ .maestroKeyVaultName }}' diff --git a/dev-infrastructure/configurations/svc-cluster.tmpl.bicepparam b/dev-infrastructure/configurations/svc-cluster.tmpl.bicepparam index 5d53b3d57..6a3ac77fe 100644 --- a/dev-infrastructure/configurations/svc-cluster.tmpl.bicepparam +++ b/dev-infrastructure/configurations/svc-cluster.tmpl.bicepparam @@ -5,7 +5,6 @@ param istioVersion = {{ .istioVersion }} param vnetAddressPrefix = '{{ .vnetAddressPrefix }}' param subnetPrefix = '{{ .subnetPrefix }}' param podSubnetPrefix = '{{ .podSubnetPrefix }}' -param persist = {{ .persist }} param aksClusterName = '{{ .aksName }}' param aksKeyVaultName = '{{ .svcEtcdKVName }}' param aksEtcdKVEnableSoftDelete = {{ .svcEtcdKVSoftDelete }} diff --git a/dev-infrastructure/docs/development-setup.md b/dev-infrastructure/docs/development-setup.md index a550add4d..499aeec00 100644 --- a/dev-infrastructure/docs/development-setup.md +++ b/dev-infrastructure/docs/development-setup.md @@ -109,6 +109,8 @@ Note: you only need to run this once. Re-runing it wont hurt, but it will not ch ### Create infrastructure the easy way +> A word of caution upfront: dev infrastructure is usually automatically deleted after 48h. If you want to keep your infrastructure indefinitely, run all the following commands with an env variable `PERSIST=true` + To create the service cluster, management cluster and supporting infrastructure run the following command from the root of this repository. ```bash @@ -141,7 +143,7 @@ This file offers multiple levels of overrides depending on cloud and deployment The base configuration for all Red Hat Azure Subscription based deployments can be found under `clouds.public.environments.rh-dev-tmpl`. This configures the shared infrastructure and component versions to be used in general. -The deployment environment used for personal developer infrastructure is found under `.clouds.public.environments.personal-dev`. It inherits from `rh-dev-tmpl` and defines certain overrides, the most important one being `persist: false` which results in personal dev infrastructure to be cleaned up 48h after creation. +The deployment environment used for personal developer infrastructure is found under `.clouds.public.environments.personal-dev`. It inherits from `rh-dev-tmpl` and defines certain overrides. ### Access AKS clusters @@ -176,7 +178,7 @@ There are more fine grained cleanup tasks available as well make infra.imagesync.clean ``` -> Please note that all resource groups not tagged with `persist=true` will be deleted by our cleanup pipeline after 48 hours +> Please note that all resource groups not tagged with `persist=true` will be deleted by our cleanup pipeline after 48 hours. In order to prevent that from happening, run the infrastructure deployment make targets with a `PERSIST=true` env variable defined ## Deploying Services quick and easy