skip to Main Content

I have springboot microservice running inside docker container (Kubernetes) which can access unmanaged services (SQL, Elasticsearch, etc), which are not accessible from my laptop directly, so I’m forced to run commands via kubectl to access them. Is there a posibility to forward TCP connections through docker containers to enable direct access to those service, something like ssh port forwarding?

2

Answers


  1. Yep, you can use kubectl port-forward to do exactly this. If you’d like to read the documentation it’s here.

    Login or Signup to reply.
  2. For this you have to create a"service without selector"and defineendpointsfor your "external" resources

    Kubernetes doc on such services here

    Of course, your service can be of type"NodePort", so with the help of your load balancer in front of OCP, you can access the service from outside your cluster and the service will reach your external resource

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search