Repo containing resource for rancher deployment and usage.
While most of the stuffs are documented at rancher-cli (and it will work almost everytime) , This document contains any issue that you might while using the rancher's cli.
So what you need in all ?
- Windows/Linux/MacOs
- Rancher CLI binary for you host rancher-cli-download
- kubectl for firing containers in rancher installing-kubectl
- Bearer Token generate token
Please use "no-scope" while creating API for user. see this issue
Assuming your rancher-cli binary is at /usr/bin/rancher
/usr/bin/rancher login https://<SERVER_URL> --token <BEARER_TOKEN>
Accept the Insecure PKI key prompt when asked. Select the context from the list of the context
Alternatively, To run command without any user interaction.
For below command you need PROJECT_ID. To retrieve it, you can checkout output of https://<SERVER_URL>/v3/projects?sort=description. Check the "data" field in the json and you will get all the projects details in it. The "id" field is what your project id will be. Check the "name" field to cross verify your project
/usr/bin/rancher login https://<SERVER_URL> --token <BEARER_TOKEN> --skip-verify --context <PROJECT_ID>
/usr/bin/rancher ps
/usr/bin/rancher kubectl apply -f <yaml file>
For yaml file sample, checkout nginx-deployment
/usr/bin/rancher kubectl delete -f <yaml file>