Kubernetes deployment variables missing

I’m having an issue with accessing the deployment variables related to my Kubernetes integration.

When I attempt to access the variables related to the deployment, they all appear to be empty.

The following is one of my gitlab-ci.yml jobs:
stage-train-article-classifier:
stage: validate
image: lwolf/helm-kubectl-docker:v1103_291
before_script:
# Exports the kuberenetes config
- ${KUBECONFIG}
- echo $KUBE_URL
- echo $KUBE_TOKEN
- echo $KUBE_NAMESPACE
- echo $KUBE_CA_PEM_FILE
- echo $KUBECONFIG
- echo ${KUBECONFIG}

This results in the following:

I provisioned the Kubernetes cluster using the GCP integration, and the CI Runner also runs on the cluster.

Any ideas why the deployment variables aren’t there?

In case you haven’t figured it out yet; they don’t inject deployment variables unless you define an environment. So add:

environment: foo

to the stage

2 Likes