K8S的常规命令

kubectl get node
kubectl get node -o wide
kubectl create -f *.yaml
kubectl apply -f *.yaml
kubectl get pod
kubectl get pod -o wide
kubectl get pod –show-labels
kubectl get pod -n kube-system
kubectl get pod -n kube-system -o wide
kubectl get podsall-namespaces
kubectl get pod -A
kubectl get job
kubectl get rs
kubectl get configmap -n metallb-system
kubectl get pv -o wide
kubectl get endpoints -o wide
kubectl describe pod_name
kubectl describe configmap -n metallb-system
kubectl delete pod pod_name
kubectl delete podall
kubectl apply -f deployment.yamlrecord
kubectl get deployment
kubectl set image deployment/deployment_name image_name=image_path
kubectl rollout status deployment/deployment_name
kubectl rollout undo deployment/deployment_name
kubectl rollout history deployment/deployment_name
kubectl delete deployment depname
kubectl delete deploymentall
kubectl api-versions
kubectl label pod podname app=php
kubectl label node nodename disktype=ssd
kubectl rolling-update redis-master -f redis-master-controller-v2.yaml
kubectl rolling-update redis-master –image=redis-master:2.0
kubectl logs pod_names
kubectl logs -f pod_names
kubectl cp container:/path/file_name /path/file_name
kubectl cp file_name container:/path/file_namecontainer
kubectl attach pod_name
kubectl cluster-info
kubectl exec -it podname — /bin/bash
kubectl scale rc rc_name –replicas=2
kubectl scale –replicas=2 deployment/deployment_name
kubectl create ns name_space
kubectl get ns
kubectl create role pod_name –verb=get,列表,watch –resource=pods –dry-run -o yaml
curl -s localhost:10249/proxyMode

发表评论