|
2 | 2 | # |
3 | 3 | # SPDX-License-Identifier: Apache-2.0 |
4 | 4 |
|
| 5 | +IMG_NS ?= securecodebox |
| 6 | + |
5 | 7 | # 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 | + |
7 | 13 | # Produce CRDs that work back to Kubernetes 1.11 (no version conversion) |
8 | 14 | CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false" |
9 | 15 |
|
@@ -73,13 +79,29 @@ run: manifests generate fmt vet ## Run a controller from your host. |
73 | 79 | go run ./main.go --config auto-discovery-config.yaml |
74 | 80 |
|
75 | 81 | 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} . |
77 | 84 |
|
78 | 85 | 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 |
80 | 91 |
|
81 | 92 | ##@ Deployment |
82 | 93 |
|
| 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 | + |
83 | 105 | install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. |
84 | 106 | $(KUSTOMIZE) build config/crd | kubectl apply -f - |
85 | 107 |
|
|
0 commit comments