kubectl Flashcards
get node info
kubectl get nodes
create my-nginx from nginx with 2 instances and expose 888->80
kubectl run my-nginx –image=nginx –replicas=2 –port=80 –hostport=8001
get deployments
kubectl get deployments
details of nginx deployment
kubectl describe deployment nginx
details of nginx pod
kubectl describe pod nginx
expose the container port 80 on the host 8000 binding to the external-ip of the host.
kubectl expose deployment http –external-ip=”172.17.0.7” –port=8000 –target-port=80
get services
kubectl get svc
details of a service http
kubectl describe svc http
scale my-nginx to 3 replicas
kubectl scale –replicas=3 deployment my-nginx
deploy spec..yaml to a new cluster
kubectl create -f spec.yaml
update spec.yaml to the existing cluster
kubectl apply -f spec.yaml
create a replica set
kubectl create -f replicase-definition.yaml
list replica sets
kubectl get replicates
delete replica set with all underlying pods
kubectl delete replicates my-app-replicaset
update the replicaset replicaset-definition.yaml
kubectl replace -f replicaset-definition.yaml