[Gitlab CI] Exposes Kubernetes integration information as environment variables in the GitLab CI Pipelines
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
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.
Target audience
Everybody that uses the kubectl command within the pipelines.
Further details
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.
Proposal
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 KUBERNETES_URL, KUBERNETES_CA and KUBERNETES_TOKEN.
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.