NAME: memcached LAST DEPLOYED: Thu May 2 21:19:47 2024 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: Memcached can be accessed via port 11211 on the following DNS name from within your cluster: memcached-memcached.default.svc.cluster.local
#If you'd like to test your instance, forward the port locally:
==> Linting /root/helm/app1/ [INFO] Chart.yaml: icon is recommended
1 chart(s) linted, 0 chart(s) failed
#安装 helm install nginx . NAME: nginx LAST DEPLOYED: Thu May 2 23:36:20 2024 NAMESPACE: default STATUS: deployed REVISION: 1 NOTES: 1. Get the application URL by running these commands: export NODE_PORT=$(kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services nginx-app1) export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT
#查看状态 kubectl get pods -owide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES nginx-app1-6c8ddfccb5-wbbwb 1/1 Running 0 13s 10.244.193.143 ws-k8s-node3 <none> <none>
kubectl get deploy NAME READY UP-TO-DATE AVAILABLE AGE nginx-app1 1/1 1 1 65s
kubectl get deploy --show-labels NAME READY UP-TO-DATE AVAILABLE AGE LABELS nginx-app1 1/1 1 1 9m33s app.kubernetes.io/instance=nginx,app.kubernetes.io/managed-by=Helm,app.kubernetes.io/name=app1,app.kubernetes.io/version=1.16.0,helm.sh/chart=app1-0.1.0
Release "nginx" has been upgraded. Happy Helming! NAME: nginx LAST DEPLOYED: Thu May 2 23:59:10 2024 NAMESPACE: default STATUS: deployed REVISION: 2 NOTES: 1. Get the application URL by running these commands: export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=app1,app.kubernetes.io/instance=nginx" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo"Visit http://127.0.0.1:8080 to use your application" kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT
# export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=app1,app.kubernetes.io/instance=nginx" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo"Visit http://127.0.0.1:8080 to use your application" kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT #http://127.0.0.1:8080
#测试 curl http://127.0.0.1:8080
#回显 <!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>
正常访问
回滚
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
查看历史版本 helm history nginx REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION 1 Thu May 2 23:36:20 2024 superseded app1-0.1.0 1.16.0 Install complete 2 Thu May 2 23:59:10 2024 deployed app1-0.1.0 1.16.0 Upgrade complete
回滚 helm rollback nginx 1 1是版本号 #Rollback was a success! Happy Helming!