You can now use Oracle Cloud Infrastructure (OCI) Compute capacity reservations to create Oracle Container Engine for Kubernetes (OKE) worker nodes. Reserving capacity provides you with the confidence that Compute resources are available when you need them most, such as recovering from a disaster or an unexpected workload spike.
What are capacity reservations?
Capacity Reservations enable you to reserve virtual machine (VM) and bare metal Compute instance capacity in advance to ensure that resources are available for a tenancy to consume when needed. Without reserved capacity, you can find yourself in a situation where a specific fault domain or availability domain within a region no longer has available capacity for a given Compute shape. In this case, you need to wait until capacity is returned to the pool to provision more Compute instances to support your workloads. In many situations, waiting isn’t an option, such as ensuring that capacity is available when failing over to a secondary location or providing buffer capacity for unexpected workload spikes.
By adding support for capacity reservations to OKE, you can experience peace of mind that capacity is available for your containerized workloads during critical events.
Capacity reservations also play a useful role in cost-optimization. Because capacity reservations cost less than running instances, using them to maintain backup or buffer capacity for the use cases mentioned is more cost-effective than using always-on hot-spares or extra worker nodes. You can modify, delete, and create capacity reservations at any time to match the shifting needs of the business. They have no minimum time commitment.
Using capacity reservations
You can choose to use an existing capacity reservation or create a capacity reservation in the Compute service. Afterwards, you pass the matching capacity reservation ID into an OKE node pool as a parameter in the placement configuration, which is also used to control the placement of nodes in availability domains and OCI virtual cloud network (VCN) subnets. Ensure that the node shape and availability domain in the node pool’s placement configuration match the capacity reservation’s instance type and availability domain to ensure that instances deploy as expected.
After specifying a capacity reservation, nodes added to the node pool are created using Compute instances from the associated reservation. This process continues if sufficient capacity is available.
To create a node pool with a capacity reservation, I included the capacity reservation ID in the placement configuration of the node pool.
oci ce node-pool create \
--cluster-id ocid1.cluster.oc1.iad.aaaaaaaaaf______jrd \
--name capacity-reservation-example \
--node-image-id ocid1.image.oc1.iad.aaaaaaaa6______nha \
--compartment-id ocid1.compartment.oc1..aaaaaaaay______t6q \
--kubernetes-version v1.21.5 \
--node-shape VM.Standard2.1 \
--placement-configs "[{\"availabilityDomain\":
\"IqDk:US-ASHBURN-AD-1\", \"capacityReservationId\":
\"ocid1.capacityreservation.oc1.iad.anuwcljt2ah______yeq\", \"subnetId\":
\"ocid1.subnet.oc1.iad.aaaaaaaa2xpk______zva\"}]" \
--size 1 \
--region=us-ashburn-1
Default reservations
OKE also supports the use of default capacity reservations when deploying worker nodes. Default reservations are capacity reservations that apply to all instances created in the tenancy and availability domain associated with the reservation. Having created a default capacity reservation, all Compute instances, including worker nodes, launched in that availability domain and tenancy use capacity from the default capacity reservation where possible.
Sometimes, you don’t want to provision worker nodes from a default capacity reservation. Instead, you can specify an alternative capacity reservation in the placement configurations parameter of your node pool or choose to opt out of the default reservation and launch on nodes using on-demand Compute capacity.
Conclusion
The ability to provision worker nodes from reserved capacity ensures that Compute users and users with containerized workloads running on Kubernetes have enough resources at their disposal when they’re needed most. You no longer need to wait for other users to release on-demand capacity or overprovision hot standby worker node hosts to guarantee the availability of capacity. Now you have a cost-effective way to ensure the continuity of you containerized environments and the business you support.
To learn more, use the following resources:
- Access OKE resource center for product details and testimonials.
- Learn more about OKE from our documentation.
- Try out using capacity reservations yourself.
- Get started with Oracle Cloud Infrastructure today with our Oracle Cloud Free Tier.
