Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Does kubectl port forwarding work from within a bitbucket pipeline? Edited


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.



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?



1 answer

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
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,804 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you