provider-gcp icon indicating copy to clipboard operation
provider-gcp copied to clipboard

Extends CloudSql with replicaConfiguration

Open mcbenjemaa opened this issue 2 years ago • 1 comments

Signed-off-by: Mohamed Chiheb [email protected]

Description of your changes

In order to be able to provision CloudSql failOver replicas, provider GCP CloudSql instance must include replicaConfiguration

In this PR:

  • I've added support for replicaConfiguration

  • Added support for replicaConfiguration.mysqlReplicaConfiguration with ability to hide sensitive data (Explained below)

Failover replica

To create a failover replica you must have a master replica either created manually or provisioned using crossplane.

Specify those values:

  forProvider:
    masterInstanceName: <projectId>:<masterIntanceName>
    replicaConfiguration:
      failoverTarget: true

If you, provisioned the master instance using crossplane, you need to update the master:

  forProvider:
     failoverReplica:
        name: "<replicaName>"

Sensitive Data

I have the feeling that the fields under replicaConfiguration.mysqlReplicaConfiguration are sensitive:

Thus, I made this concept of fetching those fields from a provided secret:

example:

  forProvider:
    replicaConfiguration:
      failoverTarget: false
      mysqlReplicaConfiguration:
        secretRef:         # secretRef that contain data
          name: cloudsql-replica-creds
          namespace: default
        usernameKey: "username"  # a reference key from the specified secret above
        passwordKey: "password"    # a reference key from the specified secret above

what do you think about this config?

WIP

Still WIP

TBD

Fixes # ?

related #388

I have:

  • [X] Read and followed Crossplane's contribution process.
  • [ ] Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Tested on a GCP account.

mcbenjemaa avatar Dec 23 '21 17:12 mcbenjemaa