Created
April 11, 2023 15:53
-
-
Save Oats87/a5d811a4f89fa50ce92a0658a73ea1b4 to your computer and use it in GitHub Desktop.
Get the init machine for a managed K3s/RKE2 cluster in Rancher. Requires jq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLUSTER_NAME="CLUSTER-NAME"; kubectl get rkebootstrap -n fleet-default $(kubectl get secrets -n fleet-default --field-selector=type=rke.cattle.io/machine-plan -l cluster.x-k8s.io/cluster-name="$CLUSTER_NAME",rke.cattle.io/init-node=true -o json | jq -r '.items[0].metadata.ownerReferences[0].name') -o json | jq -r '.metadata.ownerReferences[0].name' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment