Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dry run for Cluster service #1037

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/services-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,20 @@
run: |
helm plugin install https://github.com/databus23/helm-diff
- name: 'Deploy Frontend'
- name: 'Dry Run Cluster Service'
env:
PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }}
run: |
make frontend.dry_run
make cluster-service.dry_run
- name: 'Deploy Backend'
- name: 'Dry Run Backend'
env:
PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }}
run: |
make backend.dry_run
- name: 'Dry Run Frontend'
env:
PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }}
run: |
make frontend.dry_run
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ infra.clean:
# separator "/" (used for maestro only).

# Services deployed on "svc" aks cluster
services_svc = istio metrics maestro.server maestro.registration cluster-service
services_svc = istio metrics maestro.server maestro.registration
# Services deployed on "mgmt" aks cluster(s)
services_mgmt = acm maestro.agent pko hypershiftoperator
# List of all services
Expand All @@ -124,7 +124,7 @@ services_all = $(join services_svc,services_mgmt)
# Pipelines section
# This sections is used to reference pipeline runs and should replace
# the usage of `svc-deploh.sh` script in the future.
services_svc_pipelines = backend frontend
services_svc_pipelines = backend frontend cluster-service
%.deploy:
$(eval export dirname=$(subst .,/,$(basename $@)))
./templatize.sh $(DEPLOY_ENV) -p ./$(dirname)/pipeline.yaml -s deploy -P run -c public
Expand Down
4 changes: 3 additions & 1 deletion cluster-service/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-include ../setup-env.mk
-include ../helm-cmd.mk
HELM_CMD ?= helm upgrade --install

ZONE_NAME ?= "${REGIONAL_DNS_SUBDOMAIN}.${BASE_DNS_ZONE_NAME}"

Expand All @@ -22,7 +24,7 @@ deploy: provision-shard
OP_FILE_CSI_DRIVER_ROLE_ID=$(shell az role definition list --name "${OP_FILE_CSI_DRIVER_ROLE_NAME}" --query "[].name" -o tsv) && \
OP_IMAGE_REGISTRY_DRIVER_ROLE_ID=$(shell az role definition list --name "${OP_IMAGE_REGISTRY_DRIVER_ROLE_NAME}" --query "[].name" -o tsv) && \
OP_CLOUD_NETWORK_CONFIG_ROLE_ID=$(shell az role definition list --name "${OP_CLOUD_NETWORK_CONFIG_ROLE_NAME}" --query "[].name" -o tsv) && \
helm upgrade --install --wait ${HELM_DRY_RUN} cluster-service deploy/helm \
${HELM_CMD} cluster-service deploy/helm \
--namespace cluster-service \
-f deploy/helm/$${OVERRIDES} \
--set azureCsMiClientId=$${AZURE_CS_MI_CLIENT_ID} \
Expand Down
6 changes: 2 additions & 4 deletions cluster-service/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ resourceGroups:
command: make deploy
dryRun:
variables:
- name: HELM_DRY_RUN
value: "--dry-run=server --debug"
- name: KUBECTL_DRY_RUN
value: "--dry-run=server"
- name: DRY_RUN
value: "true"
variables:
- name: REGION
configRef: region
Expand Down
1 change: 1 addition & 0 deletions tooling/templatize/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func main() {

if err := cmd.Execute(); err != nil {
logger.Error(err, "command failed")
os.Exit(1)
}
}

Expand Down
Loading