Skip to content

Commit

Permalink
deploymengroup naming
Browse files Browse the repository at this point in the history
  • Loading branch information
geoberle committed Oct 29, 2024
1 parent 1d34b0a commit 8073a54
Show file tree
Hide file tree
Showing 8 changed files with 299 additions and 295 deletions.
522 changes: 255 additions & 267 deletions .github/workflows/aro-hcp-dev-env-cd.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .github/workflows/aro-hcp-dev-what-if.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: ARO HCP Integrated DEV Bicep What-If
env:
DEPLOY_ENV: dev
DEPLOYMENT_NAME_SUFFIX: "-dev-${GITHUB_RUN_ID}"
on:
pull_request:
branches:
Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ infra.imagesync.clean:
infra.clean:
cd dev-infrastructure && DEPLOY_ENV=$(DEPLOY_ENV) make clean

#
# Istio
#

isto.deploy:
./svc-deploy.sh $(DEPLOY_ENV) istio svc

#
# Cluster Service
#
Expand Down Expand Up @@ -109,7 +116,7 @@ hypershift.deploy:
# Deploy ALL components
#

deploy.svc.all: maestro.server.deploy maestro.registration.deploy cs.deploy rp.frontend.deploy rp.backend.deploy
deploy.svc.all: isto.deploy maestro.server.deploy maestro.registration.deploy cs.deploy rp.frontend.deploy rp.backend.deploy

deploy.mgmt.all: maestro.agent.deploy acm.deploy hypershift.deploy

Expand All @@ -120,4 +127,4 @@ list:
.PHONY: list


.PHONY: all clean lint test fmt deploy.all deploy.svc.all deploy.mgmt.all acm.deploy hypershift.deploy rp.frontend.deploy rp.backend.deploy maestro.server.deploy maestro.agent.deploy maestro.registration.deploy maestro infra.svc infra.mgmt infra.imagesync infra.all infra.clean infra.region.clean infra.svc.clean infra.mgmt.clean
.PHONY: all clean lint test fmt deploy.all deploy.svc.all deploy.mgmt.all isto.deploy acm.deploy hypershift.deploy rp.frontend.deploy rp.backend.deploy maestro.server.deploy maestro.agent.deploy maestro.registration.deploy maestro infra.svc infra.mgmt infra.imagesync infra.all infra.clean infra.region.clean infra.svc.clean infra.mgmt.clean
45 changes: 24 additions & 21 deletions dev-infrastructure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ endif

MGMT_KUBECONFIG_FILE ?= ${HOME}/.kube/${MGMT_RESOURCEGROUP}.kubeconfig
SVC_KUBECONFIG_FILE ?= ${HOME}/.kube/${SVC_RESOURCEGROUP}.kubeconfig
MGMG_RG_DEPLOYMENT_NAME ?= "mgmt"
SVC_RG_DEPLOYMENT_NAME ?= "svc"
IMAGE_SYNC_RG_DEPLOYMENT_NAME ?= "image-sync"
REGIONAL_RG_DEPLOYMENT_NAME ?= "region"
METRICS_INFRA_RG_DEPLOYMENT_NAME ?= "metrics-infra"

DEPLOYMENT_NAME_SUFFIX ?=
GLOBAL_RG_DEPLOYMENT_NAME ?= "global${DEPLOYMENT_NAME_SUFFIX}"
MGMG_RG_DEPLOYMENT_NAME ?= "mgmt${DEPLOYMENT_NAME_SUFFIX}"
SVC_RG_DEPLOYMENT_NAME ?= "svc${DEPLOYMENT_NAME_SUFFIX}"
IMAGE_SYNC_RG_DEPLOYMENT_NAME ?= "image-sync${DEPLOYMENT_NAME_SUFFIX}"
REGIONAL_RG_DEPLOYMENT_NAME ?= "region${DEPLOYMENT_NAME_SUFFIX}"
METRICS_INFRA_RG_DEPLOYMENT_NAME ?= "metrics-infra${DEPLOYMENT_NAME_SUFFIX}"
ROLE_ASSIGNMENTS_DEPLOYMENT_NAME ?= "role-assignments${DEPLOYMENT_NAME_SUFFIX}"

