Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove watch functions of NATS #65

Merged
merged 2 commits into from
Jul 31, 2019
Merged

Conversation

BuddhiWathsala
Copy link
Contributor

Purpose

Resolve #50

Approach

The watch functions that we had previously for NATS, listening to changes in NATS clusters. If NATS was not available in the cluster it will give an error as below.

"msg":"if kind is a CRD, it should be installed before calling Start","kind":"NatsCluster.nats.io","error":"no matches for kind \"NatsCluster\" in version \"nats.io/v1alpha2\""

But watching changes in NATS is an unnecessary task for the operator. So we simply remove those watchers.

User stories

According to this issue, the operator now has two deployment types.

  1. Deploy in default mode(without NATS)
  2. Deploy in distributed mode(with NATS)

Before deploying the Siddhi operator user has to decide either of above deployment types. Before deploying an operator we have to specify which types of resources that the operator has to handle. If NATS was not there when you deploy the operator, the operator simply ignores watching NATS. So this will lead to two questions as below.

  1. How to deploy default Siddhi apps with the distributed mode(with NATS) of the Siddhi operator?

    • Here you do not have a problem. If you install NATS before Siddhi operator deployment, you can deploy default Siddhi apps afterward without any problem.
  2. How to deploy distributed Siddhi apps with the default mode(without NATS) of the Siddhi operator?

    • You cannot deploy distributed Siddhi apps without NATS. If you deploy Siddhi operator without NATS, the Siddhi operator does not have the capability to watch NATS resources. Therefore in this scenario, you have to install NATS and then you need to redeploy the Siddhi operator.

Related PRs

#51

Test environment

minikube version: v1.2.0

Learning

Before deploying an operator, you have to specify all the CRDs that operator going to look at. And those resources should be in the k8s cluster when deploying the operator. The dynamic CRD registration does not support currently in operator sdk level according to this operator-framework/operator-sdk#139 issue.

@pcnfernando pcnfernando merged commit c9cc73b into siddhi-io:master Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operator crashes the when NATS unavailable in the cluster
2 participants