Skip to content

Commit

Permalink
enh: Add common commands for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
sircthulhu committed Mar 29, 2024
1 parent 2f64d81 commit b0a14f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Image URL to use all building/pushing image targets
IMG ?= controller:latest
IMG ?= ghcr.io/aenix-io/etcd-operator:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.29.0

Expand Down Expand Up @@ -148,6 +148,20 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

# Build and upload docker image to the local Kind cluster
.PHONY: docker-load
docker-load: docker-build
kind load docker-image ${IMG}

# Redeploy controller with new docker image
.PHONY: redeploy
redeploy: manifests kustomize docker-build docker-load
# deploy configs
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
# force recreate pods
$(KUBECTL) delete pod -n etcd-operator-system --all

##@ Dependencies

## Location to install dependencies to
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: controller
newName: ghcr.io/aenix-io/etcd-operator
newTag: latest

0 comments on commit b0a14f5

Please sign in to comment.