polarstreams/polar

Expose `barco` service to be consumed externally

rmarting opened this issue · 1 comments

The current k8s definition of the barco service has not included nodePorts, so it is impossible to execute the sample commands to test and verify the production of messages.

Steps to reproduce

  1. Start minikube
  2. Deploy Barco following the instructions
  3. Execute the command to publish a message:
❯ TOPIC="my-topic"
curl -X POST -i -d '{"hello":"world"}' \
    -H "Content-Type: application/json" --http2-prior-knowledge \
    "http://barco.streams:9251/v1/topic/${TOPIC}/messages"
curl: (6) Could not resolve host: barco.streams
  1. Expose service to be consumed externally:
❯ minikube service barco --url -n streams
😿  service streams/barco has no node port

Suggestions

I would like to suggest improving the Getting Started by adding some references to have a local Kubernetes cluster (or using the local development environment) before to try to execute the commands to produce or consume. Otherwise, it is a bit complicated to follow up on the instructions.

Meanwhile the barco service is not available to expose it, there is an alternative way to execute the commands using the exec option of kubectl CLI:

❯ k exec barco-0 -- curl -X POST -i -d '{"hello":"world"}' -H "Content-Type: application/json" --http2-prior-knowledge "http://barco:9251/v1/topic/my-topic/messages"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    19  100     2  100    17      1     16  0:00:02  0:00:01  0:00:01    18
HTTP/2 200 
content-type: text/html; charset=utf-8
content-length: 2
date: Mon, 19 Sep 2022 07:12:15 GMT

OK

Thanks @rmarting !

💯 Getting started should account for the different types of local installations and guide them to the proper hostname / port.