关于微服务:k8s-cheat-sheet

2次阅读

共计 693 个字符,预计需要花费 2 分钟才能阅读完成。

Nodes 节点

https://kubernetes.io/docs/co…

节点上的组件包含 kubelet容器运行时 以及 kube-proxy

# 查看节点
kubectl get node

# 查看节点状态和其余信息
kubectl describe node <insert-node-name-here>

Workloads

在 Kubernetes 上运行的应用程序,是一组相干 pods 的汇合。

Pods

k8s 中创立和治理的、最小的可部署的计算单元

kubectl get pods
# 会显示所有命名空间下的 pods
kubectl get pods --all-namespaces 
# 以后命名空间下的 pod 会补充一些额定的信息
kubectl get pods -o wide 

kubectl get deployment xxx
# 查看 pod 相干事件列表
kubectl describe pod xxx
# 删除 pod
kubectl delete pod xxx

一些命令

# 显示运行中的 Pod、Service、Deployment 以及 ReplicaSet 的要害信息
kubectl get all 

# 端口裸露 
kubectl port-forward nginx 8080:80 --address=0.0.0.0

kubectl 查看和查找资源

https://kubernetes.io/docs/re…

minikube 相干

minikube start
minikube stop

minikube delete --all
minikube dashboard
# 增加代理 (外网拜访应用)
kubectl proxy  --address='0.0.0.0' --accept-hosts='^.*'
正文完
 0