I have applied the edge stack, mappings to the example quote service, host and listener. I cannot reach the services through the edge stack, attempts to connect to the nodeport connected to the API gateway result in connection refused.
I tried experimenting with metallb, but the IP that was assigned in the network was not reachable. So instead I tried to use a Nodeport to connect the gateway to a port on the machine running the cluster.
The nodeport is defined like this:
Name: ambassador-nodeport
Namespace: ambassador
Labels: <none>
Annotations: <none>
Selector: app.kubernetes.io/instance=edge-stack,app.kubernetes.io/name=edge-stack,profile=main
Type: NodePort
IP: 10.106.8.192
Port: http 80/TCP
TargetPort: http/TCP
NodePort: http 30000/TCP
Endpoints: 10.244.0.162:8080,10.244.0.163:8080,10.244.0.164:8080
Port: https 443/TCP
TargetPort: https/TCP
NodePort: https 30443/TCP
Endpoints: 10.244.0.162:8443,10.244.0.163:8443,10.244.0.164:8443
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
In the ambassador namespace, I have:
> kc get host
NAME HOSTNAME STATE PHASE COMPLETED PHASE PENDING AGE
minimal-host *
> kc get listeners
NAME PORT PROTOCOL STACK STATSPREFIX SECURITY L7DEPTH
edge-stack-listener-8080 8080 HTTPS XFP
edge-stack-listener-8443 30443 HTTPS XFP
http-listener
> kc get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ambassador-nodeport NodePort 10.106.8.192 <none> 80:30000/TCP,443:30443/TCP 16d
edge-stack LoadBalancer 10.108.133.185 192.168.0.3 80:31976/TCP,443:31611/TCP 16d
edge-stack-admin ClusterIP 10.96.105.37 <none> 8877/TCP,8005/TCP 16d
edge-stack-agent ClusterIP 10.108.57.148 <none> 80/TCP 16d
edge-stack-redis ClusterIP 10.103.23.175 <none> 6379/TCP 16d
quote-service ClusterIP 10.97.220.80 <none> 80/TCP 14d
my mapping in this namespace is defined like this:
> kc get mapping
NAME SOURCE HOST SOURCE PREFIX DEST SERVICE STATE REASON
edge-stack-devportal /documentation/ 127.0.0.1:8500
edge-stack-devportal-api /openapi/ 127.0.0.1:8500
edge-stack-devportal-assets /documentation/(assets|styles)/(.*)(.css) 127.0.0.1:8500
edge-stack-devportal-demo /docs/ 127.0.0.1:8500
quote-backend /backend/ quote
If SSH into the node, and try to reach this quote service, I get:
node@node:~$ curl 10.97.220.80
{
"server": "adorable-lemon-q36h3huq",
"quote": "Nihilism gambles with lives, happiness, and even destiny itself!",
"time": "2022-05-10T21:19:59.178675473Z"}
My expectation is now that, based on the above, if I curl localhost:30000/backend
from within the machine, I should be able to get a quote. This is because there is a listener, a host, and a mapping applied.
However, this is the response:
node@node:~$ curl localhost:30000/backend
curl: (7) Failed to connect to localhost port 30000: Connection refused
I notice also that the LoadBalancer service above has a NodePort:
node@node:~$ curl localhost:31976/backend
curl: (7) Failed to connect to localhost port 31976: Connection refused
I hope this is enough information. My question is why I cannot connect to the nodeports from the localhost of the machine running the cluster, and access the quote service .
Thank you for your time.