Closed exu closed 5 years ago
I don't have any knowledge about wrtiting operators but I've found comment in in Kubernetes go client - maybe it'll help a little
// NewIndexerInformer returns a Indexer and a controller for populating the index
// while also providing event notifications. You should only used the returned
// Index for Get/List operations; Add/Modify/Deletes will cause the event
// notifications to be faulty.
//
it's used here https://github.com/nats-io/nats-streaming-operator/blob/master/internal/operator/controller.go#L145
Hi @exu this is because when setting the store to be SQL
then only need a single instance from the service will be required. DB mode is not compatible with clustered mode so can't have multiple instances: https://github.com/nats-io/nats-streaming-operator#using-a-db-store
Since the server does not hold any state it is good enough for Kubernetes to just restart the streaming service.
Hmm Thanks for pointing this out, I understand, but what about scaling? It looks like candidate for bottleneck during high traffic.
yes that is also a current limitation, for scaling out you could use nats streaming server instances for different purposes, but right now clustering is mostly for HA when using a file store (https://github.com/nats-io/nats-streaming-server/issues/494)
I'm trying to install / update nats-streaming operator with postgresql attached as storage - and I've recently get a problem with not responding to changes in
NatsStreamingCluster
But after installing there is only one pod of nats-streaming
After editing resource and setting size to different value (4)
operator didn't responds to events.
info
!! There is only one instance when SQL config used - with default installation with file store there is valid number of instances !!
Env: GKE