Questions tagged [rancher-cli]

6 questions
3
votes
1 answer

Is there an API endpoint to get the kubeconfig file of a cluster from Rancher using its own API?

I'm trying to find a way to get the kubeconfig file using curl command and hit the rancher API. Is there an API endpoint to get that ? I tried calling these following endpoints but no…
Gautham
  • 33
  • 1
  • 3
2
votes
0 answers

rancher CLI - rancher login and connect specific cluster

The rancher login works and post login getting a prompt to chose the project. rancher login $URL --token $TOKEN I want to bypass the project prompt and would want to set the cluster context as well. please help rancher login $URL --token $TOKEN…
P Ekambaram
  • 15,499
  • 7
  • 34
  • 59
1
vote
0 answers

Is it possible to create a Rancher Project (kind: Project) via kubectl?

Is it possible to create a Rancher Project (kind: Project) for example via kubectl? I copied the YAML spec for a given project and changed the name of the project. 'kubectl apply' returns that it can not find the CRD for kind Projects. How is this…
user5580578
  • 1,134
  • 1
  • 12
  • 28
1
vote
1 answer

How can I automatically determine the version of Rancher?

Motivation. In the CI/CD pipeline of a project I am working on, I would like to use the Rancher CLI. To that end I need to install the version of the CLI that matches the version of the server. Concretely I'm looking to build a Docker image with the…
Just a student
  • 10,560
  • 2
  • 41
  • 69
1
vote
1 answer

Rancher: ranchercli switch context in script not interactively

I like to list all my contexts and switch to it from a command in my script, but it is interactively: c:\\dist\\ranchercli\\rancher.exe context switch NUMBER CLUSTER NAME PROJECT ID …
MortenB
  • 2,749
  • 1
  • 31
  • 35
0
votes
2 answers

Rancher - Create namespace within specific project via CLI

I would like to create a namespace within a project using the Rancher CLI. What I already did: rancher login https://URI --token abcde --context c-abc:p-abc rancher kubectl create namespace myns --dry-run=client -o yaml | rancher kubectl apply -f…
Maxster17
  • 5
  • 4