Skip to content

Commit

Permalink
operator: ensure to kuztomize operator manifests before local deployment
Browse files Browse the repository at this point in the history
Ensure proper deployment by invoking copy-crds and kustomizations
makefile targets alongside the deploy Makefile target. This change
guarantees the presence of all necessary CRDs and ensures that
kustomization files are appropriately modified before initiating
the operator pod.

Signed-off-by: Feruzjon Muyassarov <[email protected]>
  • Loading branch information
fmuyassarov authored and klihub committed Jan 25, 2024
1 parent 0c0fa18 commit 7f9cc23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion deployment/operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,14 @@ uninstall: copy-crds kustomize ## Uninstall CRDs from the K8s cluster specified
$(MAKE) cleanup-crds

.PHONY: deploy
deploy: kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
deploy: copy-crds kustomize kustomizations ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMAGE}
$(KUSTOMIZE) build config/default | kubectl apply -f -

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/default | kubectl delete -f -
$(MAKE) cleanup-crds

OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
ARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
Expand Down
2 changes: 1 addition & 1 deletion deployment/operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ nri-plugin specified in the NriPluginDeployment.

Build the operator image and push it to some registry
```shell
make -C deployment/operator docker-build docker-push IMG="my-registry.com/nri-plugins-operator:unstable"
make -C deployment/operator docker-build docker-push IMAGE="my-registry.com/nri-plugins-operator:unstable"
```

Deploy the operator in your cluster
Expand Down

0 comments on commit 7f9cc23

Please sign in to comment.