Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Does kubectl port forwarding work from within a bitbucket pipeline?

Jonathan Tan December 15, 2019

Hi,

I'm using `kubectl` to set up and install/deploy kubernetes deployments from within Bitbucket Pipelines.

 

For integration testing, I'm trying to use port-forwarding to send traffic from the bitbucket pipeline to my cluster.

 

This process works fine for me locally with the same environment variables.

However, I get timeouts after my port-forward step.

 

Screen Shot 2019-12-17 at 10.41.00 am.png

Screen Shot 2019-12-17 at 10.41.08 am.png

The picture shows me *attempting* to use a `curl` as part of my debugging to actually try out the connection, but it's just timing out. If this works, then I'd go back to just running my original integration tests.

 

Questions:

1. has anybody successfully done this? port-forward from within a bitbucket pipeline step to a kube cluster to do stuff?

2. are there any security things on bitbucket (firewalls? closed ports? permissions? something? - not a security person) that may be preventing this from working?

 

Thanks!

1 answer

0 votes
Jonathan Tan May 13, 2020

Brain eventually caught up.  
if all the pipelines are being run within a docker container - probably - that is being run in a secure mode - probably - stuff running inside won’t have access to exiting the container via random ports.  

which basically means that what I’ve been going to do isn’t possible.  

time to go look for another solution.  

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events