nats-io / nats-streaming-operator

NATS Streaming Operator
Apache License 2.0
174 stars 44 forks source link

nats-operator automatically creating example-nats cluster #52

Closed atye closed 4 years ago

atye commented 4 years ago

I've executed the Getting Started section to install the NATS Operator and the NATS Streaming operator by copying those four yaml files locally and running helm install in the project directory.

helm install --name my-app --namespace default helm/test

project
└───helm
│   └───test
│       │   Chart.yaml
│       └───templates
               |   nats-operator-deployment.yaml
               |   nats-operator-prereqs.yaml
               |   nats-streaming-operator-deployment.yaml  
               |   nats-streaming-operator-rbac.yaml

The CRDs get created as expected. The operator pods get created which I believe is also expected but not 100% sure from the README.

What I'm not expecting is the example-nats pods getting created.

# kubectl get crd
natsclusters.nats.io                             2019-09-19T18:52:58Z
natsserviceroles.nats.io                         2019-09-19T18:52:58Z
natsstreamingclusters.streaming.nats.io          2019-09-20T14:29:24Z

# kubectl get pods
NAME                                       READY   STATUS    RESTARTS   AGE
example-nats-1                             1/1     Running   0          113s
example-nats-2                             1/1     Running   0          112s
example-nats-3                             1/1     Running   0          110s
nats-operator-dd7f4945f-l788t              1/1     Running   0          2m12s
nats-streaming-operator-6fbb6695ff-mkkzx   1/1     Running   0          2m12s

The example-nats pods should be created when content below is applied which I have not done.

---
apiVersion: "streaming.nats.io/v1alpha1"
kind: "NatsStreamingCluster"
metadata:
  name: "example-stan"
spec:
  size: 3
  natsSvc: "example-nats"

In the nats-operator logs, I see that it is starting works and waiting for the example-nats pods to be running.

I don't see anything in https://github.com/nats-io/nats-operator/releases/download/v0.5.0/10-deployment.yaml, or the other three files, about creating "example-nats".

Is this supposed to be happening under the hood? How can I stop this example-nats cluster from being created when installing the operators?

level=info msg="started workers" pkg=controller
level=info msg="waiting for pod \"default/example-nats-1\" to become ready" cluster-name=example-nats namespace=default pkg=cluster
level=info msg="pod \"default/example-nats-1\" became ready" cluster-name=example-nats namespace=default pkg=cluster
level=info msg="waiting for pod \"default/example-nats-2\" to become ready" cluster-name=example-nats namespace=default pkg=cluster
level=info msg="pod \"default/example-nats-2\" became ready" cluster-name=example-nats namespace=default pkg=cluster
level=info msg="waiting for pod \"default/example-nats-3\" to become ready" cluster-name=example-nats namespace=default pkg=cluster
level=info msg="pod \"default/example-nats-3\" became ready" cluster-name=example-nats namespace=default pkg=cluster
atye commented 4 years ago

I had an example-nats cluster already running from the past that was not cleaned up. Removing it via 'kubectl delete nats example-nats' resolve it.

# kubectl get nats
NAME           AGE
example-nats   20h