0% found this document useful (0 votes)
848 views1 page

OpenShift Auto-Scaling Setup Guide

The document describes how to configure automatic scaling on an OpenShift cluster. It provides commands to create ClusterAutoscaler and MachineAutoscaler custom resources to enable horizontal pod autoscaling and adding/removing worker nodes when resource usage thresholds are met. It then demonstrates the autoscaling by deploying a load testing application, scaling the deployment, and observing the pods and nodes scale up and down automatically based on resource usage.

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
0% found this document useful (0 votes)
848 views1 page

OpenShift Auto-Scaling Setup Guide

The document describes how to configure automatic scaling on an OpenShift cluster. It provides commands to create ClusterAutoscaler and MachineAutoscaler custom resources to enable horizontal pod autoscaling and adding/removing worker nodes when resource usage thresholds are met. It then demonstrates the autoscaling by deploying a load testing application, scaling the deployment, and observing the pods and nodes scale up and down automatically based on resource usage.

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
  • Deployment: Covers the process of deploying resources in the OpenShift environment.
  • Conclusion: Wraps up the lab with final directives to finish and document the exercise.
  • Scale Up: Describes the commands and steps to manually scale up the worker nodes in the cluster.
  • Configuration: Details the configurations required for setting up the cluster autoscaler and securing access.
  • Scale Down: Details the steps needed to reduce the number of active worker nodes after testing.
  • Initialization: Begins the lab scale automation process, preparing the environment and necessary configurations.

lab scale-automatic start

source /usr/local/etc/[Link]

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

vim ~/DO280/labs/scale-automatic/[Link]

resourceLimits:
maxNodesTotal: 6
scaleDown:
enabled: true

oc create --save-config -f ~/DO280/labs/scale-automatic/[Link]

oc get machinesets -n openshift-machine-api

vim ~/DO280/labs/scale-automatic/[Link]

spec:
minReplicas: 1
maxReplicas: 3
scaleTargetRef:
apiVersion: [Link]/v1beta1
kind: MachineSet
name: MACHINE-SET-NAME

oc create --save-config -f ~/DO280/labs/scale-automatic/[Link] -n


openshift-machine-api

oc login -u developer -p ${RHT_OCP4_USER_PASSWD}

oc new-project scale-automatic

oc create --save-config -f ~/DO280/labs/scale-automatic/[Link]

oc login -u admin -p ${RHT_OCP4_USER_PASSWD}

oc scale --replicas 3 deployment/loadtest -n scale-automatic

watch oc get pods -o wide -n scale-automatic

watch oc get nodes -l [Link]/worker

oc delete project scale-automatic

oc delete clusterautoscaler default

oc delete machineautoscaler scale-automatic -n openshift-machine-api

oc get machinesets -n openshift-machine-api

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


api

lab scale-automatic finish

You might also like