2

I am deploying NATS with HELM following the official documentation.

To install I use the command:

helm install my-nats nats/nats --values values.yaml

My values.yaml contains auth information:

auth:
  enabled: true
  nkeys:
    users: [
    {
      nkey: UDS..................
    }
  ]

I also have a service.yaml to let other apps in cluster to connect to NATS:

apiVersion: v1
kind: Service
metadata:
  name: my-nats
spec:
  selector:
    app: my-nats
  ports:
    - port: 4222

Unfortunately I don't understand how to attach this service.yaml file to HELM installation.

I have tried to kubectl apply -f service.yaml after helm install and install it together with values.yaml with -f flag. No errors happen, but typing kubectl get svc --all-namespaces I see that my NATS doesn't get any ClusterIP, which signs that service doesn't see NATS application.

 NAMESPACE       NAME                                 TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                                 AGE
cert-manager    cert-manager                         ClusterIP      10.103.88.179    <none>        9402/TCP                                                2d2h
cert-manager    cert-manager-webhook                 ClusterIP      10.109.207.216   <none>        443/TCP                                                 2d2h
default         kubernetes                           ClusterIP      10.96.0.1        <none>        443/TCP                                                 6d23h
default         my-nats                              ClusterIP      None             <none>        4222/TCP,6222/TCP,8222/TCP,7777/TCP,7422/TCP,7522/TCP   18m

Also I was playing with changing type in service.yaml to LoadBalancer but same, after deploying my-nats stays ClusterIP type which shows that service.yaml is not applied.

How to solve the problem?

Dmitry K.
  • 193
  • 1
  • 1
  • 8

0 Answers0