https://docs.rancher.cn/docs/rancher2.5/cli/_index

image.png
https://rancher.riyimei.cn/v3
token-j7n52
2vs674khhxhl82qkzbfvgkbjxmjk6sngg8j724hmv6btvrtrt44z77
token-j7n52:2vs674khhxhl82qkzbfvgkbjxmjk6sngg8j724hmv6btvrtrt44z77

image.png
image.png
image.png

  1. NUMBER CLUSTER NAME PROJECT ID PROJECT NAME PROJECT DESCRIPTION
  2. 1 riyimei-prod c-l7c4h:p-br2bz Default Default project created for the cluster
  3. 2 riyimei-prod c-l7c4h:p-gv66p riyimei
  4. 3 riyimei-prod c-l7c4h:p-v6c79 rbd-system
  5. 4 riyimei-prod c-l7c4h:p-vrdr9 System System project created for the cluster
  6. 5 local local:p-8hwx7 Default Default project created for the cluster
  7. 6 local local:p-rff8t System System project created for the cluster
  8. Select a Project:riyimei
  9. Invalid input, enter a number between 1 and 6: 2
  10. INFO[0148] Saving config to /root/.rancher/cli2.json

image.png

rancher 命令行

  1. [root@liwm ~]# rancher kubectl -n kube-system get pod
  2. NAME READY STATUS RESTARTS AGE
  3. calico-kube-controllers-6c8ddcb6cd-qj75t 1/1 Running 1 60d
  4. canal-29zz5 2/2 Running 2 60d
  5. canal-n9rt9 2/2 Running 37 60d
  6. canal-sdswf 2/2 Running 20 60d
  7. canal-vrgvm 2/2 Running 3 60d
  8. canal-xpldz 2/2 Running 2 60d
  9. coredns-656bcdc579-lcz44 1/1 Running 4 54d
  10. coredns-656bcdc579-nx4df 1/1 Running 3 54d
  11. coredns-autoscaler-79599b9dc6-ms9rj 1/1 Running 3 54d
  12. metrics-server-6cc9c79d8c-qbwrn 1/1 Running 21 60d
  13. rke-coredns-addon-deploy-job-gbmzf 0/1 Completed 0 60d
  14. rke-metrics-addon-deploy-job-lrq8q 0/1 Completed 0 60d
  15. rke-network-plugin-deploy-job-jqtpb 0/1 Completed 0 60d
  16. [root@liwm ~]#
  1. [root@liwm ~]# rancher -h
  2. Rancher CLI, managing containers one UTF-8 character at a time
  3. Usage: rancher [OPTIONS] COMMAND [arg...]
  4. Version: v2.4.9
  5. Options:
  6. --debug Debug logging
  7. --help, -h show help
  8. --version, -v print the version
  9. Commands:
  10. apps, [app] Operations with apps. Uses helm. Flags prepended with "helm" can also be accurately described by helm documentation.
  11. catalog Operations with catalogs
  12. clusters, [cluster] Operations on clusters
  13. context Operations for the context
  14. globaldns Operations on global DNS providers and entries
  15. inspect View details of resources
  16. kubectl Run kubectl commands
  17. login, [l] Login to a Rancher server
  18. multiclusterapps, [multiclusterapp mcapps mcapp] Operations with multi-cluster apps
  19. namespaces, [namespace] Operations on namespaces
  20. nodes, [node] Operations on nodes
  21. projects, [project] Operations on projects
  22. ps Show workloads in a project
  23. server Operations for the server
  24. settings, [setting] Show settings for the current server
  25. ssh SSH into a node
  26. up apply compose config
  27. wait Wait for resources cluster, app, project, multiClusterApp
  28. token Authenticate and generate new kubeconfig token
  29. help, [h] Shows a list of commands or help for one command
  30. Run 'rancher COMMAND --help' for more information on a command.
  31. [root@liwm ~]#