Probably there are more simple ways to get it done but the first solution which comes to my mind is setting simple ssh port forwarding.
Assuming that you have ssh access to both machines i.e. Concourse
has ssh access to Bastion
and Bastion
has ssh access to Cluster
it can be done as follows:
First make so called local ssh port forwarding on Bastion
(pretty well described here):
ssh -L <kube-api-server-port>:localhost:<kube-api-server-port> ssh-user@<kubernetes-cluster-ip-address-or-hostname>
Now you can access your kubernetes api from Bastion
by:
curl localhost:<kube-api-server-port>
however it isn't still what you need. Now you need to forward it to your Concourse
machine. On Concource
run:
ssh -L <kube-api-server-port>:localhost:<kube-api-server-port> ssh-user@<bastion-server-ip-address-or-hostname>
From now you have your kubernetes API available on localhost of your Concourse
machine so you can e.g. access it with curl
:
curl localhost:<kube-api-server-port>
or incorporate it in your .kube/cofig
.
Let me know if it helps.
You can also make such tunnel more persistent. More on that you can find here.