Neebz
Neebz

Reputation: 69

Accessing a specific pod in a Kubernetes cluster

In my current setup I have an application A, exposed via. NodePort, that the end-user connects to. When that happens, application A then issues a kubectl command to create a static instance of another application B. When application B starts it registers itself with application A, and then runs a setup process from values given to A by the end user.

I do this, since i need to run a stateful application that users can connect to, without being loadbalanced in any way. However, I cannot figure out how to expose this Pod externally.

I tried setting: hostNetwork: true and then start a TcpListener on a specific port, that I then give to Application A, that in return gives this to the end user. However, this doesn't seem to expose my pod, so I might have misunderstood how it works.

tl;dr: Is there any approach to exposing a dynamically created static pod externally in Kubernetes?

I'm running my cluster with Microk8s on Ubuntu, if that has anything to say.

Upvotes: 0

Views: 251

Answers (1)

Neebz
Neebz

Reputation: 69

Turns out my port-forward had broken due to some settings on my router being reset, and therefore I couldn't access my pod externally. Now everything works exactly as I want it to.

Upvotes: 1

Related Questions