简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM