https://docs.rancher.cn/docs/rancher2.5/cli/_index
https://rancher.riyimei.cn/v3
token-j7n52
2vs674khhxhl82qkzbfvgkbjxmjk6sngg8j724hmv6btvrtrt44z77
token-j7n52:2vs674khhxhl82qkzbfvgkbjxmjk6sngg8j724hmv6btvrtrt44z77
NUMBER CLUSTER NAME PROJECT ID PROJECT NAME PROJECT DESCRIPTION
1 riyimei-prod c-l7c4h:p-br2bz Default Default project created for the cluster
2 riyimei-prod c-l7c4h:p-gv66p riyimei
3 riyimei-prod c-l7c4h:p-v6c79 rbd-system
4 riyimei-prod c-l7c4h:p-vrdr9 System System project created for the cluster
5 local local:p-8hwx7 Default Default project created for the cluster
6 local local:p-rff8t System System project created for the cluster
Select a Project:riyimei
Invalid input, enter a number between 1 and 6: 2
INFO[0148] Saving config to /root/.rancher/cli2.json
rancher 命令行
[root@liwm ~]# rancher kubectl -n kube-system get pod
NAME READY STATUS RESTARTS AGE
calico-kube-controllers-6c8ddcb6cd-qj75t 1/1 Running 1 60d
canal-29zz5 2/2 Running 2 60d
canal-n9rt9 2/2 Running 37 60d
canal-sdswf 2/2 Running 20 60d
canal-vrgvm 2/2 Running 3 60d
canal-xpldz 2/2 Running 2 60d
coredns-656bcdc579-lcz44 1/1 Running 4 54d
coredns-656bcdc579-nx4df 1/1 Running 3 54d
coredns-autoscaler-79599b9dc6-ms9rj 1/1 Running 3 54d
metrics-server-6cc9c79d8c-qbwrn 1/1 Running 21 60d
rke-coredns-addon-deploy-job-gbmzf 0/1 Completed 0 60d
rke-metrics-addon-deploy-job-lrq8q 0/1 Completed 0 60d
rke-network-plugin-deploy-job-jqtpb 0/1 Completed 0 60d
[root@liwm ~]#
[root@liwm ~]# rancher -h
Rancher CLI, managing containers one UTF-8 character at a time
Usage: rancher [OPTIONS] COMMAND [arg...]
Version: v2.4.9
Options:
--debug Debug logging
--help, -h show help
--version, -v print the version
Commands:
apps, [app] Operations with apps. Uses helm. Flags prepended with "helm" can also be accurately described by helm documentation.
catalog Operations with catalogs
clusters, [cluster] Operations on clusters
context Operations for the context
globaldns Operations on global DNS providers and entries
inspect View details of resources
kubectl Run kubectl commands
login, [l] Login to a Rancher server
multiclusterapps, [multiclusterapp mcapps mcapp] Operations with multi-cluster apps
namespaces, [namespace] Operations on namespaces
nodes, [node] Operations on nodes
projects, [project] Operations on projects
ps Show workloads in a project
server Operations for the server
settings, [setting] Show settings for the current server
ssh SSH into a node
up apply compose config
wait Wait for resources cluster, app, project, multiClusterApp
token Authenticate and generate new kubeconfig token
help, [h] Shows a list of commands or help for one command
Run 'rancher COMMAND --help' for more information on a command.
[root@liwm ~]#