Kubernetes contexts from agent not injected into pipeline of projects authorized to use the agent

Hi,

Si I’ve tried with Public/Internal/Private Configuration repository, coupled with a Public / Internal / Private repository.
In the agent configuration, i tried to allow access to the repository with /group/project path or by ID, i also add a groups access configuration to allow the whole group with no luck.

The KUBECONFIG variable is simply not exported to the runner as it should be.

Agent configuration:

ci_access:
  projects:
    - id: "388"
  groups:
    - id: bioman

CI Job:

deploy:
  image:
    name: bitnami/kubectl:latest
    entrypoint: [""]
  script:
    - set
    - kubectl config get-contexts
    - kubectl config use-context bioman/gitlab-agent:gitlab-agent-1
    - kubectl get pods -n gitlab-agent
  tags:
    - docker

In the configuration repository CI job, i can see the KUBECONFIG variable exported :
KUBECONFIG=/builds/bioman/gitlab-agent.tmp/KUBECONFIG
In the project_id CI job, the KUBECONFIG variable is not there.

1 Like