Skip to content

Instantly share code, notes, and snippets.

@zackbradys
Created January 30, 2024 02:54
Show Gist options
  • Save zackbradys/c8285d92906aa1b794361fab25f2989a to your computer and use it in GitHub Desktop.
Save zackbradys/c8285d92906aa1b794361fab25f2989a to your computer and use it in GitHub Desktop.

for imported clusters

export CLUSTERNAME=rke2-cluster-import

kubectl get clusterregistrationtokens.management.cattle.io -n $(kubectl get cluster -n fleet-default ${CLUSTERNAME} -o jsonpath='{.status.clusterName}') default-token -o json | jq -r '.status.command'

# insecure command
kubectl get clusterregistrationtokens.management.cattle.io -n $(kubectl get cluster -n fleet-default ${CLUSTERNAME} -o jsonpath='{.status.clusterName}') default-token -o json | jq -r '.status.insecureCommand'

for custom clusters

export CLUSTERNAME=rke2-cluster-custom

kubectl get clusterregistrationtokens.management.cattle.io -n $(kubectl get cluster -n fleet-default ${CLUSTERNAME} -o jsonpath='{.status.clusterName}') default-token -o json | jq -r '.status.nodeCommand'

# insecure command
kubectl get clusterregistrationtokens.management.cattle.io -n $(kubectl get cluster -n fleet-default ${CLUSTERNAME} -o jsonpath='{.status.clusterName}') default-token -o json | jq -r '.status.insecureNodeCommand'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment