Skip to content

Commit

Permalink
Add sample for secondary instance
Browse files Browse the repository at this point in the history
  • Loading branch information
199201shubhamsahu committed Feb 22, 2024
1 parent 1e16308 commit b1ba70b
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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: 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:
primaryClusterName: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbinstance-dep1-secondary
deletionPolicy: "FORCE"
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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: alloydbinstance-dep-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: rororo
spec:
location: us-east1
networkConfig:
networkRef:
name: alloydbinstance-dep-read
projectRef:
external: shubhsahu-terraform
clusterType: "PRIMARY"
secondaryConfig:
primaryClusterName: projects/shubhsahu-terraform/locations/us-central1/clusters/alloydbinstance-dep-read
deletionPolicy: "FORCE"
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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:
external: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbinstance-dep1-secondary
instanceType: PRIMARY
---
apiVersion: alloydb.cnrm.cloud.google.com/v1beta1
kind: AlloyDBInstance
metadata:
name: alloydbinstance-sample-secondary
spec:
clusterRef:
external: projects/${PROJECT_ID?}/locations/us-east1/clusters/alloydbinstance-dep2-secondary
instanceType: SECONDARY
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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: 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeNetwork
metadata:
name: alloydbinstance-dep-secondary


Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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: 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

0 comments on commit b1ba70b

Please sign in to comment.