$ minikube start Starting local Kubernetes v1.9.0 cluster... Starting VM... Getting VM IP address... Moving files into cluster... Setting up certs... Connecting to cluster... Setting up kubeconfig... Starting cluster components... Kubectl is now configured to use the cluster. Loading cached images from config file.
$ kubectl expose deployment/first-app --type="NodePort" --port=80 service "first-app" exposed
查看创建好的名为 first-app 的 service :
$ kubectl get svc first-app NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE first-app NodePort 10.102.0.12 <none> 80:30491/TCP 1m
在 PORT(S) 一栏中,除了 80 端口,后面还有一个 30491 端口。这是使用了“NodePort”类型创建 service 分配的端口,通过主机 ip 和这个端口,就可以访问到这个 service 了。可以使用 curl 工具进行访问:
$ curl 172.17.0.77:30491 <!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 <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>
$ kubectl get pod NAME READY STATUS RESTARTS AGE first-app-6db44b474-6vlrj 1/1 Running 0 39s first-app-6db44b474-dbbtp 1/1 Running 0 19m first-app-6db44b474-gjzgg 1/1 Running 0 39s
如果觉得 3 个太浪费资源了,想减少 pod 的数量,那么可以使用同样的命令,把 replicas 参数的值改为需要的值就可以了。
Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。
Sublime Text
Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。