Skip to content

GCP.GKEOnPrem reference

Source: src/GCP/GKEOnPrem/BareMetalCluster.ts

An Anthos on bare metal user cluster registered with the GKE On-Prem API. Creating a cluster requires a connected admin cluster (Hub membership) and on-prem hardware.

Clusters have no GCP labels field, so Alchemy stamps ownership into annotations and a [alchemy …] description prefix for list / nuke. Cluster id, location, and admin membership are identity — changing them replaces the cluster. Other fields update in place.

BareMetalCluster: Creating a Bare Metal Cluster

Section titled “BareMetalCluster: Creating a Bare Metal Cluster”
const cluster = yield* GCP.GKEOnPrem.BareMetalCluster("Workload", {
adminClusterMembership:
"projects/my-project/locations/global/memberships/admin",
bareMetalVersion: "1.28.0-gke.1",
controlPlane: {
controlPlaneNodePoolConfig: {
nodePoolConfig: {
nodeConfigs: [{ nodeIp: "10.200.0.2" }],
},
},
},
storage: {
lvpShareConfig: {
lvpConfig: { path: "/mnt/localpv-share", storageClass: "local-shared" },
},
lvpNodeMountsConfig: {
path: "/mnt/localpv-disk",
storageClass: "local-disks",
},
},
networkConfig: {
islandModeCidr: {
serviceAddressCidrBlocks: ["10.96.0.0/12"],
podAddressCidrBlocks: ["192.168.0.0/16"],
},
},
loadBalancer: {
vipConfig: { controlPlaneVip: "10.200.0.8", ingressVip: "10.200.0.9" },
metalLbConfig: {
addressPools: [{ pool: "pool-1", addresses: ["10.200.0.10-10.200.0.20"] }],
},
},
description: "app user cluster",
});

BareMetalCluster: Updating a Bare Metal Cluster

Section titled “BareMetalCluster: Updating a Bare Metal Cluster”

Re-declare the same logical id with changed props; the engine keeps the physical resource and updates it in place.

const cluster = yield* GCP.GKEOnPrem.BareMetalCluster("Workload", {
adminClusterMembership:
"projects/my-project/locations/global/memberships/admin",
bareMetalVersion: "1.29.0-gke.1",
controlPlane: {
controlPlaneNodePoolConfig: {
nodePoolConfig: {
nodeConfigs: [{ nodeIp: "10.200.0.2" }],
},
},
},
storage: {
lvpShareConfig: {
lvpConfig: { path: "/mnt/localpv-share", storageClass: "local-shared" },
},
lvpNodeMountsConfig: {
path: "/mnt/localpv-disk",
storageClass: "local-disks",
},
},
networkConfig: {
islandModeCidr: {
serviceAddressCidrBlocks: ["10.96.0.0/12"],
podAddressCidrBlocks: ["192.168.0.0/16"],
},
},
loadBalancer: {
vipConfig: { controlPlaneVip: "10.200.0.8", ingressVip: "10.200.0.9" },
metalLbConfig: {
addressPools: [{ pool: "pool-1", addresses: ["10.200.0.10-10.200.0.20"] }],
},
},
description: "app user cluster v2",
});

Source: src/GCP/GKEOnPrem/BareMetalClustersBareMetalNodePool.ts

A worker node pool on an Anthos on bare metal user cluster.

Node pools have no GCP labels field, so Alchemy stamps ownership into annotations and a [alchemy …] displayName prefix for list / nuke. Pool id, location, and parent cluster are identity — changing them replaces the pool. Config, display name, and upgrade policy update in place.

BareMetalClustersBareMetalNodePool: Creating a Bare Metal Node Pool

Section titled “BareMetalClustersBareMetalNodePool: Creating a Bare Metal Node Pool”
const pool = yield* GCP.GKEOnPrem.BareMetalClustersBareMetalNodePool(
"Workers",
{
bareMetalCluster: cluster.name,
nodePoolConfig: {
nodeConfigs: [
{ nodeIp: "10.200.0.11" },
{ nodeIp: "10.200.0.12" },
],
},
displayName: "app workers",
},
);

BareMetalClustersBareMetalNodePool: Updating a Bare Metal Node Pool

