arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

cluster.md

We administrate all our operations through the use of kubectl.

hashtag
Prerequisites

Read up on the following materials,

hashtag
Requirements

  • kubectl

hashtag
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,

After the modification, this file is ready for use. Update your shell to always use this file,

To confirm it working,

hashtag
Common Operations

hashtag
See all nodes in cluster

hashtag
See a specific node

hashtag
See all deployed pods

  • Notice that -n clouddesktop-prod refers to the clouddesktop-prod k8s namespace

hashtag
See a specific pod

hashtag
Draining a node

K8s Conceptsarrow-up-right
kubectl cheatsheetarrow-up-right
Installation Guidearrow-up-right
# Update with the IP of the master node
- server: https://localhost:6443
+ server: https://123.123.123.123:6443
export KUBECONFIG=/.../k3s.yaml
kubectl get pods --all-namespaces
kubectl get nodes
kubectl describe node robotics-rover1
kubectl -n clouddesktop-prod get pods
kubectl -n clouddesktop-prod describe pod julianho-clouddesktop-deployment-abc123efg-123abc
kubectl drain robotics-rover2