Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Backport Add cross-region replication support to AlloyDB #1421

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

cheftako
Copy link
Collaborator

@cheftako cheftako commented Mar 25, 2024

Change description

Backport hashicorp/terraform-provider-google-beta#6474

To Create a Secondary Cluster, cluster_type and secondary_config are the additional fields to be mentioned in the cluster. The secondary cluster is dependent on the primary instance and the same needs to be added in the config using the depends_on field. The field continuous_backup_config.enabled needs to be set false as continuous backup is not supported for secondary clusters. The deletion_policy is set to FORCE as the secondary instance that will be created in the secondary cluster can not be deleted independently, but instead the entire secondary cluster needs to be deleted forcefully along with its secondary instance.

  cluster_type = "SECONDARY"
  deletion_policy = "FORCE"
  secondary_config {
    primary_cluster_name = <fully qualified primary cluster name>
    // Eg: primary_cluster_name = google_alloydb_cluster.<primary_cluster_name>.name
  }

  continuous_backup_config {
    enabled = false
  }

  depends_on = [google_alloydb_instance.<primary_instance_name>]

Part of hashicorp/terraform-provider-google#13251

Release Note Template for Downstream PRs (will be copied)

alloydb: added `cluster_type` and `secondary_config` fields to support secondary clusters in `google_alloydb_cluster` resource.

Derived from GoogleCloudPlatform/magic-modules#9012

Fixes #

Tests you have done

None

  • Run make ready-pr to ensure this PR is ready for review.
  • Perform necessary E2E testing for changed resources.

Backport hashicorp/terraform-provider-google-beta#6474

To Create a Secondary Cluster, `cluster_type` and `secondary_config` are the additional fields to be mentioned in the cluster. The secondary cluster is dependent on the primary instance and the same needs to be added in the config using the `depends_on` field. The field continuous_backup_config.enabled needs to be set false as continuous backup is not supported for secondary clusters. The deletion_policy is set to FORCE as the secondary instance that will be created in the secondary cluster can not be deleted independently, but instead the entire secondary cluster needs to be deleted forcefully along with its secondary instance.

```
  cluster_type = "SECONDARY"
  deletion_policy = "FORCE"
  secondary_config {
    primary_cluster_name = <fully qualified primary cluster name>
    // Eg: primary_cluster_name = google_alloydb_cluster.<primary_cluster_name>.name
  }

  continuous_backup_config {
    enabled = false
  }

  depends_on = [google_alloydb_instance.<primary_instance_name>]
```

Part of [hashicorp/terraform-provider-google#13251](hashicorp/terraform-provider-google#13251)

**Release Note Template for Downstream PRs (will be copied)**

```
alloydb: added `cluster_type` and `secondary_config` fields to support secondary clusters in `google_alloydb_cluster` resource.
```

Derived from [GoogleCloudPlatform/magic-modules#9012](GoogleCloudPlatform/magic-modules#9012)
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from cheftako. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

justinsb and others added 5 commits March 25, 2024 17:36
Backport hashicorp/terraform-provider-google-beta#6474

To Create a Secondary Cluster, `cluster_type` and `secondary_config` are the additional fields to be mentioned in the cluster. The secondary cluster is dependent on the primary instance and the same needs to be added in the config using the `depends_on` field. The field continuous_backup_config.enabled needs to be set false as continuous backup is not supported for secondary clusters. The deletion_policy is set to FORCE as the secondary instance that will be created in the secondary cluster can not be deleted independently, but instead the entire secondary cluster needs to be deleted forcefully along with its secondary instance.

```
  cluster_type = "SECONDARY"
  deletion_policy = "FORCE"
  secondary_config {
    primary_cluster_name = <fully qualified primary cluster name>
    // Eg: primary_cluster_name = google_alloydb_cluster.<primary_cluster_name>.name
  }

  continuous_backup_config {
    enabled = false
  }

  depends_on = [google_alloydb_instance.<primary_instance_name>]
```

Part of [hashicorp/terraform-provider-google#13251](hashicorp/terraform-provider-google#13251)

**Release Note Template for Downstream PRs (will be copied)**

```
alloydb: added `cluster_type` and `secondary_config` fields to support secondary clusters in `google_alloydb_cluster` resource.
```

Derived from [GoogleCloudPlatform/magic-modules#9012](GoogleCloudPlatform/magic-modules#9012)
@@ -183,7 +182,7 @@ func registerDefaultController(r *ReconcileRegistration, config *controller.Conf
}
return schemaUpdater, nil
default:
klog.Warningf("requested direct reconciler for %v, but it is not supported", gvk.GroupKind())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what/why this changed.

@maqiuyujoyce
Copy link
Collaborator

Is it the same as #1377 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants