NAME DESCRIPTION STARS OFFICIAL AUTOMATED nginx Official build of Nginx. 11922 [OK] jwilder/nginx-proxy Automated Nginx reverse proxy for docker con… 1649 [OK] richarvey/nginx-php-fpm Container running Nginx + PHP-FPM capable of… 740 [OK] linuxserver/nginx An Nginx container, brought to you by LinuxS… 75 ...
可以看到有官方的镜像,下面我们就使用该官方镜像进行部署。
为部署nginx, 在master节点执行以下命令:
建立一个部署
1
kubectl create deployment nginx --image=nginx
系统显示:
1
deployment.apps/nginx created
立即使用
1
kubectl get deployment
1 2
NAME READY UP-TO-DATE AVAILABLE AGE nginx 0/1 1 0 79s
<!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> 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 <ahref="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <ahref="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p> </body> </html>