Skip to content

Commit 6fb7028

Browse files
authored
Merge pull request secureCodeBox#675 from secureCodeBox/align-auto-discovery-makefile
2 parents 48d0a69 + 91a0f5d commit 6fb7028

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

auto-discovery/kubernetes/Makefile

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5+
IMG_NS ?= securecodebox
6+
57
# Image URL to use all building/pushing image targets
6-
IMG ?= controller:latest
8+
IMG ?= auto-discovery-kubernetes
9+
10+
# Tag used for the image
11+
IMG_TAG ?= sha-$$(git rev-parse --short HEAD)
12+
713
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
814
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
915

@@ -73,13 +79,29 @@ run: manifests generate fmt vet ## Run a controller from your host.
7379
go run ./main.go --config auto-discovery-config.yaml
7480

7581
docker-build: test ## Build docker image with the manager.
76-
docker build -t ${IMG} .
82+
@echo ".: ⚙️ Build Container Images"
83+
docker build -t ${IMG_NS}/${IMG}:${IMG_TAG} .
7784

7885
docker-push: ## Push docker image with the manager.
79-
docker push ${IMG}
86+
docker push ${IMG_NS}/${IMG}:${IMG_TAG}
87+
88+
docker-export:
89+
@echo ".: 💾 Export Container Images"
90+
docker save $(IMG_NS)/$(IMG):$(IMG_TAG) > $(IMG).tar
8091

8192
##@ Deployment
8293

94+
kind-import:
95+
@echo ".: 💾 Importing the image archive to local kind cluster."
96+
kind load image-archive ./$(IMG).tar
97+
98+
helm-deploy:
99+
@echo ".: ⚙️ Deploying auto-discovery with the Image tag '$(IMG_TAG)' into kind."
100+
helm upgrade --install auto-discovery ./ --wait \
101+
--set="image.repository=docker.io/$(IMG_NS)/$(IMG)" \
102+
--set="image.tag=$(IMG_TAG)" \
103+
--set="image.pullPolicy=IfNotPresent" \
104+
83105
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
84106
$(KUSTOMIZE) build config/crd | kubectl apply -f -
85107

0 commit comments

Comments
 (0)