Skip to content

Commit

Permalink
persist handling
Browse files Browse the repository at this point in the history
Signed-off-by: Gerd Oberlechner <[email protected]>
  • Loading branch information
geoberle committed Oct 30, 2024
1 parent a9b4905 commit c9d63f8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/aro-hcp-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: ARO HCP Continuous Deployment
env:
DEPLOY_ENV: dev
PERSIST: true
SKIP_CONFIRM: true
on:
workflow_dispatch:
Expand Down
3 changes: 0 additions & 3 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -149,8 +148,6 @@ clouds:
# this is the personal DEV environment
defaults:
<<: *rh-dev-tmpl
# saving money!
persist: false
# Cluster Service
clusterServicePostgresDeploy: false
# DNS
Expand Down
8 changes: 8 additions & 0 deletions dev-infrastructure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -159,6 +161,8 @@ region: region.wait regional.rg
$(PROMPT_TO_CONFIRM) \
--parameters \
configurations/region.bicepparam
--parameters \
persist=${PERSIST}
.PHONY: region

region.clean:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 4 additions & 2 deletions dev-infrastructure/docs/development-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit c9d63f8

Please sign in to comment.