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 Hypershift Operator #1057

Merged
merged 6 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/workflows/services-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@

- name: 'Deploy Hypershift Operator and External DNS Operator'
run: |
make hypershiftoperator.deploy
make hypershiftoperator.deploy_pipeline
6 changes: 5 additions & 1 deletion .github/workflows/services-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@
run: |
make frontend.dry_run

- name: 'Dry Maestro Server'
- name: 'Dry Run Maestro Server'
run: |
make maestro.server.dry_run

- name: 'Dry Run HypershiftOperator'
run: |
make hypershiftoperator.dry_run
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ infra.clean:
# Services deployed on "svc" aks cluster
services_svc = istio metrics maestro.registration
# Services deployed on "mgmt" aks cluster(s)
services_mgmt = acm maestro.agent pko hypershiftoperator
services_mgmt = acm maestro.agent pko
# List of all services
services_all = $(join services_svc,services_mgmt)

Expand All @@ -125,6 +125,7 @@ services_all = $(join services_svc,services_mgmt)
# 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 cluster-service maestro.server
services_mgmt_pipelines = hypershiftoperator
%.deploy_pipeline:
$(eval export dirname=$(subst .,/,$(basename $@)))
./templatize.sh $(DEPLOY_ENV) -p ./$(dirname)/pipeline.yaml -s deploy -P run -c public
Expand All @@ -134,7 +135,7 @@ services_svc_pipelines = backend frontend cluster-service maestro.server
./templatize.sh $(DEPLOY_ENV) -p ./$(dirname)/pipeline.yaml -s deploy -P run -c public -d

svc.deployall: $(addsuffix .deploy, $(services_svc)) $(addsuffix .deploy_pipeline, $(services_svc_pipelines))
mgmt.deployall: $(addsuffix .deploy, $(services_mgmt))
mgmt.deployall: $(addsuffix .deploy, $(services_mgmt)) $(addsuffix .deploy_pipeline, $(services_mgmt_pipelines))
deployall: svc.deployall mgmt.deployall

listall:
Expand Down
15 changes: 7 additions & 8 deletions hypershiftoperator/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
SHELL := /bin/bash
DEPLOY_ENV ?= personal-dev
$(shell ../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk)
include config.mk
-include ../setup-env.mk
-include ../helm-cmd.mk
HELM_CMD ?= helm upgrade --install

deploy:
@AZURE_TENANT_ID=$(shell az account show --query tenantId --output tsv) && \
AZURE_SUBSCRIPTION_ID=$(shell az account show --query id --output tsv) && \
CSI_SECRET_STORE_CLIENT_ID=$(shell az aks show -n ${AKS_NAME} -g ${RESOURCEGROUP} --query 'addonProfiles.azureKeyvaultSecretsProvider.identity.clientId' -o tsv) && \
helm upgrade --install hypershift deploy/helm \
--create-namespace --namespace ${HYPERSHIFT_NAMESPACE} \
--set image=${HO_IMAGE_BASE} \
${HELM_CMD} hypershift deploy/helm \
--namespace ${HYPERSHIFT_NAMESPACE} \
--set image=${ARO_HCP_SVC_ACR}.azurecr.io/acm-d/rhtap-hypershift-operator \
--set imageTag=${HO_IMAGE_TAG} \
--set registryOverrides="quay.io/openshift-release-dev/ocp-v4.0-art-dev=${ARO_HCP_OCP_ACR}.azurecr.io/openshift/release\,quay.io/openshift-release-dev/ocp-release=${ARO_HCP_OCP_ACR}.azurecr.io/openshift/release-images\,registry.redhat.io/redhat=${ARO_HCP_OCP_ACR}.azurecr.io/redhat" \
--set additionalArgs="${HO_ADDITIONAL_INSTALL_ARG}" \
--set azureKeyVaultClientId=$${CSI_SECRET_STORE_CLIENT_ID}

.PHONY: helm-chart deploy
.PHONY: deploy
14 changes: 0 additions & 14 deletions hypershiftoperator/config.tmpl.mk

This file was deleted.

30 changes: 30 additions & 0 deletions hypershiftoperator/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$schema: "pipeline.schema.v1"
serviceGroup: Microsoft.Azure.ARO.HCP.RP.HypershiftOperator
rolloutName: RP HypershiftOperator Rollout
resourceGroups:
- name: {{ .mgmt.rg }}
subscription: {{ .svc.subscription }}
aksCluster: {{ .aksName }}
steps:
- name: deploy
action: Shell
command: make deploy
dryRun:
variables:
- name: DRY_RUN
value: "true"
variables:
- name: ARO_HCP_SVC_ACR
configRef: svcAcrName
- name: ARO_HCP_OCP_ACR
configRef: ocpAcrName
- name: HO_IMAGE_TAG
configRef: hypershiftOperator.imageTag
- name: RESOURCEGROUP
configRef: mgmt.rg
- name: AKS_NAME
configRef: aksName
- name: HYPERSHIFT_NAMESPACE
configRef: hypershift.namespace
- name: HO_ADDITIONAL_INSTALL_ARG
configRef: hypershift.additionalInstallArg
Loading