Skip to content

GCP.Container reference

Source: src/GCP/Container/Cluster.ts

A Google Kubernetes Engine cluster.

Changing clusterId, location, description, network, subnetwork, autopilot, enableKubernetesAlpha, or default-pool node shape (initialNodeCount, machineType, diskSizeGb, diskType, spot, preemptible) replaces the cluster. Labels, logging/monitoring services, release channel, and node locations are updated in place.

Provisioning typically takes several minutes.

Generated name, zonal default pool

const cluster = yield* GCP.Container.Cluster("App", {});

Explicit id, labels, and Spot nodes

const cluster = yield* GCP.Container.Cluster("App", {
clusterId: "app-cluster",
location: "us-central1-a",
machineType: "e2-medium",
initialNodeCount: 1,
spot: true,
labels: { env: "prod" },
});
const cluster = yield* GCP.Container.Cluster("App", {
location: "us-central1",
autopilot: true,
releaseChannel: "REGULAR",
});
const getCluster = yield* GCP.Container.GetCluster(cluster);
const live = yield* getCluster();
const cluster = yield* GCP.Container.Cluster("App", {});
const api = yield* Kubernetes.Deployment("Api", {
cluster,
main: import.meta.url,
port: 8080,
});

Source: src/GCP/Container/ClustersNodePool.ts

A Google Kubernetes Engine node pool managed through the legacy zonal Container API (projects.zones.clusters.nodePools).

Prefer GCP.Container.NodePool (the projects.locations API) unless you specifically need the zonal endpoints. Changing cluster, zone, nodePoolId, spot, preemptible, serviceAccount, oauthScopes, localSsdCount, bootDiskKmsKey, or maxPodsPerNode replaces the pool. Size, labels, machine type, disk, image, version, management, autoscaling, and upgrade settings update in place.

Provisioning typically takes several minutes.

ClustersNodePool: Creating a Zonal Node Pool

Section titled “ClustersNodePool: Creating a Zonal Node Pool”

Generated name on an existing cluster

const cluster = yield* GCP.Container.Cluster("App", {
location: "us-central1-a",
});
const pool = yield* GCP.Container.ClustersNodePool("Workers", {
cluster: cluster.clusterId,
zone: cluster.location,
});

Explicit id, Spot nodes, and labels

const pool = yield* GCP.Container.ClustersNodePool("Workers", {
cluster: cluster.name,
nodePoolId: "app-workers",
nodeCount: 1,
machineType: "e2-small",
diskSizeGb: 20,
spot: true,
labels: { env: "prod" },
});
const pool = yield* GCP.Container.ClustersNodePool("Workers", {
cluster: cluster.clusterId,
zone: "us-central1-a",
autoscaling: { enabled: true, minNodeCount: 1, maxNodeCount: 3 },
});
const getPool = yield* GCP.Container.GetClustersNodePool(pool);
const live = yield* getPool();

Source: src/GCP/Container/GetCluster.ts

Runtime binding for GKE clusters.get.

Bind this operation to a Cluster in a Function/Action init phase. Provide GetClusterHttp.

const getCluster = yield* GCP.Container.GetCluster(cluster);
const live = yield* getCluster();

Source: src/GCP/Container/GetClusterHttp.ts Kind: Layer · Provides: GCP.Container.GetCluster

HTTP implementation of GetCluster.

Source: src/GCP/Container/GetClustersNodePool.ts

Runtime binding for GKE zonal nodePools.get.

Bind this operation to a ClustersNodePool in a Function/Action init phase. Provide GetClustersNodePoolHttp.

GetClustersNodePool: Observing Zonal Node Pools

Section titled “GetClustersNodePool: Observing Zonal Node Pools”
const getPool = yield* GCP.Container.GetClustersNodePool(pool);
const live = yield* getPool();

Source: src/GCP/Container/GetClustersNodePoolHttp.ts Kind: Layer · Provides: GCP.Container.GetClustersNodePool

HTTP implementation of GetClustersNodePool.

Source: src/GCP/Container/GetNodePool.ts

Runtime binding for GKE nodePools.get.

Bind this operation to a NodePool in a Function/Action init phase. Provide GetNodePoolHttp.

const getNodePool = yield* GCP.Container.GetNodePool(pool);
const live = yield* getNodePool();

Source: src/GCP/Container/GetNodePoolHttp.ts Kind: Layer · Provides: GCP.Container.GetNodePool

HTTP implementation of GetNodePool.

Source: src/GCP/Container/NodePool.ts

A Google Kubernetes Engine node pool.

Node pools belong to a Cluster. Changing cluster, location, nodePoolId, spot, preemptible, serviceAccount, oauthScopes, localSsdCount, bootDiskKmsKey, or maxPodsPerNode replaces the pool. Size, labels, machine type, disk, image, version, management, autoscaling, and upgrade settings update in place.

Provisioning typically takes several minutes.

Generated name on an existing cluster

const cluster = yield* GCP.Container.Cluster("App", {});
const pool = yield* GCP.Container.NodePool("Workers", {
cluster: cluster.clusterId,
location: cluster.location,
});

Explicit id, Spot nodes, and labels

const pool = yield* GCP.Container.NodePool("Workers", {
cluster: cluster.name,
nodePoolId: "app-workers",
nodeCount: 1,
machineType: "e2-small",
diskSizeGb: 20,
spot: true,
labels: { env: "prod" },
});
const pool = yield* GCP.Container.NodePool("Workers", {
cluster: cluster.clusterId,
location: cluster.location,
autoscaling: { enabled: true, minNodeCount: 1, maxNodeCount: 3 },
});
const getNodePool = yield* GCP.Container.GetNodePool(pool);
const live = yield* getNodePool();