Connecting to Kubernetes Cluster (Admin)
Clusters authenticate via static Admin credentials.
This should only be used, when Authentik is not available.
Prerequisites
- Having
kubectlandansible-playbookinstalled. - SSH/Ansible access to the target cluster’s inventory.
1. Generate your kubeconfig
Clone Git repository:
git clone git@__GITLAB_URL__:foundation/infrastructure.git
cd infrastructureRun inside the infrastructure repository the Ansible playbook:
ansible-playbook -i inventories/__ENV__/ playbooks/kubeconfig.ymlThis writes to the kube config (default __ENV__.kubeconfig). Re-run it any
time to regenerate the file.
2. Connect
Set the generated kube config file:
export KUBECONFIG=__ENV__.kubeconfigRun kubectl commands:
kubectl get nodes