# GKECluster

Source: /reference/gkeclusters/

A GKECluster provisions a GKE cluster with dedicated node pools for GPU inference and system workloads. It outputs secrets containing the cluster kubeconfig and a GCP service account key that consumers can use to target the cluster.

Apply instances as `apiVersion: infrastructure.modelplane.ai/v1alpha1`, `kind: GKECluster`.

## Example

```yaml
apiVersion: infrastructure.modelplane.ai/v1alpha1
kind: GKECluster
metadata:
  name: inference-us-central
  namespace: platform
spec:
  region: us-central1
  nodePools:
    - name: system
      role: System
      machineType: e2-standard-4
      nodeCount: 2
    - name: gpu-h100
      role: GPU
      machineType: a3-highgpu-8g
      diskSizeGb: 500
      nodeCount: 0
      maxNodeCount: 4
      zones: [us-central1-a]
      gpu:
        acceleratorType: nvidia-h100-80gb
        acceleratorCount: 8
```

## Definition

The CompositeResourceDefinition this reference is generated from, with the complete OpenAPI schema, validation rules, and defaults:

```yaml
apiVersion: apiextensions.crossplane.io/v2
kind: CompositeResourceDefinition
metadata:
  name: gkeclusters.infrastructure.modelplane.ai
spec:
  group: infrastructure.modelplane.ai
  names:
    categories:
    - crossplane
    - modelplane
    - infrastructure
    kind: GKECluster
    plural: gkeclusters
    shortNames:
    - gke
  scope: Namespaced
  versions:
  - name: v1alpha1
    referenceable: true
    additionalPrinterColumns:
    - name: REGION
      type: string
      jsonPath: .spec.region
    schema:
      openAPIV3Schema:
        description: >-
          A GKECluster provisions a GKE cluster with dedicated node pools for
          GPU inference and system workloads. It outputs secrets containing
          the cluster kubeconfig and a GCP service account key that consumers
          can use to target the cluster.
        properties:
          spec:
            description: GKEClusterSpec defines the desired state of GKECluster.
            required:
            - region
            - nodePools
            properties:
              region:
                type: string
                description: >-
                  GCP region for the cluster (e.g. us-central1, europe-west4).
                minLength: 1
                maxLength: 32
              kubernetesVersion:
                type: string
                default: "1.35"
                description: >-
                  GKE cluster Kubernetes version. Must be a version supported
                  by the REGULAR release channel.
                minLength: 1
                maxLength: 16
              credentials:
                type: object
                description: >-
                  GCP ProviderConfig or ClusterProviderConfig used to
                  authenticate to the GCP API. Defaults to the
                  ClusterProviderConfig named default.
                properties:
                  type:
                    type: string
                    default: ClusterProviderConfig
                    enum:
                    - ProviderConfig
                    - ClusterProviderConfig
                  name:
                    type: string
                    default: default
                    minLength: 1
                    maxLength: 253
              networking:
                type: object
                description: >-
                  VPC networking configuration. Defaults are suitable for
                  standalone clusters. Override when VPC-peering multiple
                  clusters to avoid CIDR collisions.
                properties:
                  podCidr:
                    type: string
                    default: "10.1.0.0/16"
                    description: Secondary IP range for pods.
                    maxLength: 18
                  serviceCidr:
                    type: string
                    default: "10.2.0.0/16"
                    description: Secondary IP range for services.
                    maxLength: 18
                  nodeCidr:
                    type: string
                    default: "10.0.0.0/24"
                    description: Primary IP range for nodes.
                    maxLength: 18
              nodePools:
                type: array
                description: >-
                  Node pools for the cluster. At least one System pool is
                  required for controllers and infrastructure workloads.
                minItems: 1
                maxItems: 8
                x-kubernetes-list-type: map
                x-kubernetes-list-map-keys:
                - name
                items:
                  type: object
                  required:
                  - name
                  - role
                  - machineType
                  x-kubernetes-validations:
                  - rule: "self.role != 'GPU' || has(self.gpu)"
                    message: gpu is required when role is GPU.
                  - rule: "self.role != 'GPU' || has(self.zones)"
                    message: zones is required when role is GPU.
                  properties:
                    name:
                      type: string
                      description: >-
                        Unique name for this node pool. Used as a suffix in the
                        GKE NodePool resource name.
                      maxLength: 40
                      minLength: 1
                    role:
                      type: string
                      description: >-
                        Determines what workloads this pool runs. System pools
                        host controllers, gateways, and infrastructure. GPU
                        pools host inference workloads and are tainted to
                        exclude non-GPU pods. CPU pools host CPU inference
                        workloads: a standard node image, no GPU, and the
                        modelplane.ai/cpu label and taint.
                      enum:
                      - System
                      - GPU
                      - CPU
                    machineType:
                      type: string
                      description: >-
                        GCE machine type (e.g. e2-standard-4, a2-highgpu-8g,
                        g2-standard-48).
                      minLength: 1
                      maxLength: 63
                    diskSizeGb:
                      type: integer
                      default: 100
                      description: Boot disk size in GB.
                      minimum: 10
                      maximum: 65536
                    nodeCount:
                      type: integer
                      default: 1
                      description: Initial number of nodes.
                      minimum: 0
                      maximum: 1000
                    minNodeCount:
                      type: integer
                      default: 0
                      description: >-
                        Minimum number of nodes for autoscaling. Set to 1 or
                        higher for pools that must always be available.
                      minimum: 0
                      maximum: 1000
                    maxNodeCount:
                      type: integer
                      default: 8
                      description: Maximum number of nodes for autoscaling.
                      minimum: 0
                      maximum: 1000
                    gpu:
                      type: object
                      description: >-
                        GPU configuration. Required when role is GPU.
                      required:
                      - acceleratorType
                      properties:
                        acceleratorType:
                          type: string
                          description: >-
                            GPU accelerator type (e.g. nvidia-tesla-a100,
                            nvidia-h100-80gb, nvidia-l4). Attached to each
                            node along with acceleratorCount.
                          minLength: 1
                          maxLength: 63
                        acceleratorCount:
                          type: integer
                          default: 1
                          description: Number of GPUs to attach per node.
                          minimum: 1
                          maximum: 16
                    zones:
                      type: array
                      description: >-
                        Zones to restrict this node pool to. Required for GPU
                        pools because not all zones in a region have every GPU
                        type. Example: ["us-central1-a", "us-central1-b"].
                      minItems: 1
                      maxItems: 8
                      items:
                        type: string
                        minLength: 1
                        maxLength: 63
            type: object
          status:
            description: GKEClusterStatus defines the observed state of GKECluster.
            properties:
              nodePools:
                type: array
                description: >-
                  The provisioning state of each node pool in spec.nodePools.
                  The system node pool Modelplane adds belongs to the cluster
                  itself, so its state is part of the ClusterReady condition.
                maxItems: 8
                x-kubernetes-list-type: map
                x-kubernetes-list-map-keys:
                - name
                items:
                  type: object
                  required:
                  - name
                  - state
                  properties:
                    name:
                      type: string
                      description: Name of the node pool in spec.nodePools.
                      maxLength: 40
                    state:
                      type: string
                      description: >-
                        Pending until Modelplane composes the pool's cloud
                        resources, Provisioning until their provider reports
                        them all Ready, then Ready. Failed while the provider
                        reports that its last create, update or delete of one
                        of them failed.
                      enum:
                      - Pending
                      - Provisioning
                      - Ready
                      - Failed
                    message:
                      type: string
                      description: >-
                        The provider's error, prefixed with the name of the
                        composed resource it's about. Set only when state is
                        Failed.
              secrets:
                type: array
                description: >-
                  Secrets produced by this cluster. Consumers use these to
                  authenticate to the cluster. All secrets are in the same
                  namespace as this GKECluster.
                items:
                  type: object
                  required:
                  - type
                  - name
                  - key
                  properties:
                    type:
                      type: string
                      description: >-
                        The type of credential this secret contains.
                        Kubeconfig contains a kubeconfig file with the cluster
                        endpoint and CA certificate. GoogleApplicationCredentials
                        contains a GCP service account JSON key that
                        authenticates to the cluster via GKE IAM.
                      enum:
                      - Kubeconfig
                      - GoogleApplicationCredentials
                    name:
                      type: string
                      description: Name of the Secret.
                      maxLength: 253
                    key:
                      type: string
                      description: >-
                        Key within the Secret that holds the credential data.
                      maxLength: 253
              cache:
                type: object
                description: >-
                  Observed ModelCache RWX storage state.
                properties:
                  storageClassName:
                    type: string
                    description: >-
                      Name of the Modelplane-managed ReadWriteMany StorageClass
                      composed on this cluster for ModelCache PVCs. ModelCache
                      reads this to target the cache PVC.
                    maxLength: 253
            type: object
        required:
        - spec
        type: object
    served: true
```
