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

Enable monitoring #31

Open
taddgiles opened this issue Feb 20, 2019 · 3 comments
Open

Enable monitoring #31

taddgiles opened this issue Feb 20, 2019 · 3 comments

Comments

@taddgiles
Copy link

Is there a way to enable http monitoring with the nats-streaming-operator?

/streaming/serverz and such.

I tried adding a container args to the k8s config.

---
apiVersion: streaming.nats.io/v1alpha1
kind: NatsStreamingCluster
metadata:
  name: nats-streaming-cluster
spec:
  size: 3
  natsSvc: nats-cluster
  template:
    spec:
      containers:
        - args: ["--http_port=8222", "--stan_debug=true", "--stan_trace=true"]

But the default operator config doesn't create a service that would work for that.

@wallyqs
Copy link
Member

wallyqs commented Feb 20, 2019

There is no toggle for the monitoring port right now, but you could enable it via the config file:

echo '
  http = 0.0.0.0:8222
' > streaming.conf

kubectl create secret generic streaming-conf  --from-file=streaming.conf

echo '
---
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    
' | kubectl apply -f -

kubectl port-forward example-stan-1 8222:8222

curl 127.0.0.1:8222/streaming/serverz

@taddgiles
Copy link
Author

That worked great. Big thanks!

@wallyqs
Copy link
Member

wallyqs commented Feb 21, 2019

np! Will keep this issue open since a simple toggle on the manifest spec could be useful.

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

No branches or pull requests

2 participants