"shell not found" error in gitlab deployment for k8s

43 Views Asked by At

Trying to run gitlab pipeline for k8s and getting the following error:

Skipping Git submodules setup
Executing "step_script" stage of the job script
00:00
Using docker image sha256:a1216024d119dbf6b3a6e731d47f08a36de468de70e8 for bitnami/kubectl:latest with digest bitnami/kubectl@sha256:c74b703deed247e544a3feca13be7ecb0b091e4d2c3b825c8 ...
shell not found
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1

This is the relevant portion of the .gitlab.yaml:

qa-release:
  image:
    name: bitnami/kubectl:latest
    entrypoint: [""]
  stage: release
  variables:
    CI_DEBUG_TRACE: "true"
  environment:
    name: dev
  tags:
    - <removed>
  script:
    - echo "Deploying Kube Manifests to SERVER"
    <rest .... removed...>

  only:
    - master
  when: manual

Any help or pointers will be appreciated.

2

There are 2 best solutions below

0
Guru On

bitnami/kubectl:latest image does not come with sh / bash shells. it is very light weight container image.

things under script trying to execute inside the container, and it is not getting any executable shell.

Try to find or build your own container image which has kubectl and bash / sh both available.

0
ram p On

First of all the description is not clear but I would suggest that there is no issue with the bitnami/kubectl:latest image because when I am running in the docker it is able to get into the shell by interactive mode. So the bitnami/kubectl:latest image is comes with the shell.

docker run -it --entrypoint bash bitnami/kubectl:latest

I would suggest you to check the gitlab runners having any issue.