Section titled “BareMetalClustersBareMetalNodePool: Updating a Bare Metal Node Pool”

Re-declare the same logical id with changed props; the engine keeps the physical resource and updates it in place.

const pool = yield* GCP.GKEOnPrem.BareMetalClustersBareMetalNodePool(
"Workers",
{
bareMetalCluster: cluster.name,
nodePoolConfig: {
nodeConfigs: [
{ nodeIp: "10.200.0.11" },
{ nodeIp: "10.200.0.12" },
{ nodeIp: "10.200.0.13" },
],
},
displayName: "app workers v2",
},
);

Source: src/GCP/GKEOnPrem/VmwareCluster.ts

An Anthos on VMware user cluster registered with the GKE On-Prem API. Creating a cluster requires a connected admin cluster (Hub membership) and vSphere infrastructure.

Clusters have no GCP labels field, so Alchemy stamps ownership into annotations and a [alchemy …] description prefix for list / nuke. Cluster id, location, and admin membership are identity — changing them replaces the cluster. Other fields update in place.

const cluster = yield* GCP.GKEOnPrem.VmwareCluster("Workload", {
adminClusterMembership:
"projects/my-project/locations/global/memberships/admin",
onPremVersion: "1.28.0-gke.1",
controlPlaneNode: { cpus: "4", memory: "8192", replicas: "1" },
networkConfig: {
serviceAddressCidrBlocks: ["10.96.0.0/12"],
podAddressCidrBlocks: ["192.168.0.0/16"],
dhcpIpConfig: { enabled: true },
},
loadBalancer: {
vipConfig: { controlPlaneVip: "10.200.0.8", ingressVip: "10.200.0.9" },
metalLbConfig: {
addressPools: [{ pool: "pool-1", addresses: ["10.200.0.10-10.200.0.20"] }],
},
},
description: "app user cluster",
});

Re-declare the same logical id with changed props; the engine keeps the physical resource and updates it in place.

const cluster = yield* GCP.GKEOnPrem.VmwareCluster("Workload", {
adminClusterMembership:
"projects/my-project/locations/global/memberships/admin",
onPremVersion: "1.29.0-gke.1",
controlPlaneNode: { cpus: "4", memory: "8192", replicas: "1" },
networkConfig: {
serviceAddressCidrBlocks: ["10.96.0.0/12"],
podAddressCidrBlocks: ["192.168.0.0/16"],
dhcpIpConfig: { enabled: true },
},
loadBalancer: {
vipConfig: { controlPlaneVip: "10.200.0.8", ingressVip: "10.200.0.9" },
metalLbConfig: {
addressPools: [{ pool: "pool-1", addresses: ["10.200.0.10-10.200.0.20"] }],
},
},
description: "app user cluster v2",
});

Source: src/GCP/GKEOnPrem/VmwareClustersVmwareNodePool.ts

A worker node pool on an Anthos on VMware user cluster.

Node pools have no GCP labels field, so Alchemy stamps ownership into annotations and a [alchemy …] displayName prefix for list / nuke. Pool id, location, and parent cluster are identity — changing them replaces the pool. Config, display name, version, and autoscaling update in place.

VmwareClustersVmwareNodePool: Creating a VMware Node Pool

Section titled “VmwareClustersVmwareNodePool: Creating a VMware Node Pool”
const pool = yield* GCP.GKEOnPrem.VmwareClustersVmwareNodePool("Workers", {
vmwareCluster: cluster.name,
config: {
imageType: "ubuntu_containerd",
replicas: "3",
cpus: "4",
memoryMb: "8192",
},
displayName: "app workers",
});

VmwareClustersVmwareNodePool: Updating a VMware Node Pool

Section titled “VmwareClustersVmwareNodePool: Updating a VMware Node Pool”

Re-declare the same logical id with changed props; the engine keeps the physical resource and updates it in place.

const pool = yield* GCP.GKEOnPrem.VmwareClustersVmwareNodePool("Workers", {
vmwareCluster: cluster.name,
config: {
imageType: "ubuntu_containerd",
replicas: "5",
cpus: "4",
memoryMb: "8192",
},
displayName: "app workers v2",
});