Skip to content
GitLab
Next
    • Why GitLab
    • Pricing
    • Contact Sales
    • Explore
  • Why GitLab
  • Pricing
  • Contact Sales
  • Explore
  • Sign in
  • Get free trial
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #31519

gitlab provided $KUBECONFIG in ci is not following $KUBE_NAMESPACE

Summary

kubernetes account provided in KUBECONFIG is not in the right namespace when setting namespace with KUBE_NAMESPACE in CI settings

Steps to reproduce

Add a RBAC enabled kubernetes cluster to your project

Set up $KUBE_NAMESPACE to whatever existing namespace in your kubernetes cluster. image

set up a CI stage with an environment : image

and try to apply a file in the cluster : kubectl apply -f ./file.yml --namespace $KUBE_NAMESPACE

What is the current bug behavior?

image user provided in $KUBECONFIG has no edit right in the $KUBE_NAMESPACE

image

and $KUBECONFIG content : image

What is the expected correct behavior?

image

namespace should be $KUBE_NAMESPACE and this token should have edit rights in $KUBE_NAMESPACE

Relevant logs and/or screenshots

see previous screenshots

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

This bug happens on GitLab.com

Results of GitLab application Check

This bug happens on GitLab.com

Possible fixes

Edited Sep 03, 2019 by Téo Auguste Goddet
Assignee
Assign to
Time tracking