Current-context must exist in order to minify

Hey all,

I’m having issues with the auto-deploy step. I’ve set up a kubernetes cluster on Google Cloud and have added Gitlab runners via the helm chart. I have also added the Gitlab agent to my cluster and created a repository in my group which holds the agent config. I then enabled access for my group’s projects by adding the following to the agent config:

ci_access:
  groups:
  - id: my-group

I then setup auto-devops for my express app project. Jobs run successfully on my Kubernetes cluster (build, test, sast,…) except the deploy to production step. There I get the following output for my job:

....
Executing "step_script" stage of the job script
$ auto-deploy check_kube_domain
error: current-context must exist in order to minify
Uploading artifacts for failed job
Uploading artifacts...
WARNING: environment_url.txt: no matching files    
WARNING: tiller.log: no matching files             
ERROR: No files to upload                          
Cleaning up project directory and file based variables
ERROR: Job failed: command terminated with exit code 1

Any ideas what’s causing the error error: current-context must exist in order to minify?

Any help would be appreciated

We’re also experiencing this on a pretty basic react express app. Cluster seems to be configured correctly - we’re just getting the same current-context must exist in order to minify error

I got this recently and clearing the k8s cluster cache on the gitlab page for the cluster fixed this for me. Have you tried that?

The message is produced by kubectl config view if it does not find all required configuration. With gitlab-agent you have to provide several variables manually to the pipeline, which you got for free with the certificate based kubernetes integration:

  • KUBE_CONTEXT must point to your agent configuration project
  • KUBE_NAMESPACE must be specified manually - it is no longer automatically derived from the project and branch name
  • KUBE_INGRESS_BASE_DOMAIN if you want to use review-apps, staging, deploy to production, …