Basics of Kubernetes
For brevity, from now on I will use Kube rather than Kubernetes
This is a very basics of Kubernetes that are learned or learning through the internships. Later it will be organized into multiple small notes
- Kube starts with a yaml file where all the configs are written like what type of machine you need, what gpu, how many, ram, which harddisk to mount
kubectl apply -f main.yaml
-- this will start the pod/service/deploymentkubectl exec -it {pod_name} -- bash
-- runs the bash on the pod (very important command)kubectl port-forward {pod_name} {local_port}:{pod_port}
-- to forward a port from pod to localkubectl describe pod {pod_name}
-- to get the current situation of the podkubectl logs {pod_name}
-- get the logskubectl delete pod {pod_name}
-- del the podkubectl get pods
-- to get all the pods (running, pending, completed)