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

Bitbucket pipelines pipe atlassian/kubectl-run in self hosted linux docker runner.

Tibor Kadar June 29, 2023

I am trying to connect to a local kubernetes running on the same machine as the bitbucket pipeline self hosted runner. 

I am using the linux docker runner.
On the same machine I have a minikube running.
Added the kubeconfig to the repository variables encoded base64. In the kubeconfig file I edited the server url to point to http://host.docker.internal:9100 (port on which my kubernetes cluster works)

Is it possible that the docker container running the pipe does not see the actual host.docker.internal?

How could I connect it to a local kubernetes?

Screenshot 2023-06-29 at 09.46.37.png 

1 answer

1 accepted

0 votes
Answer accepted
Yevhen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 29, 2023

@Tibor Kadar have you tried kubernetes svc directly? https://kubernetes.svc.cluster.local? This will work though only if the runner is in the same cluster.

Tibor Kadar June 29, 2023

Thanks for pointing me in this direction! 

Tibor Kadar June 29, 2023

This setup would require me to have the runner running in the kubernetes cluster as well. Which at the moment I would keep separate. 

A workaround that I used was to not use the pipe but actually download kubectl in the script section. Since the step runs in a docker container on the host machine it would see the host.docker.internal and I could connect. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events