Skip to content

Commit 3287078

Browse files
Add opstool environment for SRE tooling AKS cluster
1 parent 4db1389 commit 3287078

File tree

9 files changed

+130
-8
lines changed

9 files changed

+130
-8
lines changed

.github/workflows/aro-hcp-cd.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ on:
3737
- 'image-sync/**/'
3838
- 'tooling/templatize/**'
3939
- 'config/*'
40+
- 'topology-opstool.yaml'
4041
types:
4142
- closed
4243
concurrency:
@@ -157,3 +158,15 @@ jobs:
157158
with:
158159
deploy_env: cspr
159160
deploy_cs_pr_check_deps: true
161+
deploy_opstool_environment_infra:
162+
name: 'Deploy opstool infrastructure'
163+
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch'
164+
needs:
165+
- deploy_global_rg
166+
permissions:
167+
id-token: 'write'
168+
contents: 'read'
169+
secrets: inherit
170+
uses: ./.github/workflows/environment-infra-cd.yml
171+
with:
172+
deploy_env: opstool

.github/workflows/environment-infra-cd.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ jobs:
119119
az config set bicep.use_binary_from_path=false
120120
az bicep install
121121
cd dev-infrastructure/
122+
if [ "${{ inputs.deploy_env }}" = "opstool" ]; then
123+
export TOPOLOGY_CONFIG=topology-opstool.yaml
124+
fi
122125
PRINCIPAL_ID=${{ secrets.GHA_PRINCIPAL_ID }} make svc
123126
- name: 'Az CLI login again'
124127
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,12 @@ PERSIST ?= "false"
356356
TIMING_OUTPUT ?= timing/steps.yaml
357357
ENTRYPOINT_JUNIT_OUTPUT ?= _artifacts/junit_entrypoint.xml
358358

359+
TOPOLOGY_CONFIG ?= topology.yaml
360+
359361
local-run: $(TEMPLATIZE)
360362
$(TEMPLATIZE) entrypoint run --config-file "${CONFIG_FILE}" \
361363
--config-file-override "${OVERRIDE_CONFIG_FILE}" \
362-
--topology-config topology.yaml \
364+
--topology-config $(TOPOLOGY_CONFIG) \
363365
--dev-settings-file tooling/templatize/settings.yaml \
364366
--dev-environment $(DEPLOY_ENV) \
365367
$(WHAT) $(EXTRA_ARGS) \

config/config.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,42 @@ clouds:
11801180
svc:
11811181
subscription:
11821182
key: ARO HCP nightly service (EA Subscription)
1183+
opstool:
1184+
# this is an environment for SRE tooling AKS cluster
1185+
defaults:
1186+
regionRG: "{{ .ctx.region }}-shared-resources"
1187+
serviceKeyVault:
1188+
name: "arohcp{{ .ctx.environment }}-svc-{{ .ctx.regionShort }}" # [globally-unique]
1189+
rg: "{{ .ctx.region }}-shared-resources"
1190+
region: "{{ .ctx.region }}"
1191+
softDelete: false
1192+
monitoring:
1193+
svcWorkspaceName: 'aro-hcp-{{ .ctx.environment }}-svc-{{ .ctx.regionShort }}'
1194+
# DNS
1195+
dns:
1196+
regionalSubdomain: '{{ .ctx.regionShort }}-{{ .ctx.environment }}'
1197+
frontend:
1198+
cosmosDB:
1199+
deploy: false
1200+
clustersService:
1201+
postgres:
1202+
deploy: false
1203+
maestro:
1204+
eventGrid:
1205+
name: "arohcp-{{ .ctx.environment }}-maestro-{{ .ctx.regionShort }}"
1206+
maxClientSessionsPerAuthName: 6
1207+
private: false
1208+
certIssuer: OneCertV2-PrivateCA
1209+
postgres:
1210+
deploy: false
1211+
adminApi:
1212+
managedIdentityName: admin-api
1213+
k8s:
1214+
namespace: aro-hcp
1215+
serviceAccountName: admin-api
1216+
cert:
1217+
name: admin-api-cert-{{ .ctx.environment }}-{{ .ctx.regionShort }}
1218+
issuer: Self
11831219
pers:
11841220
# Regional overrides
11851221
regions:

config/dev.digests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ clouds:
1010
ntly:
1111
regions:
1212
uksouth: 97fc3fe690f8c37aa2435ad84e840aaabd7b3728346d9468961f29db32bee887
13+
opstool:
14+
regions:
15+
uksouth: aa554e097384d03595b471ca2161acadcdb01362b5c0bbd7215a40146f99ab74
1316
perf:
1417
regions:
1518
westus3: dbcc359647553e4925da830e947ce33dc2a6d20dd4e86938448433d6ca467e5c

dev-infrastructure/templates/svc-cluster.bicep

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ module rpCosmosDb '../modules/rp-cosmos.bicep' = if (deployFrontendCosmos) {
627627
}
628628
}
629629

630-
module rpCosmosdbPrivateEndpoint '../modules/private-endpoint.bicep' = {
630+
module rpCosmosdbPrivateEndpoint '../modules/private-endpoint.bicep' = if (deployFrontendCosmos) {
631631
name: 'rp-pe-${uniqueString(deployment().name)}'
632632
params: {
633633
location: location
@@ -983,17 +983,23 @@ module svcNSP '../modules/network/nsp.bicep' = {
983983
}
984984
}
985985

986+
var nspAssociatedResources = deployFrontendCosmos
987+
? [
988+
svcCluster.outputs.etcKeyVaultId
989+
rpCosmosDb.outputs.cosmosDBAccountId
990+
]
991+
: [
992+
svcCluster.outputs.etcKeyVaultId
993+
]
994+
986995
module svcClusterNSPProfile '../modules/network/nsp-profile.bicep' = {
987996
name: 'profile-${uniqueString(resourceGroup().name)}'
988997
params: {
989998
accessMode: svcNSPAccessMode
990999
nspName: svcNSPName
9911000
profileName: svcNSPName
9921001
location: location
993-
associatedResources: [
994-
svcCluster.outputs.etcKeyVaultId
995-
rpCosmosDb.outputs.cosmosDBAccountId
996-
]
1002+
associatedResources: nspAssociatedResources
9971003
// TODO Add EV2 access here
9981004
subscriptions: [
9991005
subscription().id

templatize.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,24 @@ elif [ $PIPELINE_MODE == "inspect" ] && [ -n "${SERVICE_GROUP+x}" ] && [ -n "${P
108108
${LOG_VERBOSITY_OPTION} \
109109
--format makefile
110110
elif [ $PIPELINE_MODE == "run" ] && [ -n "${SERVICE_GROUP+x}" ] && [ -n "${PIPELINE_STEP+x}" ]; then
111+
TOPOLOGY_FILE="${TOPOLOGY_FILE:-${PROJECT_ROOT_DIR}/topology.yaml}"
111112
$TEMPLATIZE pipeline run \
112113
--config-file="${CONFIG_FILE}" \
113114
--dev-settings-file="${PROJECT_ROOT_DIR}/tooling/templatize/settings.yaml" \
114115
--dev-environment="${DEPLOY_ENV}" "${REGION:+"--region=${REGION}"}" \
115-
--topology-file="${PROJECT_ROOT_DIR}/topology.yaml" \
116+
--topology-file="${TOPOLOGY_FILE}" \
116117
--service-group="${SERVICE_GROUP}" \
117118
--step="${PIPELINE_STEP}" \
118119
${PERSIST_FLAG} \
119120
${LOG_VERBOSITY_OPTION} \
120121
${DRY_RUN}
121122
elif [ $PIPELINE_MODE == "run" ] && [ -n "${SERVICE_GROUP+x}" ]; then
123+
TOPOLOGY_FILE="${TOPOLOGY_FILE:-${PROJECT_ROOT_DIR}/topology.yaml}"
122124
$TEMPLATIZE pipeline run \
123125
--config-file="${CONFIG_FILE}" \
124126
--dev-settings-file="${PROJECT_ROOT_DIR}/tooling/templatize/settings.yaml" \
125127
--dev-environment="${DEPLOY_ENV}" "${REGION:+"--region=${REGION}"}" \
126-
--topology-file="${PROJECT_ROOT_DIR}/topology.yaml" \
128+
--topology-file="${TOPOLOGY_FILE}" \
127129
--service-group="${SERVICE_GROUP}" \
128130
${PERSIST_FLAG} \
129131
${LOG_VERBOSITY_OPTION} \

tooling/templatize/settings.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,12 @@ environments:
6464
ev2Cloud: public
6565
cxStamp: 1
6666
regionShortSuffix: "s${USER:0:4}"
67+
- name: opstool
68+
description: |
69+
Used for SRE tooling AKS cluster deployment.
70+
defaults:
71+
region: uksouth
72+
cloud: dev
73+
ev2Cloud: public
74+
cxStamp: 1
75+
regionShortSuffix: "t"

topology-opstool.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
entrypoints:
2+
- identifier: 'Microsoft.Azure.ARO.HCP.Global'
3+
metadata:
4+
name: Global
5+
scopeDoc: high-level-architecture.md
6+
incremental: "true"
7+
- identifier: 'Microsoft.Azure.ARO.HCP.Region'
8+
metadata:
9+
name: Region
10+
scopeDoc: high-level-architecture.md#regional-scope
11+
- identifier: 'Microsoft.Azure.ARO.HCP.Service.Infra'
12+
metadata:
13+
name: Service Cluster
14+
scopeDoc: high-level-architecture.md#service-cluster
15+
services:
16+
- serviceGroup: Microsoft.Azure.ARO.HCP.Global
17+
children:
18+
- serviceGroup: Microsoft.Azure.ARO.HCP.Region
19+
children:
20+
- serviceGroup: Microsoft.Azure.ARO.HCP.Service.Infra
21+
children:
22+
pipelinePath: dev-infrastructure/svc-pipeline.yaml
23+
purpose: Deploy the service cluster and supporting infrastructure.
24+
- serviceGroup: Microsoft.Azure.ARO.HCP.Monitoring
25+
pipelinePath: dev-infrastructure/monitoring-pipeline.yaml
26+
purpose: Deploy the Monitoring resources
27+
pipelinePath: dev-infrastructure/region-pipeline.yaml
28+
purpose: Deploy regional shared infrastructure.
29+
pipelinePath: dev-infrastructure/global-pipeline.yaml
30+
purpose: Deploy global shared infrastructure.
31+
# Cleanup pipelines
32+
- serviceGroup: Microsoft.Azure.ARO.HCP.Service.Delete
33+
pipelinePath: dev-infrastructure/cleanup/delete.svc.pipeline.yaml
34+
purpose: Delete the service resources and service resource group
35+
- serviceGroup: Microsoft.Azure.ARO.HCP.Region.Delete
36+
pipelinePath: dev-infrastructure/cleanup/delete.region.pipeline.yaml
37+
purpose: Delete the region resources and resource group
38+
# Dev-only pipelines
39+
- serviceGroup: Microsoft.Azure.ARO.HCP.Observability
40+
pipelinePath: observability/tracing/pipeline.yaml
41+
purpose: Deploy the development tracing stack.
42+
# Kusto Infra pipeline
43+
- serviceGroup: Microsoft.Azure.ARO.HCP.Log.Infra
44+
pipelinePath: dev-infrastructure/kusto-pipeline.yaml
45+
purpose: Deploy the kusto log infrastructure.
46+
- serviceGroup: Microsoft.Azure.ARO.HCP.Service.Kubeconfig
47+
pipelinePath: dev-infrastructure/svc-kubeconfig.yaml
48+
purpose: Grant access to AKS SVC AKS Clusters, mainly intended for E2E test setup.

0 commit comments

Comments
 (0)