Commands


|- Worker node
  |- Docker runtime
    |- Namespace
      |- POD
        |- Container(Application), Container(sidecar)
      

Check Architecture

Namespace Commands


$ systemctl status kubectl       //if kubernets is installed

$ kubectl create namespace my-namespace                                 // Create namespace
$ kubectl config  set-context --current --namespace=my-namespace        // Make namespace default

// List namespaces
$ kubectl get namespaces
$ kubectl get pods -n my-namespace
      

Pod Commands


$ kubectl get pods                                    // List all pods in default namespace
$ kubectl get pods -A

$ kubectl delete deployment pod-name                                    // Delete pods
$ kubectl delete deployment pod-name --all --grace-period=0 --force

$ kubectl apply -f depolyment.yaml                                    // Create pod inside namespace(namespace name provided inside yml file)

$ kubectl describe pod pod-name -n my-namespace             //List all containers in pod
      

General Commands


$ docker ps                                           //List all running containers
$ docker inspect 7d8b5d857e84   

$ docker rm container-id
            

Container Commands


$ sudo docker exec -it <container-name> bash      // Go into container
$ sudo netstat -lpantu        //u=udp,t=tcp           //List process and ports<