nats-io / nats-streaming-operator

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

NATS Streaming with embedded NATS #32

Closed exu closed 5 years ago

exu commented 5 years ago

Is there possibility to run nats-straeaming-server cluster which works without NATS cluster - NATS is started in embedded mode in nats-streaming-server?

wallyqs commented 5 years ago

You could start it in embedded mode by using the configuration file and then mounting it as a volume. If only want to have a single instance the NATS Streaming server this would work, but if want to have a cluster of multiple nodes then also need a kubernetes service etc.. that the nats operator helps with.

apiVersion: "streaming.nats.io/v1alpha1"
kind: "NatsStreamingCluster"
metadata:
  name: "example-stan"
spec:
  size: 3
  natsSvc: "example-nats-cluster"
  configFile: "/etc/stan/config/streaming.conf"
  template:
    spec:
      containers:
      - ports:
        - containerPort: 8222
      volumes:
      - name: streaming-conf
        secret:
          secretName: streaming-conf
      containers:
        - name: nats-streaming
          volumeMounts:
          - mountPath: /etc/stan/config
            name: streaming-conf
            readOnly: true
exu commented 5 years ago

Thanks for help, I'll try it.

GerardoGR commented 3 years ago

Unless I'm missing something, this doesn't seem to be possible, the -nats_server command-line option (which overrides the configuration file option) it's always populated by the operator, and therefore always expect to have an externally running server.

LarsBingBong commented 3 years ago

I think you're spot on here @GerardoGR .... thank you for pointing it out. Saved me some time.