How to grab ignition files

I was helping a colleague grab the latest ignition files for his OpenShift Container Platform workers.

  1. Connect to the bastion
❯ ssh root@<hostname>
  1. List the master nodes and select a master node
❯ oc get nodes -lnode-role.kubernetes.io/master=
NAME                                                        STATUS   ROLES                  AGE     VERSION
master-0.ocp-power.xyz   Ready    control-plane,master   5d19h   v1.25.2+7dab57f
master-1.ocp-power.xyz   Ready    control-plane,master   5d19h   v1.25.2+7dab57f
master-2.ocp-power.xyz   Ready    control-plane,master   5d19h   v1.25.2+7dab57f
  1. Get the IP address
❯ oc get nodes master-2.ocp-power.xyz -o json | jq -r .status.addresses
[
  {
    "address": "192.168.100.240",
    "type": "InternalIP"
  },
  {
    "address": "master-2.ocp-power.xyz",
    "type": "Hostname"
  }
]
  1. The Machine Config Server has the latest igntion file
❯ curl https://192.168.100.240:22623/config/worker -k -H "Accept: application/vnd.coreos.ignition+json;version=3.2.0" | jq -r . > worker-$(date +%Y-%m-%d).ign

worker can be replaced with master or any other MachineConfigPool

The machine-config-server is hosted on each of the master nodes and the bootstrap node.

Note, this makes it download ignition version 3.2.0.

  1. Download the ignition file
❯ scp root@<hostname>:'~'/worker-$(date +%Y-%m-%d).ign .
worker-2023-03-02.ign                          100%  357KB 249.3KB/s   00:01    

You can use this file for your work with worker ignition.

Refer to https://github.com/openshift/machine-config-operator/blob/e39fea2d5c1d6991df4f7dd526b6292238f2ecfc/pkg/server/api.go#L196


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.