@@ -2,7 +2,9 @@ PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
2
2
3
3
# Image URL to use all building/pushing image targets
4
4
TAG ?= latest
5
- CONTROLLER_IMG ?= ghcr.io/timebertt/kubernetes-controller-sharding/webhosting-operator:$(TAG )
5
+ GHCR_REPO ?= ghcr.io/timebertt/kubernetes-controller-sharding
6
+ OPERATOR_IMG ?= $(GHCR_REPO ) /webhosting-operator:$(TAG )
7
+
6
8
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
7
9
ENVTEST_K8S_VERSION = 1.24
8
10
# set OVERLAY to shoot to configure ingress-nginx with public dns and a TLS certificate
@@ -101,13 +103,12 @@ build: generate fmt vet ## Build manager binary.
101
103
run : manifests generate fmt vet # # Run the webhosting-operator from your host.
102
104
go run ./cmd/webhosting-operator
103
105
104
- .PHONY : docker-build
105
- docker-build : test # # Build docker image with the manager.
106
- docker build -t $(CONTROLLER_IMG ) --target webhosting-operator .
106
+ PUSH ?= false
107
+ images : export KO_DOCKER_REPO = $(GHCR_REPO )
107
108
108
- .PHONY : docker-push
109
- docker-push : # # Push docker image with the manager .
110
- docker push $( CONTROLLER_IMG )
109
+ .PHONY : images
110
+ images : $( KO ) # # Build and push container images using ko .
111
+ $( KO ) build -- push= $( PUSH ) --sbom none --base-import-paths -t $( TAG ) --platform linux/amd64,linux/arm64 ./cmd/webhosting-operator
111
112
112
113
# #@ Deployment
113
114
@@ -136,7 +137,7 @@ up dev down: export SKAFFOLD_LABEL = skaffold.dev/run-id=webhosting-operator
136
137
137
138
.PHONY : deploy
138
139
deploy : $(SKAFFOLD ) # # Build all images and deploy everything to K8s cluster specified in $KUBECONFIG.
139
- $(SKAFFOLD ) deploy --port-forward=user --tail -i $(CONTROLLER_IMG )
140
+ $(SKAFFOLD ) deploy --port-forward=user --tail -i $(OPERATOR_IMG )
140
141
141
142
.PHONY : up
142
143
up : $(SKAFFOLD ) # # Build all images, deploy everything to K8s cluster specified in $KUBECONFIG, start port-forward and tail logs.
0 commit comments