0

I wonder if any HELM guru's can shed some light/point me in the right direction...

I'm testing a PoC where we're using molecular to build an app which has a few services linking in the back-end (ticket,notification). We're using NATS as the transport layer and have managed to get our services to talk to each other when either running the env using docker-compose or a simple k8's file we run using minikube.

Now I'm trying to bring this to our K8's cluster using HELM and am struggling to get NATS to talk to the services. I've tried setting the env var on the services for transportation as nats://nats:4222 and have advertised 4222 as the container port on the NATS chart.

However, once running my helm upgrade install and checking the NATS pod status, it is failing with the following output:

│ [1] 2021/03/19 14:12:21.843799 [INF] STREAM: Streaming Server is ready                                                                                                               │
│ [1] 2021/03/19 14:12:23.569211 [ERR] 127.0.0.1:42594 - cid:5 - Client parser ERROR, state=0, i=0: proto='"GET / HTTP/1.1\r\nhost: 10.202.211"...'                                    │
│ [1] 2021/03/19 14:12:32.679854 [ERR] 127.0.0.1:42800 - cid:6 - Client parser ERROR, state=0, i=0: proto='"GET / HTTP/1.1\r\nhost: 10.202.211"...'                                    │
│ [1] 2021/03/19 14:12:33.568306 [ERR] 127.0.0.1:42830 - cid:7 - Client parser ERROR, state=0, i=0: proto='"GET / HTTP/1.1\r\nhost: 10.202.211"...'                                    │
│ [1] 2021/03/19 14:12:42.679902 [ERR] 127.0.0.1:43040 - cid:8 - Client parser ERROR, state=0, i=0: proto='"GET / HTTP/1.1\r\nhost: 10.202.211"...'                                    │
│ [1] 2021/03/19 14:12:43.568204 [ERR] 127.0.0.1:43066 - cid:9 - Client parser ERROR, state=0, i=0: proto='"GET / HTTP/1.1\r\nhost: 10.202.211"...'                                    │
│ [1] 2021/03/19 14:12:52.680184 [ERR] 127.0.0.1:43270 - cid:10 - Client parser ERROR, state=0, i=0: proto='"GET / HTTP/1.1\r\nhost: 10.202.211"...'                                   │
│ [1] 2021/03/19 14:12:53.570613 [ERR] 127.0.0.1:43288 - cid:11 - Client parser ERROR, state=0, i=0: proto='"GET / HTTP/1.1\r\nhost: 10.202.211"...'                                   │
│ [1] 2021/03/19 14:12:55.655059 [INF] STREAM: Shutting down.                                                                                                                          │
│ [1] 2021/03/19 14:12:55.655252 [INF] Initiating Shutdown...                                                                                                                          │
│ [1] 2021/03/19 14:12:55.655536 [INF] Server Exiting..                                                                                                                                │
│ stream closed                       

Not sure what I'm missing, should I be advertising the NATS address as an ingress?

Any guidance greatly appreciated

K8's ver: Client: v1.17.2 Server: v1.16.13 HELM ver: v3.1.1 image: nats-streaming:latest (I'm not using the full functionality of streaming, so could downgrade to regular nats if easier)

jordanm
  • 33,009
  • 7
  • 61
  • 76
  • As a svc should be fine. Your logs indicate that your env variable is not being used as it says its requesting 127.0.0.1. – jordanm Mar 19 '21 at 20:58
  • Thanks @jordanm for the advice (and the log clean-up) I'll have a play with the env var and see if that does the trick! – user14149738 Mar 20 '21 at 12:17

1 Answers1

1

If you already have a working docker compose yaml, I recommend using Kompose tool to convert Docker Compose yaml to helm chart using below command

Documentation Link : https://kubernetes.io/docs/tasks/configure-pod-container/translate-compose-kubernetes/

Command :

kompose convert -c
Sagar Velankar
  • 845
  • 5
  • 5
  • Thanks for the recommendation, Sagar. I did initially try the kompose method and it created all the yaml files for me to deploy, However I thought this was for k8s and didn't see the compatibility with Helm charts. I will try the command you recommended :) – user14149738 Mar 21 '21 at 22:09
  • Thanks. Please upvote the answer if it helps. – Sagar Velankar Mar 22 '21 at 06:04