operator-sdk icon indicating copy to clipboard operation
operator-sdk copied to clipboard

Can you change operator language between releases?

Open dubauski opened this issue 6 years ago • 4 comments

Type of question

Question

What did you do?

We are planning to release v1.0 of our Ansible based operator. We anticipate the need to implement complex logic in v2.0 of the operator and for that reason it will be necessary to switch to Go based operator implementation.

What kind of problems should we expect with such switch in technologies? If it is not supported or potentially a messy transition would you recommend refactoring Ansible based operator into Go based before v1.0 has been released?

Thank you for your help

Environment

Operator type: Ansible

Kubernetes cluster type: "OpenShift"

dubauski avatar Oct 30 '20 06:10 dubauski

Hi @dubauski,

The Ansible based-operators behind the scene is a Go-based operator. The Ansible operators allow users write their projects with a language that they are more familiarized with it, however, it has some limitations which are not faced with the Golang projects since with them is possible to develop and customize your solutions programatically as you wish.

What kind of problems should we expect with such switch in technologies?

IMO it is not about-face problems, however, how big and complex is your project and how complex can be to port to Golang operator since you need to change the ansible tasks/roles/playbooks to a Golang code implementation.

If it is not supported or potentially a messy transition would you recommend refactoring Ansible based operator into Go based before v1.0 has been released?

IMO we are not in a place to answer that, it is really something up the business roles, strategy, design and code implementation of your projects. However, how much more complex your Ansible operator gets more complexity will be added to port it for another language. In this way, if you see that it will not attend soon your needs then would be better to do that soon as possible to avoid adding more complexity to this process.

@estroz @asmacdo @jmrodri would you like to share your thoughts?

camilamacedo86 avatar Oct 30 '20 12:10 camilamacedo86

Thank you for quick reply, @camilamacedo86.

dubauski avatar Nov 02 '20 05:11 dubauski

This is a tough question to answer for Ansible-based operators generally. If you have the time, I think the community (and the devs) could really benefit from a blog post or similar as you go through this process.

asmacdo avatar Nov 09 '20 19:11 asmacdo

It should be totally possible to migrate from Ansible to Go without any user-facing changes. You can re-implement all of your Ansible logic in Go without changing your CRD, and transparently upgrade users from the Ansible-based operator to a Go-based operator, and it wouldn't even have to be a new major version number.

The one thing to look out for is CRD validations. Ansible-based operators don't currently have a mechanism for auto-generating validations, but Go operators do. I would advise manually configuring CRD validations in your Ansible-based operator such that when you switch to Go the validations won't change.

joelanford avatar Nov 09 '20 19:11 joelanford