Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save williamcaban/0da1e06fccd251770575241a51d8e5e9 to your computer and use it in GitHub Desktop.

Select an option

Save williamcaban/0da1e06fccd251770575241a51d8e5e9 to your computer and use it in GitHub Desktop.

NOTE: This is an unofficial procedure. Do NOT use this outside a lab environment. The official procedure is described in the official OCP documentation -- https://docs.openshift.com/container-platform/4.3/machine_management/adding-rhel-compute.html

copy kubeconfig to /root/.kube/config 
copy pull secret to /tmp/pull.json

export MC_NAME=`oc get machineconfigpool worker --output=jsonpath='{.status.configuration.name}'`

oc get machineconfig $MC_NAME --output=json > /tmp/worker.json

export MCD_IMAGE=`oc get daemonset machine-config-daemon \
    --namespace=openshift-machine-config-operator \
    --output=jsonpath='{.spec.template.spec.containers[?(@.name=="machine-config-daemon")].image}'`

podman run --authfile /tmp/pull.json -v /:/rootfs -v /var/run/dbus:/var/run/dbus -v /run/systemd:/run/systemd \
--privileged --rm --entrypoint=/usr/bin/machine-config-daemon \
-ti $MCD_IMAGE start --node-name  $HOSTNAME --once-from /tmp/worker.json 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment