Skip to content

Instantly share code, notes, and snippets.

@canhnt
Last active June 19, 2019 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save canhnt/164141dd7aa0b252e256b146747c1a5f to your computer and use it in GitHub Desktop.
Save canhnt/164141dd7aa0b252e256b146747c1a5f to your computer and use it in GitHub Desktop.
Rancher cmds

Get current cluster.yaml

kc get cm cluster-state -n kube-system -o jsonpath='{.data.cluster-state}'

Get user-addon settings:

kc get cm  -n kube-system rke-user-addon -o jsonpath='{.data}'

Get kubeconfig of a worker cluster from rancher: CONTID is the docker container id running rancher app

 docker exec $CONTID kubectl get secret c-$CLUSTERID -n cattle-system -o json | jq -r .data.cluster | base64 -d | jq -r .metadata.state > kubeconfig 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment