基于docker和cri-dockerd部署kubernetes v1.25.3( 四 )

 ? [root@k8s-master01 ~]#kubectl create service nodeport nginx --tcp=80:80 service/nginx created ? [root@k8s-master01 ~]#kubectl get svc NAME         TYPE      CLUSTER-IP    EXTERNAL-IP   PORT(S)      AGE kubernetes   ClusterIP   10.96.0.1       <none>        443/TCP      89m nginx      NodePort    10.103.151.47   <none>        80:31901/TCP   18s [root@k8s-master01 ~]#curl 10.103.151.47 <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> html { color-scheme: light dark; } body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p> ? <p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p> ? <p><em>Thank you for using nginx.</em></p> </body> </html> ? #外部访问任意node几点ip加端口(注意,随机产生)都可以访问

基于docker和cri-dockerd部署kubernetes v1.25.3

文章插图

推荐阅读