K8s Objects
Pod
kubectl describe pod <pod_name>
Tells you status of containers
Number of containers
Types of containers
Logs if containers fails
kubectl run <pod_name> --image=<image_name> --dry-run=client -o yaml > file.yaml
Create yaml file for the pod
We can now implement by using
kubectl apply -f file.yaml
kubectl get pods -o wide
Gives more info about pod like nodes it is running on
Replicaset
kubectl edit rs <name-of-replicaset>
Lets you edit yaml of already created replicasets
kubectl scale rs/<name-of-replicasets> --replicas=<rs-number>
Lets you scale thereplicas without going & editing yaml
ReplicaSet commands
kubectl create -f rs.yaml
kubectl get replicaset
kubectl delete rs my-replicaset
kubectl replace -f replicaset-def.yaml
kubectl scale rs my-rs --replicas=6
Deployment
kubectl get all
- Shows deployment - Shows replicasets - Shows pods
Last updated