Rancher Cheatsheet


- PDF Link: cheatsheet-rancher-A4.pdf, Category: Cloud
- Blog URL: https://cheatsheet.dennyzhang.com/cheatsheet-rancher-A4
- Related posts: OpenShift CheatSheet, PKS CheatSheet, #denny-cheatsheets
1.1 Rancher Summary
Name | Command |
---|---|
Setup rancher in vagrant | GitHub: quickstart/vagrant, https://172.22.101.101/ admin/admin |
Start rancher control plane with container | docker run -d -p 80:80 -p 443:443 rancher/rancher |
Reference | Rancher v2.0 Documentation, Rancher Slack, Rancher Forum |
Reference | YouTube: Rancher Overview, YouTube: Setup Rancher In A Hard Way |
Reference | OpenShift CheatSheet, Rancher CheatSheet, PKS CheatSheet |
1.2 Rancher Components
1.3 rancher Concepts
Name | Command |
---|---|
Node driver | |
Node template |
1.4 rancher Command Line
Name | Command |
---|---|
Reference | Link: Rancher CLI |
Login to cluster | rancher login https://<SERVER_URL> --token <BEARER_TOKEN> |
Select project | rancher context switch |
Rancher ssh to vm | rancher ssh node-001 |
Run kubectl command | rancher kubectl get nodes |
1.5 Rancher Source Code
Name | Command |
---|---|
Rancher API Layer | GitHub: rancher/norman |
Rancher Kubernetes Engine | GitHub: rancher/rke, GitHub: rancher/kontainer-engine |
1.6 Rancher Footprint
> kubectl get all --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE cattle-system pod/cattle-cluster-agent-55897c6cb-xdj96 1/1 Running 0 6m cattle-system pod/cattle-node-agent-89jgs 1/1 Running 0 6m ingress-nginx pod/default-http-backend-797c5bc547-669zf 1/1 Running 0 6m ingress-nginx pod/nginx-ingress-controller-4gdhf 1/1 Running 0 6m kube-system pod/kube-dns-7588d5b5f5-xpfmg 3/3 Running 0 6m kube-system pod/kube-dns-autoscaler-5db9bbb766-kdhdn 1/1 Running 0 6m kube-system pod/kube-flannel-x686d 2/2 Running 0 6m kube-system pod/metrics-server-97bc649d5-8pf7f 1/1 Running 0 6m kube-system pod/rke-ingress-controller-deploy-job-7wn5h 0/1 Completed 0 6m kube-system pod/rke-kubedns-addon-deploy-job-2pzw6 0/1 Completed 0 6m kube-system pod/rke-metrics-addon-deploy-job-69zxc 0/1 Completed 0 6m kube-system pod/rke-network-plugin-deploy-job-bv4jc 0/1 Completed 0 6m NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE default service/kubernetes ClusterIP 10.43.0.1 <none> 443/TCP 7m ingress-nginx service/default-http-backend ClusterIP 10.43.142.185 <none> 80/TCP 6m kube-system service/kube-dns ClusterIP 10.43.0.10 <none> 53/UDP,53/TCP 6m kube-system service/metrics-server ClusterIP 10.43.20.15 <none> 443/TCP 6m NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE cattle-system daemonset.apps/cattle-node-agent 1 1 1 1 1 <none> 6m ingress-nginx daemonset.apps/nginx-ingress-controller 1 1 1 1 1 <none> 6m kube-system daemonset.apps/kube-flannel 1 1 1 1 1 <none> 6m NAMESPACE NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE cattle-system deployment.apps/cattle-cluster-agent 1 1 1 1 6m ingress-nginx deployment.apps/default-http-backend 1 1 1 1 6m kube-system deployment.apps/kube-dns 1 1 1 1 6m kube-system deployment.apps/kube-dns-autoscaler 1 1 1 1 6m kube-system deployment.apps/metrics-server 1 1 1 1 6m NAMESPACE NAME DESIRED CURRENT READY AGE cattle-system replicaset.apps/cattle-cluster-agent-55897c6cb 1 1 1 6m ingress-nginx replicaset.apps/default-http-backend-797c5bc547 1 1 1 6m kube-system replicaset.apps/kube-dns-7588d5b5f5 1 1 1 6m kube-system replicaset.apps/kube-dns-autoscaler-5db9bbb766 1 1 1 6m kube-system replicaset.apps/metrics-server-97bc649d5 1 1 1 6m NAMESPACE NAME DESIRED SUCCESSFUL AGE kube-system job.batch/rke-ingress-controller-deploy-job 1 1 6m kube-system job.batch/rke-kubedns-addon-deploy-job 1 1 6m kube-system job.batch/rke-metrics-addon-deploy-job 1 1 6m kube-system job.batch/rke-network-plugin-deploy-job 1 1 6m
1.7 Rancher CLI Help
Denny > ./rancher --help Rancher CLI, managing containers one UTF-8 character at a time Usage: rancher [OPTIONS] COMMAND [arg...] Version: v2.0.5 Options: --debug Debug logging --help, -h show help --version, -v print the version Commands: apps, [app] Operations with apps catalog Operations with catalogs clusters, [cluster] Operations on clusters context Operations for the context inspect View details of resources kubectl Run kubectl commands login, [l] Login to a Rancher server namespaces, [namespace] Operations on namespaces nodes, [node] Operations on nodes projects, [project] Operations on projects ps Show workloads in a project settings, [setting] Show settings for the current server ssh SSH into a node up apply compose config help, [h] Shows a list of commands or help for one command Run 'rancher COMMAND --help' for more information on a command.
1.8 More Resources
https://rancher.com/docs/rancher/v2.x/en/quick-start-guide/deployment/
License: Code is licensed under MIT License.