list:
@grep '^[^#[:space:]].*:' Makefile
Expand Down Expand Up @@ -52,7 +56,6 @@ cleanup-orphaned-rolebindings:
@scripts/cleanup-orphaned-rolebindings.sh $(MGMT_RESOURCEGROUP)
@scripts/cleanup-orphaned-rolebindings.sh $(REGIONAL_RESOURCEGROUP)
@scripts/cleanup-orphaned-rolebindings.sh ${GLOBAL_RESOURCEGROUP}
@scripts/cleanup-orphaned-rolebindings.sh ${IMAGE_SYNC_RESOURCEGROUP}
.PHONY: cleanup-orphaned-rolebindings

create-mock-identities:
Expand Down Expand Up @@ -165,7 +168,7 @@ region.clean:

region.what-if: region.wait regional.rg
az deployment group what-if \
--name "region" \
--name $(REGIONAL_RG_DEPLOYMENT_NAME) \
--resource-group $(REGIONAL_RESOURCEGROUP) \
--template-file templates/region.bicep \
--parameters \
Expand All @@ -191,7 +194,7 @@ svc.wait:

svc: svc.wait svc.rg cleanup-orphaned-rolebindings
az deployment group create \
--name "svc" \
--name $(SVC_RG_DEPLOYMENT_NAME) \
--resource-group $(SVC_RESOURCEGROUP) \
--template-file templates/svc-cluster.bicep \
$(PROMPT_TO_CONFIRM) \
Expand Down Expand Up @@ -229,17 +232,17 @@ svc.init: region svc svc.aks.admin-access svc.aks.kubeconfig metrics-infra svc.e

svc.what-if: svc.rg
az deployment group what-if \
--name "svc" \
--name $(SVC_RG_DEPLOYMENT_NAME) \
--resource-group $(SVC_RESOURCEGROUP) \
--template-file templates/svc-cluster.bicep \
--parameters \
configurations/svc-cluster.bicepparam
.PHONY: svc.what-if

svc.dev-role-assignments:
@./ensure-no-running-deployment.sh $(SVC_RESOURCEGROUP) svc-roleassigns
@./ensure-no-running-deployment.sh $(SVC_RESOURCEGROUP) ${ROLE_ASSIGNMENTS_DEPLOYMENT_NAME}
az deployment group create \
--name svc-roleassigns \
--name ${ROLE_ASSIGNMENTS_DEPLOYMENT_NAME} \
--resource-group "${SVC_RESOURCEGROUP}" \
--template-file templates/dev-roleassignments.bicep \
--parameters configurations/dev-role-assignments.bicepparam \
Expand Down Expand Up @@ -309,7 +312,7 @@ mgmt.init: region mgmt mgmt.aks.admin-access mgmt.aks.kubeconfig metrics-infra m

mgmt.what-if: mgmt.rg
az deployment group what-if \
--name "mgmt" \
--name $(MGMG_RG_DEPLOYMENT_NAME) \
--resource-group $(MGMT_RESOURCEGROUP) \
--template-file templates/mgmt-cluster.bicep \
--parameters \
Expand All @@ -334,9 +337,9 @@ global.rg:
.PHONY: global.rg

acr: global.rg
@./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) acr
@./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) ${GLOBAL_RG_DEPLOYMENT_NAME}-acr
az deployment group create \
--name "acr" \
--name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr \
--resource-group $(GLOBAL_RESOURCEGROUP) \
--template-file templates/dev-acr.bicep \
$(PROMPT_TO_CONFIRM) \
Expand All @@ -346,17 +349,17 @@ acr: global.rg

