1. # 创建一个可以自我修复的 pod
    2. kubectl create deployment hello-node --image=nginx
    3. kubectl get deployment
    4. kubectl get pods
    5. kubectl get events
    6. kubectl config view
    7. # 集群外可以访问(集群内应用的指定端口暴露出去)
    8. # type
    9. # ClusterIP 集群内生成的ip地址访问 eg: 10.1.84.17:8080
    10. # NodePort 集群外访问,所在节点IP地址 eg: 127.0.0.1:32635
    11. # LoadBalancer 仅由云提供商支持
    12. kubectl expose deployment hello-node --type=NodePort --port=8080 --target-port=80
    13. kubectl get services
    14. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
    15. hello-node NodePort 10.1.84.17 <none> 8080:32635/TCP 3s
    16. curl 127.0.0.1:32635
    17. kubectl delete serivce hello-node
    18. kubectl delete deployment hello-node

    services - 图1