How to deploy an operator(created by operator-sdk v1.0) without installing operator-sdk in production environment?

Viewed 272

With the operator-sdk guide v1.0, it is necessary to install operator-sdk in production environment when deploy an operator.

Is it possibile to deploy an operator without installing operator-sdk? Because it leads to more dependency and complexity.

How can I just generate CRD yaml, CR yaml and Contoller Image? Or any other more convenient way to publish an Operator?

2 Answers

You can change the make deploy command to generate deploy.yaml with all rbac and deployment objects needed for the operator. I struggle with my self until I found this solution.

Just change the deploy task in the make file.

$(KUSTOMIZE) build config/default | kubectl apply -f -

To

$(KUSTOMIZE) build config/default > deploy.yaml

Then run make deploy. And then copy the deploy.yaml and install it in your k8s or create a helm chart from it. This worked for me no need for operator-sdk in your environment.

Edit:
I didn't use CRD i use it to watch existing resources. But it's look like the same solution should work with the install task for CRD and CR.

Related