acr.what-if: global.rg
az deployment group what-if \
--name "acr" \
--name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr \
--resource-group $(GLOBAL_RESOURCEGROUP) \
--template-file templates/dev-acr.bicep \
--parameters \
configurations/acr.bicepparam
.PHONY: acr.what-if

acr-svc: global.rg
@./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) acr-svc
@./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-svc
az deployment group create \
--name "acr-svc" \
--name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-svc \
--resource-group $(GLOBAL_RESOURCEGROUP) \
--template-file templates/dev-acr.bicep \
$(PROMPT_TO_CONFIRM) \
Expand All @@ -366,17 +369,17 @@ acr-svc: global.rg

acr-svc.what-if: global.rg
az deployment group what-if \
--name "acr-svc" \
--name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-svc \
--resource-group $(GLOBAL_RESOURCEGROUP) \
--template-file templates/dev-acr.bicep \
--parameters \
configurations/acr-svc.bicepparam
.PHONY: acr-svc.what-if

acr-ocp: global.rg
@./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) acr-ocp
@./ensure-no-running-deployment.sh $(GLOBAL_RESOURCEGROUP) ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-ocp
az deployment group create \
--name "acr-ocp" \
--name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-ocp \
--resource-group $(GLOBAL_RESOURCEGROUP) \
--template-file templates/dev-acr.bicep \
$(PROMPT_TO_CONFIRM) \
Expand All @@ -386,7 +389,7 @@ acr-ocp: global.rg

acr-ocp.what-if: global.rg
az deployment group what-if \
--name "acr-ocp" \
--name ${GLOBAL_RG_DEPLOYMENT_NAME}-acr-ocp \
--resource-group $(GLOBAL_RESOURCEGROUP) \
--template-file templates/dev-acr.bicep \
--parameters \
Expand Down
2 changes: 1 addition & 1 deletion dev-infrastructure/templates/dev-acr.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource keyVault 'Microsoft.KeyVault/vaults@2023-07-01' existing = {
}

module acr '../modules/acr/acr.bicep' = {
name: acrName
name: '${deployment().name}-acrName'
params: {
acrName: acrName
location: location
Expand Down
4 changes: 2 additions & 2 deletions dev-infrastructure/templates/region.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ resource regionalZone 'Microsoft.Network/dnsZones@2018-05-01' = {
}

module regionalZoneDelegation '../modules/dns/zone-delegation.bicep' = {
name: 'regional-zone-delegation'
name: '${deployment().name}-zone-deleg'
scope: resourceGroup(baseDNSZoneResourceGroup)
params: {
childZoneName: regionalDNSSubdomain
Expand All @@ -60,7 +60,7 @@ module regionalZoneDelegation '../modules/dns/zone-delegation.bicep' = {
//

module maestroInfra '../modules/maestro/maestro-infra.bicep' = {
name: 'maestro-infra'
name: '${deployment().name}-maestro'
params: {
eventGridNamespaceName: maestroEventGridNamespacesName
location: location
Expand Down
4 changes: 3 additions & 1 deletion istio/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
deploy: deploy-service

deploy-service:
kubectl apply -k overlays/svc

undeploy-service:
kubectl delete -k overlays/svc

.PHONY: deploy-service undeploy-service
.PHONY: deploy deploy-service undeploy-service
5 changes: 4 additions & 1 deletion svc-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ if [[ "$CLUSTER" != "svc" && "$CLUSTER" != "mgmt" ]]; then
exit 1
fi

export KUBECONFIG=$(cd dev-infrastructure ; make $CLUSTER.aks.kubeconfigfile)
echo "getting kubeconfig for $CLUSTER"
export KUBECONFIG=$(cd dev-infrastructure ; make --no-print-directory $CLUSTER.aks.kubeconfigfile)
echo "using kubeconfig: $KUBECONFIG"
echo "contents of kubeconfig $(cat $KUBECONFIG)"

cd $DIR
make deploy

0 comments on commit 8073a54

Please sign in to comment.