Skip to content

Commit a4aae7b

Browse files
authored
Adjust Helm Makefile (#451)
1 parent ef46f89 commit a4aae7b

File tree

2 files changed

+41
-15
lines changed

2 files changed

+41
-15
lines changed

MAINTAINERS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Maintainer Instructions
22

3+
## Before
4+
5+
To run templating models HELM needs to be installed. We are supporting HELM 2.14+
6+
7+
Helm URL: https://github.com/helm/helm/releases/tag/v2.14.3
8+
9+
You can install HELM in PATH or set HELM path before running make - `export HELM=<path to helm>`
10+
311
## Running tests
412

513
To run the entire test set, first set the following environment variables:

Makefile

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,23 @@ DOCKERFILE := Dockerfile
3131
DOCKERTESTFILE := Dockerfile.test
3232
DOCKERDURATIONTESTFILE := tests/duration/Dockerfile
3333

34+
HELM ?= $(shell which helm)
35+
36+
.PHONY: helm
37+
helm:
38+
ifeq ($(HELM),)
39+
$(error Before templating you need to install helm in PATH or export helm binary using "export HELM=<path to helm>")
40+
endif
41+
42+
HELM_PACKAGE_CMD = $(HELM) package "$(ROOTDIR)/chart/$(CHART_NAME)" \
43+
-d "$(ROOTDIR)/bin/charts" \
44+
--save=false
45+
3446
HELM_CMD = $(HELM) template "$(ROOTDIR)/chart/$(CHART_NAME)" \
3547
--name "$(NAME)" \
3648
--set "operator.image=$(OPERATORIMAGE)" \
3749
--set "operator.imagePullPolicy=Always" \
50+
--set "operator.resources=null" \
3851
--namespace "$(DEPLOYMENTNAMESPACE)"
3952

4053
ifndef LOCALONLY
@@ -203,59 +216,64 @@ endif
203216
.PHONY: manifests-crd
204217
manifests-crd: export CHART_NAME := kube-arangodb-crd
205218
manifests-crd: export NAME := crd
206-
manifests-crd:
219+
manifests-crd: helm
207220
@echo Building manifests for CRD - $(MANIFESTPATHCRD)
208221
@$(HELM_CMD) > "$(MANIFESTPATHCRD)"
209222

210223
.PHONY: manifests-test
211224
manifests-test: export CHART_NAME := kube-arangodb-test
212225
manifests-test: export NAME := arangodb-test
213-
manifests-test:
226+
manifests-test: helm
214227
@echo Building manifests for test - $(MANIFESTPATHTEST)
215228
@$(HELM_CMD) > "$(MANIFESTPATHTEST)"
216229

217230
.PHONY: manifests-operator-deployment
218231
manifests-operator-deployment: export CHART_NAME := kube-arangodb
219232
manifests-operator-deployment: export NAME := deployment
220-
manifests-operator-deployment:
233+
manifests-operator-deployment: helm
221234
@echo Building manifests for Operator Deployment - $(MANIFESTPATHDEPLOYMENT)
222235
@$(HELM_CMD) \
223-
--set "rbac.scope=ClusterRole" \
224236
--set "operator.features.deployment=true" \
225237
--set "operator.features.deploymentReplications=false" \
226-
--set "operator.features.storage=false"> "$(MANIFESTPATHDEPLOYMENT)"
238+
--set "operator.features.storage=false" > "$(MANIFESTPATHDEPLOYMENT)"
227239

228240
.PHONY: manifests-operator-deployment-replication
229241
manifests-operator-deployment-replication: export CHART_NAME := kube-arangodb
230242
manifests-operator-deployment-replication: export NAME := deployment-replication
231-
manifests-operator-deployment-replication:
243+
manifests-operator-deployment-replication: helm
232244
@echo Building manifests for Operator Deployment Replication - $(MANIFESTPATHDEPLOYMENTREPLICATION)
233245
@$(HELM_CMD) \
234-
--set "rbac.scope=ClusterRole" \
235246
--set "operator.features.deployment=false" \
236247
--set "operator.features.deploymentReplications=true" \
237-
--set "operator.features.storage=false"> "$(MANIFESTPATHDEPLOYMENTREPLICATION)"
248+
--set "operator.features.storage=false" > "$(MANIFESTPATHDEPLOYMENTREPLICATION)"
238249

239250
.PHONY: manifests-operator-storage
240251
manifests-operator-storage: export CHART_NAME := kube-arangodb
241252
manifests-operator-storage: export NAME := storage
242-
manifests-operator-storage:
253+
manifests-operator-storage: helm
243254
@echo Building manifests for Operator Storage - $(MANIFESTPATHSTORAGE)
244255
@$(HELM_CMD) \
245-
--set "rbac.scope=ClusterRole" \
246256
--set "operator.features.deployment=false" \
247257
--set "operator.features.deploymentReplications=false" \
248-
--set "operator.features.storage=true"> "$(MANIFESTPATHSTORAGE)"
258+
--set "operator.features.storage=true" > "$(MANIFESTPATHSTORAGE)"
249259

250260
.PHONY: manifests-operator
251261
manifests-operator: manifests-operator-deployment manifests-operator-deployment-replication manifests-operator-storage
252262

253-
.PHONY: manifests
254-
manifests: manifests-crd manifests-operator manifests-test
263+
.PHONY: chart-crd
264+
chart-crd: export CHART_NAME := kube-arangodb-crd
265+
chart-crd: helm
266+
@mkdir -p "$(ROOTDIR)/bin/charts"
267+
@$(HELM_PACKAGE_CMD)
268+
269+
.PHONY: chart-operator
270+
chart-operator: export CHART_NAME := kube-arangodb
271+
chart-operator: helm
255272
@mkdir -p "$(ROOTDIR)/bin/charts"
256-
@$(HELM) package "$(ROOTDIR)/chart/kube-arangodb" -d "$(ROOTDIR)/bin/charts" --save=false
257-
@$(HELM) package "$(ROOTDIR)/chart/kube-arangodb-crd" -d "$(ROOTDIR)/bin/charts" --save=false
273+
@$(HELM_PACKAGE_CMD)
258274

275+
.PHONY: manifests
276+
manifests: helm manifests-crd manifests-operator manifests-test chart-crd chart-operator
259277

260278
# Testing
261279

0 commit comments

Comments
 (0)