cluster.md
We administrate all our operations through the use of kubectl.
Prerequisites
Read up on the following materials,
Requirements
kubectlInstallation Guide
Setup
To access the K8s cluster, you will need to have a k3s.yaml credential file. It can be obtained by ssh into the master node of the cluster, under the directory /etc/rancher/k3s/k3s.yaml.
Once you have obtained the k3s.yaml file, make the following modification,
# Update with the IP of the master node
- server: https://localhost:6443
+ server: https://123.123.123.123:6443After the modification, this file is ready for use. Update your shell to always use this file,
export KUBECONFIG=/.../k3s.yamlTo confirm it working,
kubectl get pods --all-namespacesCommon Operations
See all nodes in cluster
kubectl get nodesSee a specific node
kubectl describe node robotics-rover1See all deployed pods
Notice that
-n clouddesktop-prodrefers to the clouddesktop-prod k8snamespace
kubectl -n clouddesktop-prod get podsSee a specific pod
kubectl -n clouddesktop-prod describe pod julianho-clouddesktop-deployment-abc123efg-123abcDraining a node
kubectl drain robotics-rover2Last updated
Was this helpful?
