Kubernets command


kubectl commmand >
kubectl Command ResourceType/kind Recourcename(kubectl commmand)

Command get/describe/delete
ResourceType/Kind pod/namespace/replicaset/replicacontroller/deployments/configmap
Name mynameidpod/iamnamespace/iamreplicaset/iamconfigmap/

kubectl get pods (show running pods)
kubectl get pods -w (watch pods)
kubectl delete pod firstpod (delete pod)
kubectl label pod firstpod env=testing (add env in pod)
kubeclt label –overwrite pod firstpod env=prod (update inv)
kubectl label pod firstpod env- (delete env label)
kubectl run firstpod –generator=run-pod/v1 –image=nginx (start new pod)
kubectl label pods –all status=xyz (add label to all pods)
kubectl get pods –show-labels (show all pods with label)
kubectl run firstpod –dry-run –generator=run-pod/v1 –image=nginx (commmand check)
kubectl delete pods –all (delete all pods)
kubectl expalin pods (expain about pod)
kubectl create -f firstpod.yml
kubectl run secondpod –dry-run –generator=run-pod/v1 –image=nginx -o yaml (genrate yaml file)
kubectl apply -f firstpod.yml (create kubernet pod)
kubectl edit pod myfirstpod (edit running pod)
docker container exec -it ccc000152894 env (show env in container)
kubectl exec myfirstpod env (show env in container)
kubectl exec myfirstpod -it -c containername bash (login container)
kubectl expose pod thirdpod –port=8000 –target-port=80 –name myfirstservice (enable port in runnig container (with in cluster)thirdpod )
kubectl expose pod thirdpod –type=NodePort –port=8000 –target-port=80 –name myfirstservice1 (enabel port in container (with in network) )
kubectl get svc (check enable port in cluster)
kubectl delete pod –all (delete all pod)
kubectl delete rc –cascade=false firstreplicationcontroller (delete rc only without pods)
kubectl get pods -o wide –show-labels (show all pods)
kubectl edit rc firstreplicationcontroller {change replicase to 7} (change replicas no from rc edit command)
kubectl replace -f firstrc.yml (update replica set)

apiVersion: v1
kind: Pod

name: myfirstpod
env: prod

– name: containername
image: nginx

kubectl explain pod –recursive | less

1 Comment

  1. remove VERSION from satellite content-view

    [root@c3rhnsatellite02lp ~]# hammer content-view version list
    12 | Redhat_7_8 4.0 | 4.0 | |
    10 | Redhat_7_8 2.0 | 2.0 | | Library, Redhat7and8repo
    6 | Redhat_7_8 1.0 | 1.0 | A new version of Redhat_7_8 |
    1 | Default Organization View 1.0 | 1.0 | | Library
    [root@c3rhnsatellite02lp ~]# hammer content-view version delete –id 12

Leave a Reply

Your email address will not be published.