Skip to content

Kubernetes

Each helper builds a Kubernetes object definition and attaches it to an AWS.EKS.Cluster as a binding. The cluster’s reconcile converges the bound objects via server-side apply under the alchemy field manager and prunes objects that drop out of the desired set — so Kubernetes manifests deploy and diff like the rest of your Stack. This is EKS-only today: the cluster prop is an AWS.EKS.Cluster.

New here? Set up — your AWS credentials are the credentials.

Namespace and Job bind directly onto the cluster:

const demoNamespace = yield* Kubernetes.Namespace("DemoNamespace", {
cluster: cluster.cluster,
name: "demo",
});
const clusterInfoJob = yield* Kubernetes.Job("ClusterInfoJob", {
cluster: cluster.cluster,
namespace: demoNamespace,
name: "cluster-info",
containers: [
{
name: "cluster-info",
image: "public.ecr.aws/docker/library/busybox:1.36",
command: ["/bin/sh", "-lc"],
args: ['echo "demo workload is running on EKS Auto Mode"'],
},
],
});

namespace (and serviceAccountName) accept the ref returned by Namespace/ServiceAccount directly — no name plumbing. How the binding-and-apply mechanism works is covered in Objects as bindings.

Deployment and Service cover long-running workloads:

const app = yield* Deployment("api", {
cluster,
namespace: "default",
containers: [
{
name: "api",
image: "nginx:latest",
},
],
});

Deployment defaults to 1 replica and labels the pods app.kubernetes.io/name: <name>; a Service selects those pods via selector and exposes ports (type defaults to ClusterIP). See Objects as bindings for the full apply ordering across kinds.

Provisioning lives in the AWS hub: EKS covers EKS.AutoCluster, EKS.LoadBalancedWorkload, and EKS.PodIdentityWorkload / PodIdentityServiceAccount. There is no kubeconfig step — Alchemy authenticates to the cluster’s API with your AWS credentials (a presigned STS token) and applies objects via server-side apply, so the helpers on this page slot into that guide unchanged.

Namespace · ServiceAccount · ConfigMap · Service · Deployment · Job