nats-io / nats-streaming-operator

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

There is no service for Nats-Streaming-Server after installation #35

Closed exu closed 5 years ago

exu commented 5 years ago

After installation from readme (each scenario) there is no possibility to connect to Nats-Streaming-Server - there is no service added to Kubernetes cluster.

cluster installed with following commands

kubectl create namespace $NS
kubectl create secret generic stan-secret --from-file secret.conf

kubectl apply -f https://github.com/nats-io/nats-operator/releases/download/v0.3.0/deployment.yaml

kubectl apply -f https://raw.githubusercontent.com/nats-io/nats-streaming-operator/master/deploy/default-rbac.yaml
kubectl apply -f https://raw.githubusercontent.com/nats-io/nats-streaming-operator/master/deploy/deployment.yaml
kubectl apply -n$NS -f nats-cluster.yaml
# kubectl apply -n$NS -f nats-streaming-cluster-sql.yaml
kubectl apply -n$NS -f nats-streaming-cluster.yaml

where nats-cluster.yaml:

---
apiVersion: "nats.io/v1alpha2"
kind: "NatsCluster"
metadata:
  name: "nats"
  # namespace: "nats"
spec:
  size: 3

and nats-streaming-cluster.yaml:

---
apiVersion: "streaming.nats.io/v1alpha1"
kind: "NatsStreamingCluster"
metadata:
  name: "stan"
spec:
  # Number of nodes in the cluster
  size: 3

  # NATS Streaming Server image to use, by default
  # the operator will use a stable version
  #
  image: "nats-streaming:latest"

  # Service to which NATS Streaming Cluster nodes will connect.
  #
  natsSvc: "nats"

  config:
    debug: true
    trace: true
    raftLogging: true

After getting service list there is only one which is pointing to nats cluster

❯ kgs        
namespace is set to 'default'
NAME         TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
nats         ClusterIP   10.103.197.224   <none>        4222/TCP            39m
nats-mgmt    ClusterIP   None             <none>        6222/TCP,8222/TCP   39m
wallyqs commented 5 years ago

That's correct, the NATS streaming does not require a Kubernetes service since clients only have to connect to the NATS service.

exu commented 5 years ago

Ahh ok :) thank a lot for clarification, I simply can't connect to this service with stan-pub and stan-sub from examples. I probably need to debug why.

iggy commented 5 years ago

@exu did you figure your issue out? I'm hitting something similar and stumbled on this issue.