Skip to content

Workload

Source: src/AWS/EKS/Workload.ts

Creates a Kubernetes deployment with an optional service on an EKS cluster.

Workload is the higher-level helper for the common “run pods and maybe expose them on a Service” pattern without dropping down to each individual Kubernetes primitive.

const app = yield* Workload("api", {
cluster: cluster.cluster,
namespace: "default",
containers: [
{
name: "api",
image: "nginx:latest",
ports: [{ containerPort: 8080 }],
},
],
service: {
ports: [{ port: 80, targetPort: 8080 }],
},
});