GCP CAPI Override Reference
This page provides examples and references for overriding Cluster API (CAPI) properties on GCP clusters using Cluster API Provider GCP (CAPG).
GCP IaaS
GCP IaaS clusters use the CAPG self-managed path. Cluster-level overrides target the GCPCluster resource, and
pool-level overrides target the GCPMachineTemplate resource.
| Level | CAPI Kind | API References |
|---|---|---|
| All | - | CAPG Book *Use with caution as this reference guide is not semantically versioned. |
| Cluster | GCPCluster | v1.8.1 GCPCluster API types |
| Pool | GCPMachineTemplate | v1.8.1 GCPMachineTemplate API types |
Examples
These examples demonstrate how to override CAPI properties using YAML directly targeting the underlying CAPG resources.
Cluster-Level
gcpCluster:
spec:
additionalLabels:
environment: dev
team: platform
Pool-Level
GCPMachineTemplate has an extra level of nesting. The spec wraps a template, which contains another spec field
that holds the actual machine configuration. All pool-level GCP IaaS overrides use this structure.
gcpMachineTemplate:
spec:
template:
spec:
additionalNetworkTags:
- allow-cp-ingress
- palette-control-plane
shieldedInstanceConfig:
secureBoot: Disabled
virtualizedTrustedPlatformModule: Enabled
integrityMonitoring: Enabled
additionalMetadata:
- key: serial-port-enable
value: "false"
- key: shutdown-script
value: "echo 'shutting down'"
Unsupported First-Class Properties
The following properties are not exposed as first-class properties in the supported interfaces for Palette but can be configured using override. To learn more about the difference between first-class properties and override properties, refer to the First-Class Support vs. Override section.
| CAPG Resource Type | Properties |
|---|---|
GCPCluster | controlPlaneEndpoint, loadBalancer, network.hostProject, network.loadBalancerBackendPort, network.mtu, resourceManagerTags |
GCPMachineTemplate | additionalDisks, additionalLabels, additionalMetadata, additionalNetworkTags, confidentialCompute, imageFamily, ipForwarding, onHostMaintenance, preemptible, provisioningModel, resourceManagerTags, rootDeviceType, rootDiskEncryptionKey, serviceAccounts, shieldedInstanceConfig |
GKE
GKE clusters use the CAPG managed-cluster path. Cluster-level overrides target GCPManagedControlPlane (and, if needed,
GCPManagedCluster), and pool-level overrides target GCPManagedMachinePool.
| Level | CAPI Kind | API References |
|---|---|---|
| All | - | CAPG Book *Use with caution as this reference guide is not semantically versioned. |
| Cluster | GCPManagedControlPlane | v1.8.1 GCPManagedControlPlane API types |
| Cluster | GCPManagedCluster | v1.8.1 GCPManagedCluster API types |
| Pool | GCPManagedMachinePool | v1.8.1 GCPManagedMachinePool API types |
Cluster-level overrides on GKE can target either gcpManagedControlPlane or gcpManagedCluster. Most control plane and
cluster-wide settings live on GCPManagedControlPlane. Only supply gcpManagedCluster overrides when the field you
want to change is defined on the GCPManagedCluster resource.
Examples
These examples demonstrate how to override CAPI properties using YAML directly targeting the underlying CAPG managed resources.
Cluster-Level
gcpManagedControlPlane:
spec:
releaseChannel: regular
description: "gke cluster"
master_authorized_networks_config:
gcp_public_cidrs_access_enabled: true
Pool-Level
Managed node pools on GKE do not use the extra template nesting. Pool-level overrides map directly under
gcpManagedMachinePool.spec.
gcpManagedMachinePool:
spec:
management:
autoRepair: true
autoUpgrade: false
nodeLocations:
- us-east1-b
- us-east1-c
additionalLabels:
environment: dev
team: platform
maxPodsPerNode: 64
diskType: pd-ssd
Unsupported First-Class Properties
The following properties are not exposed as first-class properties in the supported interfaces for Palette but can be configured using override. To learn more about the difference between first-class properties and override properties, refer to the First-Class Support vs. Override section.
| CAPG Resource Type | Properties |
|---|---|
GCPManagedControlPlane | clusterNetwork, description, endpoint, master_authorized_networks_config, releaseChannel |