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

Unable to DBCluster "aurora-mysql" and assign instances #844

Closed
eloo opened this issue Sep 28, 2021 · 12 comments
Closed

Unable to DBCluster "aurora-mysql" and assign instances #844

eloo opened this issue Sep 28, 2021 · 12 comments
Labels
bug Something isn't working

Comments

@eloo
Copy link

eloo commented Sep 28, 2021

What happened?

Hi,
i'm currently trying to setup an aurora cluster with "aurora-mysql" engine and add some instances to it.
The creation of the db cluster seems to work as expected but when i try to assign a rdsinstance to it i'm getting errors.

The error shown for the rds instance is the following

create failed: cannot create RDS instance: InvalidParameterCombination: The requested DB Instance will be a member of a DB Cluster. Set master user password for the DB Cluster.

The interesting part is that i have set the masterUserPasswordSecretRef in the db cluster but still see this error.
I have also tried to set the masterPasswordSecretRef in the instance but this leads also to the same error.

So currently it seems that its not possible to create a DBCluster with instances.

How can we reproduce it?

dbcluster.yaml

apiVersion: rds.aws.crossplane.io/v1alpha1
kind: DBCluster
metadata:
  name: example-rdsmysql-aurora
spec:
  forProvider:
    region: eu-central-1
    engine: aurora-mysql
    masterUsername: admin
    masterUserPasswordSecretRef:
      name: dbcluster-pwd
      namespace: crossplane-system
      key: password
    databaseName: auroradb
  writeConnectionSecretToRef:
    name: aurora-secrets
    namespace: default
  providerConfigRef:
    name: aws-provider-config

---
apiVersion: v1
kind: Secret
metadata:
  name: dbcluster-pwd
  namespace: crossplane-system
type: Opaque
data:
  password: dGVzdFBhc3N3b3JkITEyMw== # testPassword!123

instance.yaml

apiVersion: database.aws.crossplane.io/v1beta1
kind: RDSInstance
metadata:
  name: example-rdsmysql
spec:
  forProvider:
    region: eu-central-1
    dbInstanceClass: db.t3.small
    engine: aurora-mysql
    skipFinalSnapshotBeforeDeletion: true
    dbClusterIdentifier: example-rdsmysql-aurora
  providerConfigRef:
    name: aws-provider-config

What environment did it happen in?

Crossplane version: 1.3.1

Cloud provider or hardware configuration - aws-provider v0.19.0
Kubernetes version (use kubectl version) - v1.21.2-eks-0389ca3
Kubernetes distribution (e.g. Tectonic, GKE, OpenShift) - EKS
OS (e.g. from /etc/os-release) - Amazon Linux

@eloo
Copy link
Author

eloo commented Sep 29, 2021

Just tested if i can add a instance using the aws cli.

Seems to work with this command. So it seems that this is a bug in the controller

 aws rds  \                                                                                                                                    
create-db-instance \
--db-cluster-identifier example-rdsmysql-aurora \
--db-instance-class db.t3.small \
--db-instance-identifier example-rdsmysql-aurora-instance-1 \
--engine aurora-mysql

@jbhennin
Copy link

jbhennin commented Oct 1, 2021

This issue should be a priority in my opinion. The ability to provision an Aurora resource is completely broken

@chlunde
Copy link
Collaborator

chlunde commented Oct 1, 2021

it might be that this part should be skipped for aurora DBClusters:

https://github.com/crossplane/provider-aws/blob/f7e4da1360b0440614401705346b3852dfd7f4d3/pkg/controller/database/rdsinstance.go#L161-L170

There's a new DBInstance type, which might not have the same issue:

https://github.com/crossplane/provider-aws/blob/master/pkg/controller/rds/dbinstance/setup.go#L89-L103

could you try this resource instead?

https://github.com/crossplane/provider-aws/blob/master/examples/rds/dbinstance.yaml

If it works, we should update the examples/rds/ to have a aurora cluster w/ a matching db instance.

@haarchri
Copy link
Member

haarchri commented Oct 1, 2021

please check: #852

image

@eloo
Copy link
Author

eloo commented Oct 4, 2021

@haarchri
seems like this is still not yet released. so i'm unable to test it.
But at least the example looks promising. Maybe you can add some kind of grouping to example so its clear what it related to the cluster and what is a single instance or something else.

@robertgates55
Copy link

Thanks @eloo

@haarchri Any update on when this'll be in? DBInstance looks to have been in master for quite a while?

@haarchri
Copy link
Member

haarchri commented Oct 5, 2021

@robertgates55 it is in master merged via #852

@robertgates55
Copy link

robertgates55 commented Oct 5, 2021

Cool - thanks. When will the next release be cut?

@haarchri
Copy link
Member

haarchri commented Oct 5, 2021

please raise this question in Slack - thanks
@eloo can we close the issue ?

@eloo
Copy link
Author

eloo commented Oct 6, 2021

@haarchri
yes we can close this issues. seems to be fixed in the next release

@haarchri
Copy link
Member

@eloo can you close this issue ? we have it now in the 0.20.0 release - thanks ;)

@eloo
Copy link
Author

eloo commented Oct 22, 2021

@haarchri we have not yet tested it in the current release but as mentioned in the RC it was working as expected.

so from my side we can close this.

Thanks

@eloo eloo closed this as completed Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants