[Gitlab CI] Exposes Kubernetes integration information as environment variables in the GitLab CI Pipelines
Problem to solve
Avoid filling twice the same information about the Kubernetes cluster so that the k8s integration is done and the
kubectl command works in Gitlab pipelines.
Everybody that uses the
kubectl command within the pipelines.
When using an integrated Kubernetes cluster in order to run builds where it uses the
kubectl command, the same information are required in order to configure
kubectl (server URL, certificate and token).
As of now, we have to declare variables in the Gitlab project's settings, or in the
.gitlab-ci.yml file, in order to have those information to configure the command.
Exposes the Kubernetes URL, certificate and token, but hidden from the log as it is done with the
CI_REGISTRY_PASSWORD env variable for instance.
I would expect something like
What does success look like, and how can we measure that?
Using those variables to configure the
kubectl command should make the
kubectl get pods command returning the actual pods of the given k8s cluster info.