Skip to content

Instantly share code, notes, and snippets.

@sjenning
Created April 28, 2022 13:15
Show Gist options
  • Save sjenning/13b1bc40f4156dee3f5b2bfc90206337 to your computer and use it in GitHub Desktop.
Save sjenning/13b1bc40f4156dee3f5b2bfc90206337 to your computer and use it in GitHub Desktop.
Script for extracting ignition for a nodepool in Hypershift
#!/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