Deploy a Prebuilt Container Image
This guide walks you through deploying a prebuilt container image to OpenChoreo. This is useful when you have existing container images built by external CI/CD pipelines and want to deploy them without using OpenChoreo's Build Plane.
Overviewβ
OpenChoreo supports deploying applications from prebuilt container images, commonly referred to as "Bring Your Own Image" (BYOI).
Prerequisitesβ
Before you begin, ensure you have:
- OpenChoreo installed in your Kubernetes cluster
- kubectl configured to access your cluster
- A container image to deploy
Deploy an Imageβ
Deploying an image is straightforward - simply create the Component and Workload resources.
Exampleβ
kubectl apply -f - <<EOF
---
apiVersion: openchoreo.dev/v1alpha1
kind: Component
metadata:
name: my-app
namespace: default
spec:
autoDeploy: true
componentType: deployment/service
owner:
projectName: default
parameters:
exposed: true
port: 80
replicas: 1
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 256Mi
---
apiVersion: openchoreo.dev/v1alpha1
kind: Workload
metadata:
name: my-app-workload
namespace: default
spec:
owner:
componentName: my-app
projectName: default
containers:
main:
image: "nginx:latest"
EOF
Replace the following values with your own:
nginx:latest- Your image reference80- The port your application listens on- Add environment variables as needed by your application
Verify the Deploymentβ
Check that the component is created:
kubectl get component my-app
Check that the workload is created:
kubectl get workload my-app-workload
Check that pods are running:
kubectl get pods -A | grep my-app
Test Your Applicationβ
Once the deployment is ready, test your application:
curl http://development.openchoreoapis.localhost:19080/my-app/
Summaryβ
You've learned how to deploy prebuilt container images using the OpenChoreo BYOI (Bring Your Own Image) flow.
Next Stepsβ
- Configure API Management to secure your deployed APIs
- Set up Secret Management for automatic credential rotation
- Explore more examples of deploying applications