100% found this document useful (1 vote)
569 views2 pages

Lab Scale Manual for OpenShift 4.14

This document contains instructions for manually scaling an OpenShift cluster. It logs in as the admin user, gets and edits the worker machineset to add a label and scale it to 3 replicas. It then creates a new project with a node selector, adds a role to a user, has that user create and scale a deployment, and scales the machineset back down before removing the label and deleting the project.

Uploaded by

Srinivasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
569 views2 pages

Lab Scale Manual for OpenShift 4.14

This document contains instructions for manually scaling an OpenShift cluster. It logs in as the admin user, gets and edits the worker machineset to add a label and scale it to 3 replicas. It then creates a new project with a node selector, adds a role to a user, has that user create and scale a deployment, and scales the machineset back down before removing the label and deleting the project.

Uploaded by

Srinivasan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

lab scale-manual start

source /usr/local/etc/ocp4.config

oc login -u admin -p ${RHT_OCP4_USER_PASSWD} ${RHT_OCP4_MASTER_API}

oc get machinesets -n openshift-machine-api

oc edit machineset ocp-qz7hf-worker-us-west-1b -n openshift-machine-api

labels:
env: prod

oc scale machineset ocp-qz7hf-worker-us-west-1b --replicas 3 -n openshift-machine-


api

oc get machines -n openshift-machine-api -o wide -l machine.openshift.io/cluster-


api-machine-role=worker

oc label node node1.us-west-1.compute.internal env=prod

oc get nodes -l node-role.kubernetes.io/worker -L env

oc adm new-project scale-manual --node-selector env=prod

oc adm policy add-role-to-user edit developer -n scale-manual

oc login -u developer -p ${RHT_OCP4_USER_PASSWD}

oc project scale-manual

oc create deployment manual --image quay.io/redhattraining/hello-world-nginx:v1.0

oc scale --replicas 6 deployment/manual

oc get pods -o wide

oc login -u admin -p ${RHT_OCP4_USER_PASSWD}

oc get nodes -l node-role.kubernetes.io/worker -L env

oc describe node node3.us-west-1.compute.internal

oc delete project scale-manual

oc get machinesets -n openshift-machine-api

oc scale machineset ocp-qz7hf-worker-us-west-1b --replicas 2 -n openshift-machine-


api

oc edit machineset ocp-qz7hf-worker-us-west-1b -n openshift-machine-api

remove

labels:
env: prod

oc label nodes -l env env


lab scale-manual finish

You might also like