Skip to content

Commit

Permalink
RP pipelines
Browse files Browse the repository at this point in the history
pipeline definition for infra + RP

https://issues.redhat.com/browse/ARO-12212
  • Loading branch information
geoberle committed Nov 19, 2024
1 parent ebf5a91 commit ca0a04c
Show file tree
Hide file tree
Showing 22 changed files with 898 additions and 150 deletions.
27 changes: 2 additions & 25 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ SHELL = /bin/bash
DEPLOY_ENV ?= personal-dev
$(shell ../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk)
include config.mk

COMMIT = $(shell git rev-parse --short=7 HEAD)
ARO_HCP_BASE_IMAGE ?= ${ARO_HCP_IMAGE_ACR}.azurecr.io
ARO_HCP_BACKEND_IMAGE ?= $(ARO_HCP_BASE_IMAGE)/arohcpbackend:$(COMMIT)
include Makefile.deploy

backend:
go build -o aro-hcp-backend .
Expand All @@ -26,27 +23,7 @@ push: image
az acr login --name ${ARO_HCP_IMAGE_ACR}
docker push ${ARO_HCP_BACKEND_IMAGE}

deploy:
BACKEND_MI_CLIENT_ID=$(shell az identity show \
-g ${RESOURCEGROUP} \
-n backend \
--query clientId);\
ISTO_VERSION=$(shell az aks show -n ${AKS_NAME} -g ${RESOURCEGROUP} --query serviceMeshProfile.istio.revisions[-1] -o tsv) && \
DB_URL=$(shell az cosmosdb show -n ${DB_NAME} -g ${RESOURCEGROUP} --query documentEndpoint -o tsv) && \
kubectl create namespace aro-hcp --dry-run=client -o json | kubectl apply -f - && \
kubectl label namespace aro-hcp "istio.io/rev=$${ISTO_VERSION}" --overwrite=true && \
helm upgrade --install aro-hcp-backend-dev \
deploy/helm/backend/ \
--set configMap.databaseName=${DB_NAME} \
--set configMap.databaseUrl="$${DB_URL}" \
--set configMap.backendMiClientId="$${BACKEND_MI_CLIENT_ID}" \
--set serviceAccount.workloadIdentityClientId="$${BACKEND_MI_CLIENT_ID}" \
--set configMap.currentVersion=${ARO_HCP_BACKEND_IMAGE} \
--set configMap.location=${LOCATION} \
--set deployment.imageName=${ARO_HCP_BACKEND_IMAGE} \
--namespace aro-hcp

undeploy:
helm uninstall aro-hcp-backend-dev --namespace aro-hcp

.PHONY: backend run clean image push deploy undeploy
.PHONY: backend run clean image push undeploy
21 changes: 21 additions & 0 deletions backend/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
serviceGroup: Microsoft.Azure.ARO.Test
rolloutName: RP - Backend
resourceGroups:
- name: {{ .svc.rg }}
subscription: {{ .svc.subscription }}
aksCluster: {{ .aksName }}
steps:
- name: deploy
action: Shell
command: ["/bin/bash", "-c", "make -f Makefile.deploy deploy"]
env:
- name: ARO_HCP_IMAGE_ACR
configRef: svcAcrName
- name: LOCATION
configRef: region
- name: RESOURCEGROUP
configRef: svc.rg
- name: AKS_NAME
configRef: aksName
- name: DB_NAME
configRef: frontend.cosmosDB.name
5 changes: 2 additions & 3 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ clouds:
# this configuration serves as a template for for all RH DEV subscription deployments
# the following vars need approprivate overrides:
defaults:
# Subscription
serviceClusterSubscription: ARO Hosted Control Planes (EA Subscription 1)
managementClusterSubscription: ARO Hosted Control Planes (EA Subscription 1)
# DNS
baseDnsZoneName: 'hcp.osadev.cloud'
# 1P app
Expand Down Expand Up @@ -148,9 +145,11 @@ clouds:
private: false
# disable soft delete on etcd KVs in DEV
svc:
subscription: ARO Hosted Control Planes (EA Subscription 1)
etcd:
kvSoftDelete: false
mgmt:
subscription: ARO Hosted Control Planes (EA Subscription 1)
# MGMTM AKS nodepools - big enough for 2 HCPs
systemAgentPool:
minCount: 1
Expand Down
10 changes: 10 additions & 0 deletions dev-infrastructure/metrics-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
serviceGroup: Microsoft.Azure.ARO.Test
rolloutName: Metrics Rollout
resourceGroups:
- name: {{ .regionRG }}
subscription: {{ .serviceClusterSubscription }}
steps:
- name: region
action: ARM
template: modules/modules/metrics.bicep
parameters: configurations/metrics.tmpl.bicepparam
10 changes: 10 additions & 0 deletions dev-infrastructure/region-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
serviceGroup: Microsoft.Azure.ARO.Test
rolloutName: Region Rollout
resourceGroups:
- name: {{ .regionRG }}
subscription: {{ .serviceClusterSubscription }}
steps:
- name: region
action: ARM
template: templates/region.bicep
parameters: configurations/region.tmpl.bicepparam
25 changes: 25 additions & 0 deletions dev-infrastructure/svc-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
serviceGroup: Microsoft.Azure.ARO.Test
rolloutName: Service Cluster Rollout
resourceGroups:
- name: {{ .serviceClusterRG }}
subscription: {{ .serviceClusterSubscription }}
aksCluster: {{ .aksName }}
steps:
- name: svc
action: ARM
template: templates/svc-cluster.bicep
parameters: configurations/svc-cluster.tmpl.bicepparam
- name: enable-metrics
action: Shell
command: ["/bin/bash", "-c", "scripts/enable-aks-metrics.sh"]
env:
- name: RESOURCEGROUP
configRef: serviceClusterRG
- name: AKS_NAME
configRef: aksName
- name: GRAFANA_RESOURCEGROUP
configRef: regionRG
- name: MONITORING_WORKSPACE_NAME
configRef: monitoringWorkspaceName
- name: GRAFANA_NAME
configRef: grafanaName
3 changes: 0 additions & 3 deletions frontend/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
SHELL = /bin/bash
DEPLOY_ENV ?= personal-dev
$(shell ../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk)
include config.mk

COMMIT = $(shell git rev-parse --short=7 HEAD)
ARO_HCP_BASE_IMAGE ?= ${ARO_HCP_IMAGE_ACR}.azurecr.io
Expand Down
21 changes: 21 additions & 0 deletions frontend/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
serviceGroup: Microsoft.Azure.ARO.Test
rolloutName: RP - Frontend
resourceGroups:
- name: {{ .serviceClusterRG }}
subscription: {{ .serviceClusterSubscription }}
aksCluster: {{ .aksName }}
steps:
- name: deploy
action: Shell
command: ["/bin/bash", "-c", "make deploy"]
env:
- name: ARO_HCP_IMAGE_ACR
configRef: svcAcrName
- name: LOCATION
configRef: region
- name: RESOURCEGROUP
configRef: serviceClusterRG
- name: AKS_NAME
configRef: aksName
- name: DB_NAME
configRef: frontendCosmosDBName
Loading

0 comments on commit ca0a04c

Please sign in to comment.