nats-io / nats-streaming-operator

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

operator not scaling cluster #28

Closed kyleroot closed 5 years ago

kyleroot commented 5 years ago

I have a nat-streaming cluster that I've defined to be three pods, however it seems the operator is not able to find this property of the CRD or is ignoring it.

Operator Log

time="2019-01-23T21:01:52Z" level=info msg="Starting NATS Streaming Operator v0.2.0"
time="2019-01-23T21:01:52Z" level=info msg="Go Version: go1.11"
time="2019-01-23T21:01:53Z" level=info msg="Adding cluster 'logging/nats-streaming-logging-cluster' (uid=25707797-1f51-11e9-997b-166d38be4f4a)"
time="2019-01-23T21:05:30Z" level=info msg="Deleted 'logging/nats-streaming-logging-cluster' cluster (uid=25707797-1f51-11e9-997b-166d38be4f4a)"
time="2019-01-23T21:05:55Z" level=info msg="Adding cluster 'logging/nats-streaming-logging-cluster' (uid=ac99a498-1f52-11e9-997b-166d38be4f4a)"
time="2019-01-23T21:05:55Z" level=info msg="Missing pods for 'logging/nats-streaming-logging-cluster' cluster (size=0/1), creating 1 pods..."
time="2019-01-23T21:05:55Z" level=info msg="Creating pod 'logging/nats-streaming-logging-cluster-1'"

NATS Streaming Cluster Definition

$ k get stancluster/nats-streaming-logging-cluster -o yaml
apiVersion: streaming.nats.io/v1alpha1
kind: NatsStreamingCluster
metadata:
  creationTimestamp: "2019-01-23T21:05:55Z"
  generation: 1
  labels:
    app: nats-streaming-logging-cluster
    chart: nats-streaming-logging-cluster-0.1.0
    heritage: Tiller
    release: nats-streaming-logging-cluster
  name: nats-streaming-logging-cluster
  namespace: logging
  resourceVersion: "80341241"
  selfLink: /apis/streaming.nats.io/v1alpha1/namespaces/logging/natsstreamingclusters/nats-streaming-logging-cluster
  uid: ac99a498-1f52-11e9-997b-166d38be4f4a
spec:
  configFile: /etc/stan/config/secret.conf
  natsSvc: nats-logging-cluster
  size: 3
  store: SQL
  template:
    spec:
      containers:
      - name: nats-streaming
        volumeMounts:
        - mountPath: /etc/stan/config
          name: nats-streaming-logging-cluster
          readOnly: true
      volumes:
      - name: nats-streaming-logging-cluster
        secret:
          secretName: nats-streaming-logging-cluster

Is there something obvious that I am missing that would prevent the operator from seeing that size is set to 3?

wallyqs commented 5 years ago

when using the SQL store, clustering is not required so only a single replica is created: https://github.com/nats-io/nats-streaming-operator#using-a-db-store

kyleroot commented 5 years ago

Thank you!

vikram1601 commented 5 years ago

How would i run as HA mode ?

Trying to create NatsStreaming(Stan) pod with replica set 3, Using a custom store dir for a Persistent Volume. But Getting Error Unable to Mount Volumes for Pod Because “volume is already exclusively attached to one node and can’t be attached to another” This is Because, NatsStreaming Operator doesn't have StateFullSet. Is there any way to solve it.