-
Notifications
You must be signed in to change notification settings - Fork 378
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
DBCluster masterUserPasswordSecretRef required, even when AWS can't take it (when replicating) #1225
Comments
can you try provider-aws version 0.25 ? we running aurora cluster without problems |
As I said:
So, we plan to try it on the 0.25 soon. But, the issue isn't "running aurora cluster", it is specifically starting a new one with the option "replicationSourceIdentifier" specified. In that case, AWS will not accept a password value, but the provider (even in 0.25.0 still requires it: Essentially, we are setting these new clusters to replicate from the old non-aurora instances, cutting over, and then killing the old instances as AWS suggests for migrating from vanilla to Aurora. |
okay got it think we can change this here https://github.com/crossplane/provider-aws/blob/master/apis/rds/v1alpha1/custom_types.go#L60 adding optional/,omitempty and check the controller here https://github.com/crossplane/provider-aws/blob/master/pkg/controller/rds/dbcluster/setup.go#L91 |
#1413 fixed this issue |
What happened?
When creating a
DBCluster.rds.aws.crossplane.io/v1alpha1
object, the valuereplicationSourceIdentifier
can be set to an ARN likearn:aws:rds:us-west-2:123456789:db:funtimesdb
to have the new Aurora cluster replicate from that specified instance. When you do, AWS will not accept amasterUsername
, a master password, ordatabaseName
because all of that information will come from the master the new cluster will replicate from.The issue is that on the
DBCluster
object,masterUserPasswordSecretRef
is always required, even in the case of a valid entry inreplicationSourceIdentifier
causing AWS to reject the request because it contains a password.My current workaround is to specify a real secret in
masterUserPasswordSecretRef
, but in it to specify akey
that does not exist:When I do so, the arbitrary requirement for
masterUserPasswordSecretRef
is satisfied, but because it can't find the value in that secret crossplane either doesn't specify the secret in the request or it is null, therefore AWS accepts the request.The other, related issue is that of password generation on a new cluster. Unlike
DBInstance.rds.aws.crossplane.io/v1alpha1
with it's nullableMasterUserPasswordSecretRef
and the booleanautogeneratePassword
andRDSInstance.database.aws.crossplane.io/v1beta1
with it's nullableMasterUserPasswordSecretRef
, onDBCluster
you MUST specify the password in an existing secret when creating the cluster. It would be great ifDBCluster
had the same nullableMasterUserPasswordSecretRef
and booleanautogeneratePassword
combo asDBInstance
so that it fixes the main issue of this bug report AND allows for auto password generation makingDBCluster
behavior consistent withDBInstance
(and moreor less consistent withRDSInstance
.We are upgrading Crossplane and the provider to the newest version to help with another issue (#895) but I don't think it will help here as this is documented even in the newer versions.
How can we reproduce it?
Apply this secret and DBCluster to get the AWS rejection message (same error as when you unnecessarily supply masterUsername or databaseName):
NOTE:
replicationSourceIdentifier
must point to a working and compatible database instance.To get the error from Crossplane, comment out "masterUserPasswordSecretRef" or specify a secret that doesn't exist and it will either tell you masterUserPasswordSecretRef is required or that the one specified doesn't exist.
To get it to work, comment
key: password
and uncomment#key: thisisnotreal
.What environment did it happen in?
Crossplane version: 1.0.0
Provider version: 0.20.0 (but according to the documentation, this is still the case with 0.25.0
Kubernetes distro: AWS EKS
Kubernetes version: 1.20.11
kubectl version
:The text was updated successfully, but these errors were encountered: