diff --git a/Makefile b/Makefile index 8b80a16..238a111 100644 --- a/Makefile +++ b/Makefile @@ -175,22 +175,14 @@ ifndef ignore-not-found ignore-not-found = false endif -.PHONY: install -install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. - $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f - - -.PHONY: uninstall -uninstall: manifests kustomize ## Uninstall CRDs 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/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f - - .PHONY: deploy deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} - $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f - + $(KUSTOMIZE) build config/dev | $(KUBECTL) apply -f - .PHONY: undeploy undeploy: ## 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 - + $(KUSTOMIZE) build config/dev | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f - ##@ Build Dependencies diff --git a/config/dev/kind_imagepull_patch.yaml b/config/dev/kind_imagepull_patch.yaml new file mode 100644 index 0000000..33058d5 --- /dev/null +++ b/config/dev/kind_imagepull_patch.yaml @@ -0,0 +1,11 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: controller-manager + namespace: system +spec: + template: + spec: + containers: + - name: manager + imagePullPolicy: Never diff --git a/config/dev/kustomization.yaml b/config/dev/kustomization.yaml new file mode 100644 index 0000000..2e62360 --- /dev/null +++ b/config/dev/kustomization.yaml @@ -0,0 +1,5 @@ +resources: + - ../default + +patches: +- path: kind_imagepull_patch.yaml diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 04d5c9e..9f7fab2 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -71,7 +71,7 @@ spec: args: - --leader-elect image: controller:latest - imagePullPolicy: Never + imagePullPolicy: IfNotPresent name: manager securityContext: allowPrivilegeEscalation: false