Examples of cluster run detection

Run a test case to check the cluster status

kubectl run nginx --image=nginx --replicas=3

kubectl get pod
查看容器跑在哪个节点上
kubectl get pod -o wide
暴露端口外部可以访问
kubectl expose deployment nginx --port=88 --target-port=80 --type=NodePort

查看端口,后面如果加名称,则表示查看指定服务端口例如:nginx
kubectl get svc 
//部署的应用配置文件
 kubectl edit deployment nginx

Access external browser only need to use the node node ip address plus the exposure of foreign ports to access applications

Encountered a problem when external and internal exposure and port access: iptables version is too low, look to upgrade iptables version, problem solving and access to external success

Guess you like

Origin www.cnblogs.com/jasonboren/p/11493280.html