We have announced the availability of Oracle Cloud Infrastructure (OCI) Container Instances, a serverless compute service that enables you to instantly run containers without managing any servers. In this article, we dive into using Container Instances.
This video walks you through the creation of a container instance to run a full-stack application with the following steps:
Provide container instance details
Specifying the container images and the launch configuration
Reviewing and creating the container instances
We also showcase logging and monitoring for your containerized applications. For written instructions to accompany the video, see the Instructions section.
In the Oracle Cloud Console, navigate to Developer Services and select Container Instances. Click Create container instance. The guidance provides a simple experience to create container instances.
Step 1: Provide container instance details.
General information: Provide a name for your container instance and, optionally, a compartment for your container instance.
Placement: Select the OCI availability domain and fault domain in which you want the container instance to run.
CPU and memory requirements: Select a processor shape and the number of cores and memory you want to allocate to your container instance. Container Instances service isn’t just suitable for lightweight workloads, but also for the most resource-intensive applications. You can allocate all the CPU and memory provided by the underlying Compute shape to a container instance. For example, you can allocate up to 64 cores (128 vCPUs) and 1024-GB memory to a single container instance by selecting E3 or E4 Flex shapes.
Networking: Select a virtual cloud network (VCN) and a subnet to connect the container instance. Through native integration with OCI VCN, you can control the traffic to your application. Each container instance connects to your VCN using a virtual network interface card (VNIC) and gets a private IP address. You can also assign a public IP to expose your application to the internet. Using network security groups (NSGs), you can configure ingress and egress rules to control the traffic to and from your application.
Restart policy and graceful shutdown timeout: Expand the advanced options to uncover the container restart policy and graceful shutdown timeout. The container restart policy is used to control how containers restart automatically. You have the options of always, never, and on failure. Graceful shutdown timeout lets you define the amount of time the running containers have to stop gracefully.
Step 2: Specify the container images and the launch configuration:
Container image: Select the container image for each container you want to process. Container Instances supports pulling images from any public or private container registries compliant with Open Container Initiative. Through the native integration with OCI Container Registry, you can use private repositories and image scanning, for improved security.
Control the running of your containers: You can optionally set environment variables to customize the processing of your containers, such as MYSQL_PASSWORD: XXXX.
If you’re running multiple containers on the same container instance, you can enable resource throttling to restrict the amount of CPU and memory each container can consume. You can also override the entry point command and arguments for each container. For example, you can specify more arguments to the entry point of your container image.
Step 3: Review and create: Review the settings for your container instances and click Create.
Your containerized application is now running and is accessible through its public or private IP. You can now monitor and check your application logs.
Container Instances provides built-in logging so that you can view container logs on the Oracle Cloud Console or pull them using the API.
It also provides built-in metrics to monitor the performance such as CPU and memory utilization, disk I/O, network receive and transmit bytes, and so on. You can view these metrics on the Container Instances console or access them in the OCI Monitoring service.
OCI Container Instances service provides a simple, quick, and secure way to run containers without managing any servers. Unlike other cloud providers, you don't pay any extra charges for the serverless experience of OCI Container Instances, giving you the best value option for running containers in the cloud.
Sign up to attend our webcast in January 2023, where we share how customers use OCI Container Instances!
For running your containerized apps on Kubernetes without managing infrastructure, see Oracle Container Engine for Kubernetes (OKE).
For more information about Oracle Cloud Infrastructure Container Instances, see the following resources:
OCI Serverless Containers, Kubernetes, and Functions services.