Installing and configuring kubectl
kubectl is the command line tool for Kubernetes. It allows you to deploy and manage applications on Kubernetes.
Installing kubectl
- Follow the instructions on the Kubernetes website to install kubectl. It has install instructions for mac, linux, and windows. or for quick install on windows run the following command:
winget install -e --id Kubernetes.kubectl
Configuring kubectl
- Get the kubeconfig file from vaultwarden. It is placed in "Kubernetes" collection with name "Kubernetes Config for kubectl".
- Copy the content from vaultwarden and create a file called
kubeconfig.yaml in .kube folder in your home directory. For windows users, it is C:\Users\<username>\.kube\. Create the folder if it doesn't exist.
- create a environemnt variable called
KUBECONFIG and set it to the path of the kubeconfig file. so in windows it would be C:\Users\<username>\.kube\kubeconfig.yaml.
Testing kubectl
- Run the following command to check if kubectl is installed correctly:
- Run the following command to check if kubectl is configured correctly:
It should list the strato nodes of the cluster.