Platform-level automation in Red Hat OpenShift Container Platform (OCP) represents the core difference between running upstream vanilla Kubernetes and running an enterprise application platform. In a standard Kubernetes environment, platform engineers must build, maintain, and glue together external tools for provisioning infrastructure, managing operating systems, rotating certificates, and scaling compute nodes.
OpenShift treats the entire infrastructure stack as software. It automates the lifecycle of the cluster through a specialized hierarchy of operators, enabling true declarative Day-2 operations.
1. The Automation Hierarchy (The Control Loop)
OpenShift’s platform automation operates on a hierarchical loop. If a lower level drifts or encounters an issue, the higher levels orchestrate the remediation automatically.
┌────────────────────────────────────────────────────────┐
│ 1. Cluster Version Operator (CVO) │ ─── Tracks Cluster Version & Top-Level Operators
└───────────────────────────┬────────────────────────────┘
▼
┌────────────────────────────────────────────────────────┐
│ 2. Machine Config Operator (MCO) │ ─── Translates state into OS configurations
└───────────────────────────┬────────────────────────────┘
▼
┌────────────────────────────────────────────────────────┐
│ 3. Machine API Operator │ ─── Provisions/Destroys actual Infrastructure VMs
└────────────────────────────────────────────────────────┘
- The Brain (CVO): The Cluster Version Operator enforces the exact software footprint of the cluster, checking the central release payload and updating core operators in a strict dependency sequence.
- The OS Configurer (MCO): The Machine Config Operator ensures the underlying operating system (RHCOS) exactly matches the machine configs. It manages node reboots, kernel patches, and file injections via
rpm-ostree. - The Infrastructure Provider (Machine API): The Machine API Operator bridges the gap between the software cluster and the cloud provider (AWS, Azure, GCP, or vSphere), programmatically provisioning physical or virtual hardware resources.
2. Dynamic Infrastructure: The Machine API Operator
In traditional environments, scaling a cluster requires logging into a cloud console, spinning up a VM, configuring the network, running an installation script, and joining it to the cluster.
OpenShift automates this by bringing the concept of Custom Resource Definitions (CRDs) directly to virtual machines via the Machine API.
The Machine API Resource Stack:
- Machine: A declarative definition of a single node (VM or bare-metal). If a
Machineobject is deleted from the cluster, the Machine API actively calls the cloud provider’s API to terminate the underlying VM instance. - MachineSet: Similar to a Kubernetes
ReplicaSet, aMachineSetmaintains a desired count of identicalMachineobjects. If you change the replica count from 3 to 10, the operator instantly communicates with your infrastructure provider to spin up 7 new instances, configures them with Fedora/Red Hat CoreOS, and provisions them into the cluster cluster data plane.
3. Automated Horizontal Scaling: ClusterAutoscaler and MachineAutoscaler
To truly achieve automated platform operations, you can decouple human intervention from capacity planning by implementing the ClusterAutoscaler.
When a surge of user traffic hits your application, HPA (Horizontal Pod Autoscaler) will scale up your pods. If those pods fail to schedule because your current worker nodes are completely out of CPU or Memory resources, they transition to a Pending state. The autoscaling loop detects this bottleneck and reacts instantly:
Plaintext
┌─────────────────────┐ ┌──────────────────────┐ ┌───────────────────────┐
│ Pods enter PENDING │ ────► │ ClusterAutoscaler │ ────► │ MachineAutoscaler │
│ Due to No Node Room │ │ Evaluates Cluster Max│ │ Scales Target Match │
└─────────────────────┘ └──────────────────────┘ └───────────┬───────────┘
│
▼
┌─────────────────────┐ ┌──────────────────────┐ ┌───────────────────────┐
│ Cloud Provider │ ◄──── │ MachineSet Replicas │ ◄──── │ Dynamic Machine VM │
│ Provisions New VM │ │ Increments (+1) │ │ Created in API │
└─────────────────────┘ └──────────────────────┘ └───────────────────────┘
The Declarative Implementation
First, you establish a global ClusterAutoscaler limit policy to define the total resource boundaries for the entire cluster fleet:
YAML
apiVersion: autoscaling.openshift.io/v1kind: ClusterAutoscalermetadata: name: defaultspec: podPriorityThreshold: -10 # Ensures low-priority batch jobs don't trigger costly node scaling resourceLimits: maxNodesTotal: 100 # Hard ceiling limit for cluster size expansion cores: min: 16 max: 800 # Total CPU capacity safety cap memory: min: 64 max: 3200 # Total Memory capacity safety cap scaleDown: enabled: true # Scale down and delete nodes when traffic drops to save money delayAfterAdd: 10m unneededTime: 5m # How long a node must be completely idle before removal
Next, you map a specific MachineAutoscaler to watch your localized regional MachineSets, granting them the authorization to scale out within those global boundaries:
YAML
apiVersion: autoscaling.openshift.io/v1kind: MachineAutoscalermetadata: name: ecom-us-east-scaler namespace: openshift-machine-apispec: minReplicas: 3 maxReplicas: 12 # Allows this specific pool to scale up to 12 VMs scaleTargetRef: apiVersion: machine.openshift.io/v1beta1 kind: MachineSet name: cluster-prod-asdf-worker-us-east-1a # Targeted regional availability zone
4. Bare-Metal Automation: Metal3 and Ironic
While cloud autoscaling is straightforward via vendor APIs, OpenShift also automates physical hardware (Bare-Metal) infrastructure natively. It achieves this using an embedded upstream project named Metal3, combined with OpenStack’s Ironic engine.
The Provisioning Cycle:
- Discovery: You register the IPMI, iDRAC, or ILO management credentials of raw, un-provisioned physical blade servers into OpenShift as a
BareMetalHostcustom resource. - Power Management: When a new
Machineis requested via a bare-metal MachineSet, the Metal3 operator uses IPMI commands to programmatically power on the physical blade server. - PXE Boot / Virtual Media: The internal Ironic controller mounts the RHCOS Live ISO directly onto the physical server via virtual media or an internal PXE network network.
- Flashing the Operating System: The host boots the installer image, writes the core OpenShift Ignition files directly to the server’s raw physical NVMe drives, reboots, configures its local network bonds, and completes registration back to the master control plane entirely over-the-wire without a datacenter technician ever stepping into the server aisle.
5. Automated Day-2 Maintenance Operations
Beyond scaling nodes, OpenShift drives automated operational routines across the cluster lifecycle:
- Certificate Auto-Rotation: The platform contains internal certificate authorities (CAs) that validate communication lines between components like the API server, etcd, and kubelets. These internal certificates have strict expiration windows. OpenShift operators actively monitor these metrics and automatically handle cryptographic CSR generation, signature verification, and hot-renewal execution loops silently in the background before they expire, eliminating manual certificate management outages.
- Self-Healing Descheduler: If an administrator updates a node configuration or nodes get highly crowded over time, a cluster can develop unevenly distributed workloads (e.g., Node 1 is at 95% CPU utilization while Node 2 sits at 15%). The Descheduler Operator automatically audits the active workloads against utilization thresholds and systematically evicts pods from stressed nodes, allowing the default scheduler to re-balance applications across the fleet.