Created
April 28, 2022 13:15
-
-
Save sjenning/13b1bc40f4156dee3f5b2bfc90206337 to your computer and use it in GitHub Desktop.
Script for extracting ignition for a nodepool in Hypershift
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
#!/bin/bash | |
set -eux | |
NODEPOOL=${NODEPOOL:-'example'} | |
SECRET=$(oc get secret | grep ^token-${NODEPOOL} | cut -f1 -d' ') | |
TOKEN=$(oc get secret ${SECRET} -ojsonpath='{.data.token}') | |
IGNPOD=$(oc get pod | grep ignition-server | cut -f1 -d' ') | |
oc rsh ${IGNPOD} /bin/curl --insecure -H "Accept: application/vnd.coreos.ignition+json; version=3.2.0" -H "Authorization: Bearer ${TOKEN}" -k https://127.0.0.1:9090/ignition | jq > ${NODEPOOL}.ign |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment