AlloyDBInstance


Property Value
Google Cloud Service Name AlloyDB for PostgreSQL
Google Cloud Service Documentation /alloydb/docs/
Google Cloud REST Resource Name v1.projects.locations.clusters.instances
Google Cloud REST Resource Documentation /alloydb/docs/reference/rest/v1/projects.locations.clusters.instances
Config Connector Resource Short Names gcpalloydbinstance
gcpalloydbinstances
alloydbinstance
Config Connector Service Name alloydb.googleapis.com
Config Connector Resource Fully Qualified Name alloydbinstances.alloydb.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMember No
Config Connector Default Average Reconcile Interval In Seconds 600

Custom Resource Definition Properties

Spec

Schema

annotations:
  string: string
availabilityType: string
clusterRef:
  external: string
  name: string
  namespace: string
databaseFlags:
  string: string
displayName: string
gceZone: string
instanceType: string
instanceTypeRef:
  external: string
  name: string
  namespace: string
machineConfig:
  cpuCount: integer
networkConfig:
  authorizedExternalNetworks:
  - cidrRange: string
  enableOutboundPublicIp: boolean
  enablePublicIp: boolean
readPoolConfig:
  nodeCount: integer
resourceID: string
Fields

annotations

Optional

map (key: string, value: string)

Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels.

availabilityType

Optional

string

'Availability type of an Instance. Defaults to REGIONAL for both primary and read instances. Note that primary and read instances can have different availability types. Only READ_POOL instance supports ZONAL type. Users can't specify the zone for READ_POOL instance. Zone is automatically chosen from the list of zones in the region specified. Read pool of size 1 can only have zonal availability. Read pools with node count of 2 or more can have regional availability (nodes are present in 2 or more zones in a region).' Possible values: ["AVAILABILITY_TYPE_UNSPECIFIED", "ZONAL", "REGIONAL"].

clusterRef

Required

object

clusterRef.external

Optional

string

Allowed value: The `name` field of an `AlloyDBCluster` resource.

clusterRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

clusterRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

databaseFlags

Optional

map (key: string, value: string)

Database flags. Set at instance level. * They are copied from primary instance on read instance creation. * Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary.

displayName

Optional

string

User-settable and human-readable display name for the Instance.

gceZone

Optional

string

The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances. If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.

instanceType

Optional

string

We recommend that you use `instanceTypeRef` instead. The type of the instance. Possible values: [PRIMARY, READ_POOL, SECONDARY]

instanceTypeRef

Optional

object

The type of instance. Possible values: ["PRIMARY", "READ_POOL", "SECONDARY"] For PRIMARY and SECONDARY instances, set the value to refer to the name of the associated cluster. This is recommended because the instance type of primary and secondary instances is tied to the cluster type of the associated cluster. If the secondary cluster is promoted to primary cluster, then the associated secondary instance also becomes primary instance. Example: instanceTypeRef: name: clusterName For instances of type READ_POOL, set the value using external keyword. Example: instanceTypeRef: external: READ_POOL If the instance type is SECONDARY, the delete instance operation does not delete the secondary instance but abandons it instead. Use deletionPolicy = "FORCE" in the associated secondary cluster and delete the cluster forcefully to delete the secondary cluster as well its associated secondary instance.

instanceTypeRef.external

Optional

string

Allowed value: The `clusterType` field of an `AlloyDBCluster` resource.

instanceTypeRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

instanceTypeRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

machineConfig

Optional

object

Configurations for the machines that host the underlying database engine.

machineConfig.cpuCount

Optional

integer

The number of CPU's in the VM instance.

networkConfig

Optional

object

Instance level network configuration.

networkConfig.authorizedExternalNetworks

Optional

list (object)

A list of external networks authorized to access this instance. This field is only allowed to be set when 'enable_public_ip' is set to true.

networkConfig.authorizedExternalNetworks[]

Optional

object

networkConfig.authorizedExternalNetworks[].cidrRange

Optional

string

CIDR range for one authorized network of the instance.

networkConfig.enableOutboundPublicIp

Optional

boolean

Enabling outbound public ip for the instance.

networkConfig.enablePublicIp

Optional

boolean

Enabling public ip for the instance. If a user wishes to disable this, please also clear the list of the authorized external networks set on the same instance.

readPoolConfig

Optional

object

Read pool specific config. If the instance type is READ_POOL, this configuration must be provided.

readPoolConfig.nodeCount

Optional

integer

Read capacity, i.e. number of nodes in a read pool instance.

resourceID

Optional

string

Immutable. Optional. The instanceId of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.

Status

Schema

conditions:
- lastTransitionTime: string
  message: string
  reason: string
  status: string
  type: string
createTime: string
ipAddress: string
name: string
observedGeneration: integer
outboundPublicIpAddresses:
- string
publicIpAddress: string
reconciling: boolean
state: string
uid: string
updateTime: string
Fields
conditions

list (object)

Conditions represent the latest available observation of the resource's current state.

conditions[]

object

conditions[].lastTransitionTime

string

Last time the condition transitioned from one status to another.

conditions[].message

string

Human-readable message indicating details about last transition.

conditions[].reason

string

Unique, one-word, CamelCase reason for the condition's last transition.

conditions[].status

string

Status is the status of the condition. Can be True, False, Unknown.

conditions[].type

string

Type is the type of the condition.

createTime

string

Time the Instance was created in UTC.

ipAddress

string

The IP address for the Instance. This is the connection endpoint for an end-user application.

name

string

The name of the instance resource.

observedGeneration

integer

ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.

outboundPublicIpAddresses

list (string)

The outbound public IP addresses for the instance. This is available ONLY when networkConfig.enableOutboundPublicIp is set to true. These IP addresses are used for outbound connections.

outboundPublicIpAddresses[]

string

publicIpAddress

string

The public IP addresses for the Instance. This is available ONLY when networkConfig.enablePublicIp is set to true. This is the connection endpoint for an end-user application.

reconciling

boolean

Set to true if the current state of Instance does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.

state

string

The current state of the alloydb instance.

uid

string

The system-generated UID of the resource.

updateTime

string

Time the Instance was updated in UTC.

Sample YAML(s)

Primary Instance

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBInstance
metadata:
  name: alloydbinstance-sample-primary
spec:
  clusterRef: 
    name: alloydbinstance-dep-primary
  instanceTypeRef:
    name: alloydbinstance-dep-primary
  databaseFlags:
    enable_google_adaptive_autovacuum: "off"
    password.enforce_complexity: "on"
  machineConfig:
    cpuCount: 2
  networkConfig:
    enablePublicIp: true
    enableOutboundPublicIp: true
    authorizedExternalNetworks:
    - cidrRange: 8.8.8.8/30
    - cidrRange: 8.8.4.4/30
---
apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBCluster
metadata:
  name: alloydbinstance-dep-primary
spec:
  location: asia-east1
  networkConfig:
    networkRef: 
      name: alloydbinstance-dep-primary
  projectRef:
    external: ${PROJECT_ID?}
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeAddress
metadata:
  name: alloydbinstance-dep-primary
spec:
  location: global
  addressType: INTERNAL
  networkRef:
    name: alloydbinstance-dep-primary
  prefixLength: 16
  purpose: VPC_PEERING
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeNetwork
metadata:
  name: alloydbinstance-dep-primary
---
apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1
kind: ServiceNetworkingConnection
metadata:
  name: alloydbinstance-dep-primary
spec:
  networkRef:
    name: alloydbinstance-dep-primary
  reservedPeeringRanges:
  - external: alloydbinstance-dep-primary
  service: servicenetworking.googleapis.com

Read Instance

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBInstance
metadata:
  name: alloydbinstance-dep-read
spec:
  clusterRef: 
    name: alloydbinstance-dep-read
  instanceTypeRef:
    name: alloydbinstance-dep-read
---
apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBInstance
metadata:
  name: alloydbinstance-sample-read
spec:
  clusterRef: 
    name: alloydbinstance-dep-read
  instanceTypeRef:
    external: READ_POOL
  availabilityType: REGIONAL
  databaseFlags:
    google_columnar_engine.enabled: "on"
  machineConfig:
    cpuCount: 2
  readPoolConfig:
    nodeCount: 3
