Select the agent context given in environment.kubernetes.agent in CI

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Release notes

Proposal

Since the ci_access feature is available, GitLab injects the set of available kubernetes contexts to the Runner environment, and the user needs to select the context they want to use as a script (or before script). We do this selection for AutoDeploy using the KUBE_CONTEXT variable.

As we introduced the environment.kubernetes.agent syntax to configure an agent for the dashboard for Kubernetes, we can re-use this setting to pre-select the agent without any other setup from the user.

Edited by 🤖 GitLab Bot 🤖