eshepelyuk/cmak-operator

Cluster config not persistent

Closed this issue · 15 comments

Hello!
Due to zookeeper has no storage, and cluster config is applied only once on creation via job, cluster list is not persistent and will disappear after every CMAK pod recreation.
There is 2 possible ways to solve this:

  1. Add persistent storage to Zookeeper.
  2. Run cluster population script in an initContainer.
    Thanks.

Thnx for opening a bug. I am still thinking about proper fix for the issue.

Ya this is a pretty big bug as it just makes the tool unusable. Perhaps adding an option to the chart to either add a disk or init is a flexible solution.

PRs are welcomed, btw.

Would you also be receptive to having a toggleable ingress?

Sounds good!

Would you also be receptive to having a toggleable ingress?

Absolutely, I'd just prefer to have it in the different PR

I will test it over the next day or two. If it keeps working I will submit my changes as a PR. I will also submit a separate one for the ingress then as well.

To get the initcontainer approach to work I had to split the zk and cmak deployments into two with separate services because the cmak job needs zk running or it won't execute. The job runs as an initcontainer to cmak-ui and watches for zk service to be active then runs and it all boots.

Do you still need k8s Job while using initContainer for putting config into ZK ?
I suppose, don't.

initContainer should be added to ZK, not to cmak-ui.
Since the data disappeares when ZK container restarts.

Well, if you think about recinciliation, then it is not an initContainer approach, but a separate deployment should be created that reconciles ConfigMap to ZK if the data disappers.

Maybe I just misunderstood the approach, i am open for further design discussion.

Okay so you were 100% correct, putting it as an init container for the UI wouldn't work longterm. I instead went for an approach where the zookeeper pod has an init container that creates the setup job from a mounted configmap. This way on each reboot the job will run until the zookeeper is up. So far it seems to work. If it has no issues I will try and have a PR this week.

Good news @sharkymcdongles , thanks

@sharkymcdongles any news on this?

Please take a look at PR #3

@sharkymcdongles @lexasoft123 released 0.7.0

Please give it a try.