-
Notifications
You must be signed in to change notification settings - Fork 372
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
(Secretsmanager): If the K8s do not exist, the secret is not created with the data from AWS #2076
Comments
When I try to create the following problem, the secret does not build in Kubernetes
k get secrets.secretsmanager.aws.crossplane.io | grep -i example
k describe secrets.secretsmanager.aws.crossplane.io example-secret-h21
kubectl get secret -n test-secret example-secret-manager-h21 -o yaml
|
@davirezendegb can you ensure that namespace |
I really had the namespace wrong:
k describe secrets.secretsmanager.aws.crossplane.io example-secret-h21
k get secrets.secretsmanager.aws.crossplane.io | grep -i example k get ns | grep -i teste-secret k get secret -n teste-secret example-secret-manager-h21 -o yaml |
@davirezendegb does the secret exist already in AWS? In my testing:
You will get an error like the |
it really worked when I created it in AWS. |
@davirezendegb the secret data needs to exist somewhere. Usually when using Crossplane you are creating a secret in AWS, so having it defined in the stringSecretRef on the Crossplane cluster is the usual practice. However, if there is an existing secret already there, this provider can take over management it and will create the secret in K8s for you from the data in AWS. |
@stevendborrelli I carried out some tests, however, I noticed that when I try to insert new values in AWS they are not replicated to the Kubernetes secret. |
Isn't it possible to create an exception so that when it doesn't exist in AWS or Kubernetes, it would preferably create one automatically in AWS?
|
The providers work on desired state, so the k8s values should always override what is in AWS. The initial empty k8s secret is a corner case, similar to taking over an existing resource. Q2:
A secret manager secret cannot be created without secret data. See https://docs.aws.amazon.com/sdk-for-go/api/service/secretsmanager/#CreateSecretInput
|
Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as |
What happened?
If the K8s do not exist, the secret is not created with the data from AWS.
Exist part of the code says it is possible, but don't work.
https://github.com/crossplane-contrib/provider-aws/blob/master/pkg/controller/secretsmanager/secret/setup.go#L169C2-L169C64
How can we reproduce it?
Create a secretManager object with this exemple above:
What environment did it happen in?
Crossplane version: 1.14.7
Crossplane Contrib Provider Version: v0.48.1
The text was updated successfully, but these errors were encountered: