OpenShift sandboxed containers on ROSA HCP
This content is authored by Red Hat experts, but has not yet been tested on every supported configuration. This guide has been validated on OpenShift 4.20. Operator CRD names, API versions, and console paths may differ on other versions.
This guide shows how to install OpenShift sandboxed containers (OSC) 1.13.1 on an existing Red Hat OpenShift Service on AWS (ROSA) cluster with hosted control planes (HCP) and STS. Use the rosa, oc, aws, and jq CLIs. If you need to create a cluster, see
Deploying a ROSA HCP cluster with Terraform
.
The flow in this guide covers:
- creating an IAM Roles for Service Accounts (IRSA) role for OSC
- installing the Operator with
ROLEARNand a Manual InstallPlan - opening worker security group ports for peer pods
- creating
peer-pods-cmand aKataConfig - running a
kata-remotesample workload (validates peer pods when metal is not available) - adding a metal machine pool for local
kata(preferred for sandboxed workloads) - cleaning up Operator, AWS, and IAM resources
This guide was validated on ROSA HCP 4.20.32 in ap-southeast-2 with default m5.xlarge workers (peer pods) and an optional c5n.metal machine pool (local Kata).
Technology Preview
AWS STS authentication and HCP AWS peer pods are Technology Preview in OpenShift sandboxed containers 1.13. They are not supported with Red Hat production SLAs and might not be functionally complete. Do not use this configuration for production workloads. See Technology Preview Features Support Scope .
About OSC on ROSA HCP
OSC adds optional RuntimeClass objects. On ROSA HCP, the two RuntimeClasses that matter are:
| RuntimeClass | Handler | Where the VM runs | Needs metal workers? |
|---|---|---|---|
kata |
Local Kata / QEMU on the worker | Nested VM on the worker node | Yes. Needs /dev/kvm (Intel or AMD bare metal). Fails on m5.xlarge. |
kata-remote |
Cloud API Adaptor (CAA) plus a peer pod | A separate EC2 instance (pod VM) in the same VPC, subnet, and security group as the worker | No. Works on m5.xlarge. |
For sandboxed workloads on ROSA HCP, prefer local kata on a metal machine pool. Pods stay on ROSA workers, schedule through normal Kubernetes controls, and you can overcommit CPU and memory on the metal node like any other worker. kata-remote peer pods launch a separate EC2 instance per pod outside that model: one pod VM per workload, no cluster overcommit, and extra AWS IAM, networking, and cost outside the ROSA data plane. Use peer pods when you cannot add metal workers, or to validate the peer-pod path in a lab.
Setting enablePeerPods: true on KataConfig installs both classes (and kata-nvidia-gpu in 1.13). Local kata requires a metal machine pool. Peer pods work on standard ROSA workers but are not the preferred runtime for ongoing workloads.
ROSA HCP has no Cloud Credential Operator path for OSC. Create an IRSA role and pass ROLEARN on the Operator Subscription. Do not reuse one OSC IAM role across clusters. The OIDC issuer is per cluster.
Prerequisites
- An existing ROSA HCP cluster with STS, at least one Ready worker, and
cluster-adminaccess. This procedure does not apply to ROSA Classic. If you create that cluster with Terraform, run Terraform in a clean shell. InheritedTF_VAR_*values (cluster name, region) override module defaults and can target a cluster that is still deleting. - OpenShift 4.18.38 or later (OSC 1.13 install prerequisite). Confirm the current OSC compatibility matrix for HCP AWS peer pods. Some matrices list a later 4.20.z than that operator prerequisite.
- Operator catalog
redhat-operators(default on ROSA) rosaCLI, logged in (rosa whoami)ocCLI- AWS CLI v2 with permission to create IAM roles and policies, plus
ec2:AuthorizeSecurityGroupIngress,ec2:DescribeInstances, andec2:CreateTags jq
Decide the test scope before you start:
| Goal | Extra cost | Sections |
|---|---|---|
Preferred: local kata on metal |
Several USD per hour for the cheapest Intel metal in the Region (for example c5n.metal) |
Full guide through Local Kata on Intel metal |
Peer pods only (kata-remote) when metal is not an option |
About one t3.medium per running peer pod |
IAM through section 8, then cleanup |
Do not leave a metal machine pool running after a lab test. For production sandboxed workloads, plan a dedicated metal pool and size it for expected overcommit like any other worker pool.
1. Verify identity and the cluster
-
Confirm CLI identity.
-
Set the ROSA cluster name and confirm it is HCP with Ready workers.
-
Confirm the cluster OIDC issuer (STS).
Expect a URL such as
https://oidc.op1.openshiftapps.com/<oidc-id>.
2. Create the STS IAM role
Create the role before you install the Operator. See Configure an IAM role for STS authentication .
-
Collect the account ID and OIDC provider.
-
Write the trust policy.
Official 1.13 trust is scoped to:
- Service account:
system:serviceaccount:openshift-sandboxed-containers-operator:default - Audience:
openshift
The Operator projects a token with audience
openshift. Use that audience in the trust policy. IfAssumeRoleWithWebIdentityfails, see Troubleshooting . - Service account:
-
Create the role and attach two policies:
- Runtime (keep):
AmazonEC2FullAccessso CAA can create and terminate peer-pod EC2 instances. You can replace this with a tighter EC2 policy later. - Image build (temporary): a customer-managed policy for the
vmimportrole andpodvm-*S3 buckets. Detach it after the AMI exists.
Expected attached policies:
AmazonEC2FullAccessand${POLICY_NAME}. - Runtime (keep):
3. Install the Operator
-
Create the namespace and an
OwnNamespaceOperatorGroup. -
Create a Subscription that pins CSV 1.13.1, sets
ROLEARN, and uses ManualinstallPlanApprovalso you can confirm permissions before CSV upgrades. -
Approve the InstallPlan for
sandboxed-containers-operator.v1.13.1.Wait until
PHASEisSucceededforsandboxed-containers-operator.v1.13.1. -
Confirm STS wiring on the controller Deployment.
ROLEARNshould match the role you created. The Operator createspeer-pods-secretlater, when you create theKataConfig. Do not share secret contents.
4. Open worker security group ports 15150 and 9000
The peer-pod shim talks to the kata-agent on the EC2 VM (TCP 15150) and the tunnel (TCP 9000). Rules are self-referential on the worker security group.
These authorize-security-group-ingress calls are not idempotent. A second run returns InvalidPermission.Duplicate. Inspect existing rules first. The following commands use || true so a duplicate does not stop the loop.
ROSA worker security groups already include TCP/UDP 9000-9999 for internal cluster communication. Still add the exact TCP 9000 and TCP 15150 self-references from the OSC documentation. When you clean up, revoke only those extra OSC rules. Do not delete the 9000-9999 range.
-
Resolve a worker instance, region, and security groups.
-
Inspect existing rules, then add the OSC self-references.
5. Create peer-pods-cm
-
Pull VPC, subnet, and security group IDs from the same worker instance CAA uses for pod VMs.
-
Create the ConfigMap. Leave
PODVM_AMI_IDempty. The Operator fills it after the image job. Do not set a placeholder AMI ID.DISABLECVM: "true"is required on AWS unless you use confidential VMs, which this guide does not cover. OSC 1.13 usesPROXY_TIMEOUT: "8m".The OSC 1.13 pod VM AMI is imported with TPM 2.0. Do not include
t2.*types inPODVM_INSTANCE_TYPES. CAA selects a type from that list based on the pod’s CPU and memory requests, andt2.smallfails withUnsupportedOperation(AMI TPM v2.0). Use Nitro types such ast3.mediumandt3.large.
6. Create KataConfig
-
Create the
KataConfig. An empty selector applies Kata to all workers.Optional: set
spec.kataConfigPoolSelector.matchLabelsto limit which workers get Kata. -
Confirm
peer-pods-secretnow exists andAWS_ROLE_ARNmatches${ROLEARN}.
ROSA HCP does not reboot workers via MachineConfig
The OpenShift sandboxed containers documentation describes creating a KataConfig as a MachineConfig change that reboots workers (often 10 to 60 minutes or more). That procedure applies to self-managed OpenShift.
On ROSA HCP, MachineConfig is not available on workers. OSC installs with a DaemonSet (osc-rpm-install) and an rpm-ostree live layer. Workers are labeled node-role.kubernetes.io/kata-oc= and kataconfiguration.openshift.io/kata-ds-rpm-install=installed. Workers do not reboot. Do not wait for a reboot. After KataConfig is ready, wait for the pod VM AMI job.
-
Watch install progress.
Worker RPM install can finish (
COMPLETEDequalsTOTAL) whileINPROGRESSstaysTruebecause the operator is still creating the pod VM AMI.waitingForMcoToStartstaysfalseon ROSA HCP. Do not wait for a MachineConfig reboot.Expect
osc-rpm-installfirst. After the AMI exists, also expectosc-caa-ds(one CAA pod perkata-ocnode) andopenshift-sandboxed-containers-monitor.RuntimeClasses
kataandkata-nvidia-gpuappear when the RPMs are installed.kata-remoteappears after the AMI job completes.
7. Wait for the pod VM AMI
This job is the first end-to-end check of STS and IRSA. The job osc-podvm-image-creation uses IRSA to create vmimport, an S3 podvm-* bucket, and an AMI. Uploading the raw disk (about 10 GiB) and AWS snapshot conversion often takes 10 minutes or more.
-
Follow the job until
peer-pods-cmhas a real AMI ID.Wait until the value is an
ami-...ID. If the job fails with STS or audience errors, fix the IAM trust and re-run. Do not use static AWS access keys. -
Optional: detach the image-creation policy after the AMI exists. Reattach it if you need to rebuild the AMI. Keep
AmazonEC2FullAccess(or a tighter EC2 policy) for CAA.
8. Test peer pods (kata-remote)
Use this section to validate peer pods when you cannot add metal workers, or as a lab check after OSC install. For ongoing sandboxed workloads, prefer local Kata on Intel metal so pods stay on ROSA workers and you can overcommit CPU and memory on the metal pool.
Do not put test workloads in the Operator namespace.
-
Create a sample pod.
-
Verify the following:
- Pod
Running1/1(often about two to three minutes while the peer EC2 instance boots). - CAA launched an EC2 instance named like
podvm-osc-peer-ec2-*(t3.mediumunless overridden), in the same VPC, subnet, and security group as the workers. - The pod IP is on the cluster overlay. The peer VM has a different private IP in the worker subnet.
- Pod
Use pod Ready and a running peer EC2 instance as the functional test. The default Kata agent policy allows oc exec, but oc exec into kata-remote can hang. For production, disable ExecProcessRequest in the
Kata agent policy
.
Optional: override the peer VM instance type on the pod:
```yaml
metadata:
annotations:
io.katacontainers.config.hypervisor.machine_type: t3.medium
```
9. Local Kata on Intel metal (preferred for workloads)
Prefer this path for sandboxed workloads on ROSA HCP. Pods use runtimeClassName: kata on ROSA metal workers: they schedule and scale like any other pod, CPU and memory can be overcommitted on the pool, and workloads stay inside the ROSA platform. Peer pods (kata-remote) remain useful when metal is not available, but each peer pod provisions a separate EC2 instance with no overcommit.
runtimeClassName: kata needs /dev/kvm on the worker. Nested virtualization on m5.xlarge is not available. A kata pod on m5.xlarge fails with FailedCreatePodSandBox / DeadlineExceeded after about four minutes.
Metal instances are expensive. For a lab, use one replica, pick the cheapest Intel metal type ROSA HCP offers in the cluster Availability Zone, and delete the pool in the same session. For production, size a dedicated metal pool for your workload density and overcommit targets.
-
Confirm a metal instance type is offered.
rosa list instance-typesmay prompt for an installer role if several exist. Pick the cluster’s HCP installer role.If
rosa list instance-typesprompts for an installer role, pass the cluster HCP installer role:Example on-demand Linux prices from validation in
ap-southeast-2. Confirm current pricing and availability in your Region:Type Approx. USD/hr vCPU / memory c5n.metal5.08 72 / 192 GiB c5.metal5.33 96 / 192 GiB z1d.metal5.42 48 / 384 GiB -
Create a one-node pool on the same private subnet as existing workers (HCP workers are private).
Wait until current replicas is 1 and the node is Ready. Metal first boot is slow (ostree reboot, large disk, long POST). The EC2 instance can reach
runningwell before the node is Ready (about 20 minutes in validation). -
After the node is Ready, confirm
/dev/kvmand that OSC DaemonSets landed on it. An emptyKataConfigselector should install on the new node automatically (kata-ocrole).Confirm
osc-rpm-install/osc-caa-dspods are on the metal node before you create the test pod. -
Delete any failed
katapod that scheduled ontom5.xlarge, then create a local Kata pod pinned to metal.Verify that the pod is Running (about 16 seconds on
c5n.metalin validation) and thatoc execsucceeds.
10. Cleanup
Delete resources in this order to control cost: test pods (this terminates peer EC2 instances), then the metal pool if you created one, then KataConfig, then the Operator, then IAM.
Do not delete ROSA cluster roles (*-HCP-ROSA-*, ingress, CSI, EFS, cert-manager, and similar).
-
Delete workloads and confirm peer VMs are gone.
If a
podvm-*instance is still running after the pod is gone: -
Delete the metal pool if you created one. Confirm the metal EC2 instance reaches
terminatedbefore you destroy the VPC.c5n.metalcan sit inshutting-downfor 10 minutes or more. -
Delete
KataConfig, then the Operator. DeletingKataConfiguninstalls RPMs (DaemonSetosc-rpm-uninstall) and triggersosc-podvm-image-deletion(AMI, S3,vmimport). Wait for the image-deletion job to complete. It removes AWS artifacts the IAM role created.Wait until it is gone (finalizer
kataconfiguration.openshift.io/finalizer). -
Revoke only the extra OSC security group self-references (TCP 15150 and TCP 9000). Leave ROSA’s 9000-9999 cluster communication rules.
-
Delete the OSC IAM role and customer-managed policy.
-
If image-deletion ran,
vmimportandpodvm-*S3/AMI should already be gone. Verify:get-roleshould returnNoSuchEntityforvmimport. -
If you created the cluster only for this test, destroy it after OSC cleanup. Wait until the metal instance is
terminatedfirst. Ifterraform destroyhangs on the VPC, ROSA sometimes leaves a*-vpce-private-routersecurity group that Terraform does not manage. Delete that group, then let destroy continue.
Troubleshooting
STS assume-role or AMI job failures
The image job osc-podvm-image-creation is the first IRSA check. If logs show AssumeRoleWithWebIdentity or audience errors:
- Confirm the Subscription
ROLEARNmatches the role you created. - Confirm trust
subissystem:serviceaccount:openshift-sandboxed-containers-operator:default. - Confirm trust
audisopenshift(the Operator-projected token audience). ROSA IRSA for other operators often also allowssts.amazonaws.com. If assume-role still fails after the product-doc trust policy, add a second statement (or a secondStringEqualsaudience) forsts.amazonaws.com. - Do not use static AWS access keys.
InvalidPermission.Duplicate on security groups
The OSC authorize-security-group-ingress calls are not idempotent. Inspect rules before adding them, or ignore the duplicate error (|| true). During cleanup, revoke only TCP 15150 and the extra TCP 9000 self-referential rule. Do not remove ROSA’s 9000-9999 range.
t2 instance types fail with TPM v2.0 AMI
CAA may select t2.small from a product-doc PODVM_INSTANCE_TYPES list when the sample pod requests little CPU and memory. The OSC 1.13 pod VM AMI requires TPM 2.0, which t2 instance types do not support. Set PODVM_INSTANCE_TYPES to Nitro types (t3.medium,t3.large), restart the osc-caa-ds DaemonSet, and recreate the test pod.
Look for The t2.small instance type does not support an AMI with TPM version v2.0.
Local Kata DeadlineExceeded on m5.xlarge
runtimeClassName: kata needs /dev/kvm. Standard (non-metal) ROSA workers do not provide nested KVM. Prefer a metal machine pool and runtimeClassName: kata as in
Local Kata on Intel metal
. Use kata-remote only when metal is not an option.
oc exec hangs on kata-remote
This can happen even when the pod is Running and the peer EC2 instance exists. Use pod Ready and EC2 existence as the health check. For production, disable ExecProcessRequest in the Kata agent policy.