Last active
May 18, 2022 10:46
-
-
Save mulbc/57e40abaef48ff01d6e257a2c54848b4 to your computer and use it in GitHub Desktop.
Creates a machineset for ODF based on an existing machineset (only for VMWARE IPI)
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 | |
MACHINESET=$(oc get -n openshift-machine-api machinesets -o name | grep -v ocs | head -n1) | |
oc get -n openshift-machine-api "$MACHINESET" -o json | jq ' | |
del( .metadata.uid, .metadata.managedFields, .metadata.selfLink, .metadata.resourceVersion, .metadata.creationTimestamp, .metadata.generation, .status) | | |
(.metadata.name, .spec.selector.matchLabels["machine.openshift.io/cluster-api-machineset"], .spec.template.metadata.labels["machine.openshift.io/cluster-api-machineset"]) |= sub("worker";"ocs") | | |
(.spec.template.spec.providerSpec.value.numCPUs) |= 16 | | |
(.spec.template.spec.providerSpec.value.memoryMiB) |= 61036 | | |
(.spec.template.spec.metadata.labels["cluster.ocs.openshift.io/openshift-storage"]) |= ""' | oc apply -f - | |
OCS_MACHINESET=$(oc get -n openshift-machine-api machinesets -o name | grep ocs) | |
oc scale -n openshift-machine-api "$OCS_MACHINESET" --replicas=3 | |
oc scale -n openshift-machine-api "$MACHINESET" --replicas=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @mulbc , there is an issue with the cluster.ocs.openshift.io/openshift-storage label not getting applied, to get it working the path I used was the following '(.spec.template.spec.metadata.labels["cluster.ocs.openshift.io/openshift-storage"])'. Thanks!