@@ -34,6 +34,7 @@ export GO111MODULE=on
3434ROOT_DIR: =$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST ) ) ) )
3535TOOLS_DIR := hack/tools
3636TOOLS_BIN_DIR := $(TOOLS_DIR ) /bin
37+ TEMPLATES_DIR := $(ROOT_DIR ) /templates
3738BIN_DIR := bin
3839RELEASE_NOTES_BIN := bin/release-notes
3940
@@ -69,6 +70,8 @@ RBAC_ROOT ?= $(MANIFEST_ROOT)/rbac
6970# Allow overriding the imagePullPolicy
7071PULL_POLICY ?= Always
7172
73+ CLUSTER_TEMPLATE ?= cluster-template.yaml
74+
7275# # --------------------------------------
7376# # Help
7477# # --------------------------------------
@@ -165,6 +168,7 @@ modules: ## Runs go mod to ensure proper vendoring.
165168generate : # # Generate code
166169 $(MAKE ) generate-go
167170 $(MAKE ) generate-manifests
171+ $(MAKE ) generate-flavors
168172
169173.PHONY : generate-go
170174generate-go : $(CONTROLLER_GEN ) $(MOCKGEN ) $(CONVERSION_GEN ) # # Runs Go related generate targets
@@ -191,6 +195,10 @@ generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
191195 output:rbac:dir=$(RBAC_ROOT ) \
192196 rbac:roleName=manager-role
193197
198+ .PHONY : generate-flavors # # Generate template flavors
199+ generate-flavors : $(KUSTOMIZE )
200+ ./hack/gen-flavors.sh
201+
194202# # --------------------------------------
195203# # Docker
196204# # --------------------------------------
@@ -260,11 +268,16 @@ release: clean-release ## Builds and push container images using the latest git
260268 $(MAKE ) set-manifest-image MANIFEST_IMG=$(PROD_REGISTRY ) /$(IMAGE_NAME ) MANIFEST_TAG=$(RELEASE_TAG )
261269 $(MAKE ) set-manifest-pull-policy PULL_POLICY=IfNotPresent
262270 $(MAKE ) release-manifests
271+ $(MAKE ) release-templates
263272
264273.PHONY : release-manifests
265274release-manifests : $(KUSTOMIZE ) $(RELEASE_DIR ) # # Builds the manifests to publish with a release
266275 kustomize build config > $(RELEASE_DIR ) /infrastructure-components.yaml
267276
277+ .PHONY : release-templates
278+ release-templates : $(RELEASE_DIR )
279+ cp templates/cluster-template* $(RELEASE_DIR ) /
280+
268281.PHONY : release-binary
269282release-binary : $(RELEASE_DIR )
270283 docker run \
@@ -327,7 +340,7 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST)
327340.PHONY : create-workload-cluster
328341create-workload-cluster : $(KUSTOMIZE ) $(ENVSUBST )
329342 # Create workload Cluster.
330- $(KUSTOMIZE ) build templates | $( ENVSUBST ) | kubectl apply -f -
343+ $(ENVSUBST ) < $( TEMPLATES_DIR ) / $( CLUSTER_TEMPLATE ) | kubectl apply -f -
331344
332345 # Wait for the kubeconfig to become available.
333346 timeout 300 bash -c "while ! kubectl get secrets | grep $(CLUSTER_NAME)-kubeconfig; do sleep 1; done"
0 commit comments