Skip to content

Commit bf2c45a

Browse files
committed
Makefile: update deploy/delete to use Helm charts
The `make deploy` and `make delete` targets now: - Use helm install/uninstall instead of kubectl apply/delete - Support WEBHOOK_ENABLED variable (default: true) to enable/disable webhook - Install cert-manager automatically if webhook is enabled - Use development mode (Option A) from Helm chart README - Support separate enable/disable of webhook and resourceCtrl components Assisted-by: Cursor Signed-off-by: Wainer dos Santos Moschetta <[email protected]>
1 parent 2124f21 commit bf2c45a

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

src/cloud-api-adaptor/Makefile

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ TEST_E2E_TIMEOUT ?= 60m
2323
RUN_TESTS ?= ''
2424

2525
RESOURCE_CTRL ?= true
26+
WEBHOOK_ENABLED ?= true
2627
# BUILTIN_CLOUD_PROVIDERS is used for binary build -- what providers are built in the binaries.
2728
ifeq ($(RELEASE_BUILD),true)
2829
BUILTIN_CLOUD_PROVIDERS ?= alibabacloud aws azure gcp ibmcloud ibmcloud_powervs
@@ -126,39 +127,34 @@ image-with-arch: .git-commit ## Build the per arch image
126127
##@ Deployment
127128

128129
.PHONY: deploy
129-
deploy: ## Deploy cloud-api-adaptor using the operator, according to install/overlays/$(CLOUD_PROVIDER)/kustomization.yaml file.
130+
deploy: ## Deploy cloud-api-adaptor using Helm charts. Assumes provider secrets file exists at install/charts/peerpods/providers/$(CLOUD_PROVIDER)-secrets.yaml
130131
ifneq ($(CLOUD_PROVIDER),)
131-
kubectl apply -k "$(COCO_OPERATOR_REPO)/config/$(COCO_OPERATOR_CONFIG)?ref=$(COCO_OPERATOR_REF)"
132-
kubectl apply -k "$(COCO_OPERATOR_REPO)/config/samples/ccruntime/peer-pods?ref=$(COCO_OPERATOR_REF)"
133-
kubectl apply -k install/overlays/$(CLOUD_PROVIDER)
134-
else
135-
$(error CLOUD_PROVIDER is not set)
132+
$(eval HELM_VALUES_FILES := install/charts/peerpods/providers/$(CLOUD_PROVIDER).yaml)
133+
ifeq ($(filter $(CLOUD_PROVIDER),docker libvirt),)
134+
$(eval HELM_VALUES_FILES := $(HELM_VALUES_FILES) install/charts/peerpods/providers/$(CLOUD_PROVIDER)-secrets.yaml)
136135
endif
137-
ifeq ($(RESOURCE_CTRL),true)
138-
$(MAKE) -C ../peerpod-ctrl deploy
139-
@if kubectl get svc -n cert-manager cert-manager-webhook > /dev/null 2>&1; then \
140-
echo "Installing webhook" ;\
141-
$(MAKE) -C ../webhook deploy ;\
142-
else \
136+
137+
ifeq ($(WEBHOOK_ENABLED),true)
138+
@if ! kubectl get svc -n cert-manager cert-manager-webhook > /dev/null 2>&1; then \
143139
echo "Installing cert-manager" ;\
144140
$(MAKE) -C ../webhook deploy-cert-manager ;\
145-
echo "Installing webhook" ;\
146-
$(MAKE) -C ../webhook deploy ;\
147141
fi
148142
endif
149-
150-
.PHONY: delete
151-
delete: ## Delete cloud-api-adaptor using the operator, according to install/overlays/$(CLOUD_PROVIDER)/kustomization.yaml file.
152-
ifeq ($(RESOURCE_CTRL),true)
153-
$(MAKE) -C ../peerpod-ctrl undeploy
154-
$(MAKE) -C ../webhook undeploy
155-
endif
156-
ifneq ($(CLOUD_PROVIDER),)
157-
kubectl delete -k install/overlays/$(CLOUD_PROVIDER)
143+
helm install peerpods install/charts/peerpods \
144+
$(foreach file,$(HELM_VALUES_FILES),-f $(file)) \
145+
--set webhook.enabled=$(WEBHOOK_ENABLED) \
146+
--set resourceCtrl.enabled=$(RESOURCE_CTRL) \
147+
--dependency-update \
148+
-n confidential-containers-system \
149+
--create-namespace
158150
else
159151
$(error CLOUD_PROVIDER is not set)
160152
endif
161153

154+
.PHONY: delete
155+
delete: ## Delete cloud-api-adaptor using Helm charts.
156+
helm uninstall peerpods -n confidential-containers-system
157+
162158
### PODVM IMAGE BUILDING ###
163159

164160
REGISTRY ?= quay.io/confidential-containers

0 commit comments

Comments
 (0)