Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

388
Views
Use gitlab-ci (or any CI) with kubernetes or google container engine (gitlab-runner won't find kubectl)

I want to use gitlab-ci (or any other CI, whatever works) to deploy to google container engine using kubectl run

I have a working gitlab runner on google compute engine but can't figure out how to install gcloud and kubectl in so the runner has their executable and config in their path.

Running pwd through th gitlab ci file shows /home/gitlab-runner and running whoami shows root, so I installed kubectl as user gitlab-runner and as user root but gitlab-ci-multirunner still complains

$ gcloud config list
bash: line 35: gcloud: command not found

ERROR: Build failed with: exit code 1

same for kubectl. I probably have a flawed understanding on how gitlab-runner spawns the builds, but it can access the docker install so how do I get it to access the gcloud / kubectl install?

Is there a more straightforward version to deploy to kubernetes / google container engine?

Thanks so much!

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You didn't mention what gitlab image you used. It might be useful to look at others', such as: https://github.com/sameersbn/docker-gitlab/

It looks like that configures several paths explicitly via environment variables.

If you're using Docker containers on your runner, you'd need to install kubectl in your Docker image rather than use an executable from the host. https://github.com/gitlabhq/gitlabhq/blob/master/doc/ci/docker/using_docker_images.md

over 4 years ago · Santiago Trujillo Report

0

You could try the new integration using spread. From the blog post:

To use Spread with GitLab CI:

  1. Add the correct image to .gitlab-ci.yml:

    deploy:
      stage: deploy
      image: redspreadapps/gitlabci
      script:
      - null-script
    
  2. Set the environment variables to what makes sense. See the documentation of the environment variables.
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!