I am running a kubernetes cluster in AWS. I have 2 nodes. I have one pod that should be accessible externally. The problem is, that pod can be on either node.
The solution according to the docs:
- Expose the deployment as a
get podsto find the name of the node running the pod.
get nodesto find the IP address of the named node.
- Open the
NodePortport through EC2 Security Group.
The problem here is that this pod could be restarted/switch nodes, I think? At that point the application will be unavailable by the previous node IP address.
How can I make sure an application is always available, even if this specific pod switches nodes during a restart/etc?
Note: I definitely only want one of this specific pod. I do not want replicas.