How can I use helm & kubectl commands in the deploy stage when installed as app in the Kubernetes integration

Hi,

I added my GKE to my GitLab project successfuly. I also installed helm and the gitlab runner via the WebUI.
I thought that I should be able to use kubectl and helm commands now within my .gitlab-ci.yaml because all the necessary stuff like permissions are given while adding the GKE to GitLab.

stages:
  - build
  - deploy

build:
  stage: build
  image: docker:git
  services:
    - docker:18.09.8-dind
  variables:
    DOCKER_HOST: tcp://docker:2375

  script:
    - docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
    - docker build -t $CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_SHORT_SHA --build-arg GIT_USER=$CI_REGISTRY_USER --build-arg GIT_TOKEN=$CI_JOB_TOKEN -f docker/Dockerfile .
    - docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY/$CI_PROJECT_PATH
    - docker push $CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_SHORT_SHA
  only:
    - master

deploy:
  stage: deploy
  script:
    - helm install chart/
  only:
    - master

This will output: “command helm not found”.
So do I have to setup a seperate container for the deployment stage and configure helm and kubectl there? Or am I doing something crucial wrong.

Kind regards,
Stephan

I’m not using GKE for my deployments, but I assume that the process is the same. I installed the necessary tools right in the Docker image. I assume this is what you’re talking about in your final paragraph. It was the only way I found.

Thank you for your response @amartincolby
I really thought, that if I’m able to integrate K8 to GitLab, I should have access to the commands to actually deploy something. It seems like it is limited to AutoDevOps.

I believe you are correct. Everything I found seems oriented toward getting us to use AutoDevOps. Yeah, that’s great for people running an application built with some scaffolding tool and using off-the-shelf everything, but for everyone else it crashes hard pretty much immediately. Beyond my own experiences, there are apparently some ongoing, annoying limitations of Gitlab’s integrations with Kubernetes that I don’t fully understand but have heard from my own DevOps team and people complaining online. Any sort of customization of the process and Gitlab starts to chafe.