projectsyn / documentation

The Project Syn main documentation repository
https://docs.syn.tools/
BSD 3-Clause "New" or "Revised" License
6 stars 3 forks source link

Getting started guide lieutenant API location issues #102

Closed mweibel closed 2 years ago

mweibel commented 3 years ago

Context

Going through the getting started guide, I had some issues with placing the lieutenant API on port 80 on my local machine.

Using k3d as suggested, I have another service running on that port (though I still don't quite know which one, lsof didn't show me..).

I switched to port 8080 using k3d:

k3d cluster create synquickstart -p "8080:80@loadbalancer" -p "8443:443@loadbalancer" 

Therefore I adjusted the LIEUTENANT_URL to:

export LIEUTENANT_URL="lieutenant.${INGRESS_IP}.nip.io:8080"

Which works quite well.

However: Upon deploying steward, it tries to call lieutenant API on http://lieutenant.127.0.0.1.nip.io which doesn't work for some reason I'm not quite sure about. I edited the deployment to switch it to port 8080 - doesn't work as well of course, because it tries to call the API on port 8080 but it actually runs on port 80.

In the end I switched STEWARD_API to http://lieutenant-api.lieutenant.svc.cluster.local (btw why is it not called LIEUTENANT_API?) which works probably in all cases (if you know the cluster domain).

Now my question: shouldn't the Lieutenant API always be called via the service within the cluster?

This is probably not really an issue with the getting started guide, but maybe it is? I'm not sure :)

Steps to Reproduce the Problem

  1. run local cluster with another port as shown above
  2. run all steps until steward
  3. run kubectl get pods -n syn - it will show no other pod than steward
  4. run kubectl logs $STEWARD_POD_NAME to have a look at the logs which will look similar to that:
» k logs -n syn steward-7c9697d8c-4bb2g
I1021 07:48:59.211936       1 main.go:26] Starting SYN cluster agent 🕵️
I1021 07:48:59.212039       1 main.go:27] Version v0.2.1-2-g0038ed0-dirty
W1021 07:48:59.466763       1 secret.go:39] Argo CD secret already exists, no update needed
E1021 07:48:59.548516       1 agent.go:94] Patch "http://lieutenant.127.0.0.1.nip.io/clusters/c-polished-field-6864": dial tcp 127.0.0.1:80: connect: connection refused

Actual Behavior

Steward couldn't talk to Lieutenant API.

Expected Behavior

Steward can talk to Lieutenant API in all cases.

akosma commented 2 years ago

Is this issue still relevant? I could not reproduce it.

mweibel commented 2 years ago

No idea - didn't touch that project since two years ;)