From 2de86ec38d304dba8db3703471b6f211850eecd2 Mon Sep 17 00:00:00 2001 From: Shubham Sahu Date: Thu, 29 Feb 2024 21:44:09 +0000 Subject: [PATCH] Generated files after make ready-pr --- ...lusters.alloydb.cnrm.cloud.google.com.yaml | 96 ++++++++ ...stances.alloydb.cnrm.cloud.google.com.yaml | 70 ++++-- .../alloydb/v1beta1/alloydbcluster_types.go | 19 ++ .../alloydb/v1beta1/alloydbinstance_types.go | 3 +- .../alloydb/v1beta1/zz_generated.deepcopy.go | 33 +++ .../resource-docs/alloydb/alloydbbackup.md | 5 +- .../resource-docs/alloydb/alloydbcluster.md | 223 +++++++++++++++++- .../resource-docs/alloydb/alloydbinstance.md | 149 +++++++++++- .../resource-docs/alloydb/alloydbuser.md | 6 +- 9 files changed, 574 insertions(+), 30 deletions(-) diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbclusters.alloydb.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbclusters.alloydb.cnrm.cloud.google.com.yaml index 749fd884396..7f5c1a7b318 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbclusters.alloydb.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbclusters.alloydb.cnrm.cloud.google.com.yaml @@ -178,6 +178,10 @@ spec: - startTimes type: object type: object + clusterType: + description: 'The type of cluster. If not set, defaults to PRIMARY. + Default value: "PRIMARY" Possible values: ["PRIMARY", "SECONDARY"].' + type: string continuousBackupConfig: description: |- The continuous backup config for this cluster. @@ -231,6 +235,12 @@ spec: If not set, defaults to 14 days. type: integer type: object + deletionPolicy: + description: |- + Policy to determine if the cluster should be deleted forcefully. + Deleting a cluster forcefully, deletes the cluster and all its associated instances within the cluster. + Deleting a Secondary cluster with a secondary instance REQUIRES setting deletion_policy = "FORCE" otherwise an error is returned. This is needed as there is no support to delete just the secondary instance, and the only way to delete secondary instance is to delete the associated secondary cluster forcefully which also deletes the secondary instance. + type: string displayName: description: User-settable and human-readable display name for the Cluster. @@ -505,6 +515,44 @@ spec: - clusterRef - pointInTime type: object + secondaryConfig: + description: Configuration of the secondary cluster for Cross Region + Replication. This should be set if and only if the cluster is of + type SECONDARY. + properties: + primaryClusterNameRef: + description: (Optional) Configuration of the secondary cluster + for Cross Region Replication. This should be set if and only + if the cluster is of type SECONDARY. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of an `AlloyDBCluster` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + required: + - primaryClusterNameRef + type: object required: - location - projectRef @@ -796,6 +844,10 @@ spec: - startTimes type: object type: object + clusterType: + description: 'The type of cluster. If not set, defaults to PRIMARY. + Default value: "PRIMARY" Possible values: ["PRIMARY", "SECONDARY"].' + type: string continuousBackupConfig: description: |- The continuous backup config for this cluster. @@ -849,6 +901,12 @@ spec: If not set, defaults to 14 days. type: integer type: object + deletionPolicy: + description: |- + Policy to determine if the cluster should be deleted forcefully. + Deleting a cluster forcefully, deletes the cluster and all its associated instances within the cluster. + Deleting a Secondary cluster with a secondary instance REQUIRES setting deletion_policy = "FORCE" otherwise an error is returned. This is needed as there is no support to delete just the secondary instance, and the only way to delete secondary instance is to delete the associated secondary cluster forcefully which also deletes the secondary instance. + type: string displayName: description: User-settable and human-readable display name for the Cluster. @@ -1123,6 +1181,44 @@ spec: - clusterRef - pointInTime type: object + secondaryConfig: + description: Configuration of the secondary cluster for Cross Region + Replication. This should be set if and only if the cluster is of + type SECONDARY. + properties: + primaryClusterNameRef: + description: (Optional) Configuration of the secondary cluster + for Cross Region Replication. This should be set if and only + if the cluster is of type SECONDARY. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `name` field of an `AlloyDBCluster` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object + required: + - primaryClusterNameRef + type: object required: - location - projectRef diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbinstances.alloydb.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbinstances.alloydb.cnrm.cloud.google.com.yaml index bd83074f9aa..04dbd97e147 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbinstances.alloydb.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_alloydbinstances.alloydb.cnrm.cloud.google.com.yaml @@ -120,12 +120,33 @@ spec: instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity. type: string - instanceType: - description: 'Immutable. The type of the instance. If the instance - type is READ_POOL, provide the associated PRIMARY instance in the - ''depends_on'' meta-data attribute. Possible values: ["PRIMARY", - "READ_POOL"].' - type: string + instanceTypeRef: + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `clusterType` field of an `AlloyDBCluster` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object machineConfig: description: Configurations for the machines that host the underlying database engine. @@ -150,7 +171,7 @@ spec: type: string required: - clusterRef - - instanceType + - instanceTypeRef type: object status: properties: @@ -316,12 +337,33 @@ spec: instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity. type: string - instanceType: - description: 'Immutable. The type of the instance. If the instance - type is READ_POOL, provide the associated PRIMARY instance in the - ''depends_on'' meta-data attribute. Possible values: ["PRIMARY", - "READ_POOL"].' - type: string + instanceTypeRef: + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: 'Allowed value: The `clusterType` field of an `AlloyDBCluster` + resource.' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + type: object machineConfig: description: Configurations for the machines that host the underlying database engine. @@ -346,7 +388,7 @@ spec: type: string required: - clusterRef - - instanceType + - instanceTypeRef type: object status: properties: diff --git a/pkg/clients/generated/apis/alloydb/v1beta1/alloydbcluster_types.go b/pkg/clients/generated/apis/alloydb/v1beta1/alloydbcluster_types.go index 00aab99586e..b952be1bd44 100644 --- a/pkg/clients/generated/apis/alloydb/v1beta1/alloydbcluster_types.go +++ b/pkg/clients/generated/apis/alloydb/v1beta1/alloydbcluster_types.go @@ -146,6 +146,11 @@ type ClusterRestoreContinuousBackupSource struct { PointInTime string `json:"pointInTime"` } +type ClusterSecondaryConfig struct { + /* (Optional) Configuration of the secondary cluster for Cross Region Replication. This should be set if and only if the cluster is of type SECONDARY. */ + PrimaryClusterNameRef v1alpha1.ResourceRef `json:"primaryClusterNameRef"` +} + type ClusterStartTimes struct { /* Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time. */ // +optional @@ -191,12 +196,22 @@ type AlloyDBClusterSpec struct { // +optional AutomatedBackupPolicy *ClusterAutomatedBackupPolicy `json:"automatedBackupPolicy,omitempty"` + /* The type of cluster. If not set, defaults to PRIMARY. Default value: "PRIMARY" Possible values: ["PRIMARY", "SECONDARY"]. */ + // +optional + ClusterType *string `json:"clusterType,omitempty"` + /* The continuous backup config for this cluster. If no policy is provided then the default policy will be used. The default policy takes one backup a day and retains backups for 14 days. */ // +optional ContinuousBackupConfig *ClusterContinuousBackupConfig `json:"continuousBackupConfig,omitempty"` + /* Policy to determine if the cluster should be deleted forcefully. + Deleting a cluster forcefully, deletes the cluster and all its associated instances within the cluster. + Deleting a Secondary cluster with a secondary instance REQUIRES setting deletion_policy = "FORCE" otherwise an error is returned. This is needed as there is no support to delete just the secondary instance, and the only way to delete secondary instance is to delete the associated secondary cluster forcefully which also deletes the secondary instance. */ + // +optional + DeletionPolicy *string `json:"deletionPolicy,omitempty"` + /* User-settable and human-readable display name for the Cluster. */ // +optional DisplayName *string `json:"displayName,omitempty"` @@ -236,6 +251,10 @@ type AlloyDBClusterSpec struct { /* Immutable. The source when restoring via point in time recovery (PITR). Conflicts with 'restore_backup_source', both can't be set together. */ // +optional RestoreContinuousBackupSource *ClusterRestoreContinuousBackupSource `json:"restoreContinuousBackupSource,omitempty"` + + /* Configuration of the secondary cluster for Cross Region Replication. This should be set if and only if the cluster is of type SECONDARY. */ + // +optional + SecondaryConfig *ClusterSecondaryConfig `json:"secondaryConfig,omitempty"` } type ClusterBackupSourceStatus struct { diff --git a/pkg/clients/generated/apis/alloydb/v1beta1/alloydbinstance_types.go b/pkg/clients/generated/apis/alloydb/v1beta1/alloydbinstance_types.go index 6be5ece880d..50ab6f24752 100644 --- a/pkg/clients/generated/apis/alloydb/v1beta1/alloydbinstance_types.go +++ b/pkg/clients/generated/apis/alloydb/v1beta1/alloydbinstance_types.go @@ -75,8 +75,7 @@ type AlloyDBInstanceSpec struct { // +optional GceZone *string `json:"gceZone,omitempty"` - /* Immutable. The type of the instance. If the instance type is READ_POOL, provide the associated PRIMARY instance in the 'depends_on' meta-data attribute. Possible values: ["PRIMARY", "READ_POOL"]. */ - InstanceType string `json:"instanceType"` + InstanceTypeRef v1alpha1.ResourceRef `json:"instanceTypeRef"` /* Configurations for the machines that host the underlying database engine. */ // +optional diff --git a/pkg/clients/generated/apis/alloydb/v1beta1/zz_generated.deepcopy.go b/pkg/clients/generated/apis/alloydb/v1beta1/zz_generated.deepcopy.go index c58f2c8c326..16ce5c48498 100644 --- a/pkg/clients/generated/apis/alloydb/v1beta1/zz_generated.deepcopy.go +++ b/pkg/clients/generated/apis/alloydb/v1beta1/zz_generated.deepcopy.go @@ -260,11 +260,21 @@ func (in *AlloyDBClusterSpec) DeepCopyInto(out *AlloyDBClusterSpec) { *out = new(ClusterAutomatedBackupPolicy) (*in).DeepCopyInto(*out) } + if in.ClusterType != nil { + in, out := &in.ClusterType, &out.ClusterType + *out = new(string) + **out = **in + } if in.ContinuousBackupConfig != nil { in, out := &in.ContinuousBackupConfig, &out.ContinuousBackupConfig *out = new(ClusterContinuousBackupConfig) (*in).DeepCopyInto(*out) } + if in.DeletionPolicy != nil { + in, out := &in.DeletionPolicy, &out.DeletionPolicy + *out = new(string) + **out = **in + } if in.DisplayName != nil { in, out := &in.DisplayName, &out.DisplayName *out = new(string) @@ -306,6 +316,11 @@ func (in *AlloyDBClusterSpec) DeepCopyInto(out *AlloyDBClusterSpec) { *out = new(ClusterRestoreContinuousBackupSource) **out = **in } + if in.SecondaryConfig != nil { + in, out := &in.SecondaryConfig, &out.SecondaryConfig + *out = new(ClusterSecondaryConfig) + **out = **in + } return } @@ -482,6 +497,7 @@ func (in *AlloyDBInstanceSpec) DeepCopyInto(out *AlloyDBInstanceSpec) { *out = new(string) **out = **in } + out.InstanceTypeRef = in.InstanceTypeRef if in.MachineConfig != nil { in, out := &in.MachineConfig, &out.MachineConfig *out = new(InstanceMachineConfig) @@ -1097,6 +1113,23 @@ func (in *ClusterRestoreContinuousBackupSource) DeepCopy() *ClusterRestoreContin return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSecondaryConfig) DeepCopyInto(out *ClusterSecondaryConfig) { + *out = *in + out.PrimaryClusterNameRef = in.PrimaryClusterNameRef + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSecondaryConfig. +func (in *ClusterSecondaryConfig) DeepCopy() *ClusterSecondaryConfig { + if in == nil { + return nil + } + out := new(ClusterSecondaryConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterStartTimes) DeepCopyInto(out *ClusterStartTimes) { *out = *in diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbbackup.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbbackup.md index daa985bd8ae..489a38bc475 100644 --- a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbbackup.md +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbbackup.md @@ -457,8 +457,9 @@ metadata: name: alloydbbackup-dep spec: clusterRef: - external: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbbackup-dep - instanceType: PRIMARY + name: alloydbbackup-dep + instanceTypeRef: + name: alloydbbackup-dep --- apiVersion: compute.cnrm.cloud.google.com/v1beta1 kind: ComputeAddress diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbcluster.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbcluster.md index 45ee47ad59e..990a9e62c29 100644 --- a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbcluster.md +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbcluster.md @@ -100,6 +100,7 @@ automatedBackupPolicy: minutes: integer nanos: integer seconds: integer +clusterType: string continuousBackupConfig: enabled: boolean encryptionConfig: @@ -108,6 +109,7 @@ continuousBackupConfig: name: string namespace: string recoveryWindowDays: integer +deletionPolicy: string displayName: string encryptionConfig: kmsKeyNameRef: @@ -149,6 +151,11 @@ restoreContinuousBackupSource: name: string namespace: string pointInTime: string +secondaryConfig: + primaryClusterNameRef: + external: string + name: string + namespace: string ``` @@ -393,6 +400,16 @@ A duration in seconds with up to nine fractional digits, terminated by 's'. Exam

{% verbatim %}Seconds of minutes of the time. Currently, only the value 0 is supported.{% endverbatim %}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

clusterType

+

Optional

+
+

string

+

{% verbatim %}The type of cluster. If not set, defaults to PRIMARY. Default value: "PRIMARY" Possible values: ["PRIMARY", "SECONDARY"].{% endverbatim %}

+

continuousBackupConfig

@@ -477,6 +494,18 @@ If no policy is provided then the default policy will be used. The default polic If not set, defaults to 14 days.{% endverbatim %}

+

deletionPolicy

+

Optional

+
+

string

+

{% verbatim %}Policy to determine if the cluster should be deleted forcefully. +Deleting a cluster forcefully, deletes the cluster and all its associated instances within the cluster. +Deleting a Secondary cluster with a secondary instance REQUIRES setting deletion_policy = "FORCE" otherwise an error is returned. This is needed as there is no support to delete just the secondary instance, and the only way to delete secondary instance is to delete the associated secondary cluster forcefully which also deletes the secondary instance.{% endverbatim %}

+

displayName

@@ -892,6 +921,56 @@ projects/{project}/global/networks/{network_id}.{% endverbatim %}

{% verbatim %}Immutable. The point in time that this cluster is restored to, in RFC 3339 format.{% endverbatim %}

+

secondaryConfig

+

Optional

+
+

object

+

{% verbatim %}Configuration of the secondary cluster for Cross Region Replication. This should be set if and only if the cluster is of type SECONDARY.{% endverbatim %}

+
+

secondaryConfig.primaryClusterNameRef

+

Required*

+
+

object

+

{% verbatim %}(Optional) Configuration of the secondary cluster for Cross Region Replication. This should be set if and only if the cluster is of type SECONDARY.{% endverbatim %}

+
+

secondaryConfig.primaryClusterNameRef.external

+

Optional

+
+

string

+

{% verbatim %}Allowed value: The `name` field of an `AlloyDBCluster` resource.{% endverbatim %}

+
+

secondaryConfig.primaryClusterNameRef.name

+

Optional

+
+

string

+

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

+
+

secondaryConfig.primaryClusterNameRef.namespace

+

Optional

+
+

string

+

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

+
@@ -1376,7 +1455,8 @@ metadata: spec: clusterRef: name: alloydbcluster-dep-restoredfrombackup - instanceType: PRIMARY + instanceTypeRef: + name: alloydbbackup-dep-restoredfrombackup --- apiVersion: compute.cnrm.cloud.google.com/v1beta1 kind: ComputeAddress @@ -1407,6 +1487,147 @@ spec: service: servicenetworking.googleapis.com ``` +### Secondary Cluster +```yaml +# 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: AlloyDBCluster +metadata: + name: alloydbcluster-dep-secondary +spec: + location: us-east1 + networkConfig: + networkRef: + name: alloydbcluster-dep-secondary + projectRef: + external: ${PROJECT_ID?} + automatedBackupPolicy: + backupWindow: 3600s + encryptionConfig: + kmsKeyNameRef: + name: alloydbcluster-dep-secondary + enabled: true + labels: + source: kcc + location: us-east1 + timeBasedRetention: + retentionPeriod: 43200s + weeklySchedule: + daysOfWeek: [MONDAY] + startTimes: + - hours: 4 + minutes: 0 + seconds: 0 + nanos: 0 + encryptionConfig: + kmsKeyNameRef: + name: alloydbcluster-dep-secondary + initialUser: + user: "postgres" + password: + value: "postgres" +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbcluster-sample-secondary +spec: + location: us-west1 + networkConfig: + networkRef: + name: alloydbcluster-dep-secondary + projectRef: + external: ${PROJECT_ID?} + clusterType: "SECONDARY" + secondaryConfig: + primaryClusterNameRef: + name: alloydbcluster-dep-secondary + deletionPolicy: "FORCE" +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: alloydbcluster-dep-secondary +spec: + location: global + addressType: INTERNAL + networkRef: + name: alloydbcluster-dep-secondary + prefixLength: 16 + purpose: VPC_PEERING +--- +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: alloydbcluster-dep-secondary +--- +apiVersion: iam.cnrm.cloud.google.com/v1beta1 +kind: IAMPartialPolicy +metadata: + name: alloydbcluster-dep-secondary +spec: + resourceRef: + apiVersion: kms.cnrm.cloud.google.com/v1beta1 + kind: KMSCryptoKey + name: alloydbcluster-dep-secondary + bindings: + - role: roles/cloudkms.cryptoKeyEncrypterDecrypter + members: + - memberFrom: + serviceIdentityRef: + name: alloydbcluster-dep-secondary +--- +apiVersion: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSCryptoKey +metadata: + labels: + source: kcc-alloydbcluster-sample + name: alloydbcluster-dep-secondary +spec: + keyRingRef: + name: alloydbcluster-dep-secondary +--- +apiVersion: kms.cnrm.cloud.google.com/v1beta1 +kind: KMSKeyRing +metadata: + name: alloydbcluster-dep-secondary +spec: + location: us-east1 +--- +apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: alloydbcluster-dep-secondary +spec: + networkRef: + name: alloydbcluster-dep-secondary + reservedPeeringRanges: + - external: alloydbcluster-dep-secondary + service: servicenetworking.googleapis.com +--- +apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1 +kind: ServiceIdentity +metadata: + name: alloydbcluster-dep-secondary +spec: + projectRef: + external: ${PROJECT_ID?} + resourceID: alloydb.googleapis.com +``` + Note: If you have any trouble with instantiating the resource, refer to Troubleshoot Config Connector. diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbinstance.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbinstance.md index d735af84ebf..95fb44012da 100644 --- a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbinstance.md +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbinstance.md @@ -88,7 +88,10 @@ databaseFlags: string: string displayName: string gceZone: string -instanceType: string +instanceTypeRef: + external: string + name: string + namespace: string machineConfig: cpuCount: integer readPoolConfig: @@ -200,12 +203,42 @@ can have regional availability (nodes are present in 2 or more zones in a region -

instanceType

+

instanceTypeRef

Required

+ +

object

+

{% verbatim %}{% endverbatim %}

+ + + + +

instanceTypeRef.external

+

Optional

+ + +

string

+

{% verbatim %}Allowed value: The `clusterType` field of an `AlloyDBCluster` resource.{% endverbatim %}

+ + + + +

instanceTypeRef.name

+

Optional

+ + +

string

+

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

+ + + + +

instanceTypeRef.namespace

+

Optional

+

string

-

{% verbatim %}Immutable. The type of the instance. If the instance type is READ_POOL, provide the associated PRIMARY instance in the 'depends_on' meta-data attribute. Possible values: ["PRIMARY", "READ_POOL"].{% endverbatim %}

+

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

@@ -422,7 +455,8 @@ metadata: spec: clusterRef: name: alloydbinstance-dep-primary - instanceType: PRIMARY + instanceTypeRef: + name: alloydbinstance-dep-primary databaseFlags: enable_google_adaptive_autovacuum: "off" machineConfig: @@ -491,8 +525,9 @@ metadata: name: alloydbinstance-dep-read spec: clusterRef: - external: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbinstance-dep-read - instanceType: PRIMARY + name: alloydbinstance-dep-read + instanceTypeRef: + name: alloydbinstance-dep-read --- apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 kind: AlloyDBInstance @@ -500,8 +535,9 @@ metadata: name: alloydbinstance-sample-read spec: clusterRef: - external: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbinstance-dep-read - instanceType: READ_POOL + name: alloydbinstance-dep-read + instanceTypeRef: + external: READ_POOL availabilityType: REGIONAL databaseFlags: google_columnar_engine.enabled: "on" @@ -551,6 +587,100 @@ spec: service: servicenetworking.googleapis.com ``` +### Secondary Instance +```yaml +# 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-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: us-central1 + networkConfig: + networkRef: + name: alloydbinstance-dep-secondary + projectRef: + external: ${PROJECT_ID?} +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbinstance-dep1-secondary +spec: + location: us-east1 + networkConfig: + networkRef: + name: alloydbinstance-dep-secondary + projectRef: + external: ${PROJECT_ID?} + clusterType: "SECONDARY" + secondaryConfig: + primaryClusterNameRef: + name: alloydbinstance-dep-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 ```yaml # Copyright 2023 Google LLC @@ -575,7 +705,8 @@ spec: clusterRef: name: alloydbinstance-dep-zonal availabilityType: ZONAL - instanceType: PRIMARY + instanceTypeRef: + name: alloydbinstance-dep-zonal machineConfig: cpuCount: 2 --- diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbuser.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbuser.md index 5affeb7c214..6a3cc96e121 100644 --- a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbuser.md +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/alloydb/alloydbuser.md @@ -384,7 +384,8 @@ metadata: spec: clusterRef: name: alloydbuser-dep-database - instanceType: PRIMARY + instanceTypeRef: + name: alloydbuser-dep-database databaseFlags: enable_google_adaptive_autovacuum: "off" machineConfig: @@ -467,7 +468,8 @@ metadata: spec: clusterRef: name: alloydbuser-dep-iam - instanceType: PRIMARY + instanceTypeRef: + name: alloydbuser-dep-iam databaseFlags: enable_google_adaptive_autovacuum: "off" machineConfig: