k8s启动

minikube start 开启全部集群
kubectl get pods -A 搜索pod个数
kubectl get nodes 列出集群中所有节点
kubectl get namespaces 列出所有命名空间
kubectl config view 查看配置
kubectl config current-context 当前上下文
kubectl config use-context <context-name> 切换指定上下文
kubectl get deployment 查看 Kubernetes 集群中的 Deployment 资源
kubectl get service
kubectl get rs 副本集相关信息
kubectl delete deployment hello-tryhackme 删除部署

kubectl apply -f <file.yaml> 应用一个或多个 YAML 配置文件来创建或更新资源
kubectl describe <resource> <name>如kubectl describe pod <pod-name>
kubectl logs <pod-name> 日志
kubectl exec -it <pod-name> -- <command> 进入交互终端
kubectl port-forward <pod-name> <local-port>:<pod-port> 端口转发

kubectl rollout status deployment/<deployment-name>查看部署状态
kubectl rollout undo deployment/<deployment-name> 回滚到上一个