---
apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBCluster
metadata:
  name: alloydbinstance-dep-read
spec:
  location: asia-east2
  networkConfig:
    networkRef: 
      name: alloydbinstance-dep-read
  projectRef:
    external: ${PROJECT_ID?}
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeAddress
metadata:
  name: alloydbinstance-dep-read
spec:
  location: global
  addressType: INTERNAL
  networkRef:
    name: alloydbinstance-dep-read
  prefixLength: 16
  purpose: VPC_PEERING
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeNetwork
metadata:
  name: alloydbinstance-dep-read
---
apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1
kind: ServiceNetworkingConnection
metadata:
  name: alloydbinstance-dep-read
spec:
  networkRef:
    name: alloydbinstance-dep-read
  reservedPeeringRanges:
  - name: alloydbinstance-dep-read
  service: servicenetworking.googleapis.com

Secondary Instance

# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBInstance
metadata:
  name: alloydbinstance-dep-secondary
spec:
  clusterRef: 
    name: alloydbinstance-dep1-secondary
  instanceTypeRef:
    name: alloydbinstance-dep1-secondary
---
apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBInstance
metadata:
  name: alloydbinstance-sample-secondary
spec:
  clusterRef: 
    name: alloydbinstance-dep2-secondary
  instanceTypeRef:
    name: alloydbinstance-dep2-secondary
---
apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBCluster
metadata:
  name: alloydbinstance-dep1-secondary
spec:
  location: asia-northeast1
  networkConfig:
    networkRef: 
      name: alloydbinstance-dep-secondary
  projectRef:
    external: ${PROJECT_ID?}
  initialUser:
    user: "postgres"
    password:
      value: "postgres"
---
apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBCluster
metadata:
  name: alloydbinstance-dep2-secondary
spec:
  location: asia-northeast2
  networkConfig:
    networkRef: 
      name: alloydbinstance-dep-secondary
  projectRef:
    external: ${PROJECT_ID?}
  clusterType: "SECONDARY"
  secondaryConfig:
    primaryClusterNameRef:
      name: alloydbinstance-dep1-secondary
  deletionPolicy: "FORCE"
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeAddress
metadata:
  name: alloydbinstance-dep-secondary
spec:
  location: global
  addressType: INTERNAL
  networkRef:
    name: alloydbinstance-dep-secondary
  prefixLength: 16
  purpose: VPC_PEERING
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeNetwork
metadata:
  name: alloydbinstance-dep-secondary
---
apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1
kind: ServiceNetworkingConnection
metadata:
  name: alloydbinstance-dep-secondary
spec:
  networkRef:
    name: alloydbinstance-dep-secondary
  reservedPeeringRanges:
  - name: alloydbinstance-dep-secondary
  service: servicenetworking.googleapis.com

Zonal Instance

# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBInstance
metadata:
  name: alloydbinstance-sample-zonal
spec:
  clusterRef: 
    name: alloydbinstance-dep-zonal
  availabilityType: ZONAL
  instanceTypeRef:
    name: alloydbinstance-dep-zonal
  machineConfig:
    cpuCount: 2
---
apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBCluster
metadata:
  name: alloydbinstance-dep-zonal
spec:
  location: asia-northeast3
  networkConfig:
    networkRef: 
      name: alloydbinstance-dep-zonal
  projectRef:
    external: ${PROJECT_ID?}
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeAddress
metadata:
  name: alloydbinstance-dep-zonal
spec:
  location: global
  addressType: INTERNAL
  networkRef:
    name: alloydbinstance-dep-zonal
  prefixLength: 16
  purpose: VPC_PEERING
---
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeNetwork
metadata:
  name: alloydbinstance-dep-zonal
---
apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1
kind: ServiceNetworkingConnection
metadata:
  name: alloydbinstance-dep-zonal
spec:
  networkRef:
    name: alloydbinstance-dep-zonal
  reservedPeeringRanges:
  - external: alloydbinstance-dep-zonal
  service: servicenetworking.googleapis.com