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

Improve SecretTemplate to create secrets from different namespaces #149

Open
felipenferri opened this issue Nov 18, 2022 · 2 comments
Open
Labels
carvel-accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request

Comments

@felipenferri
Copy link

Describe the problem/challenge you have
We can create secrets from different Namespaces with SecretTemplate

Describe the solution you'd like
Enable option in metadata to add namespace

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you would like to work on this issue.

@felipenferri felipenferri added carvel-triage This issue has not yet been reviewed for validity enhancement This issue is a feature request labels Nov 18, 2022
@sathyanarays
Copy link

Please provide some more details on current behavior and the expected behavior!

@mamachanko
Copy link
Contributor

mamachanko commented Nov 21, 2022

@felipenferri the Secret(Export|Import) CRD's responsibility is to facilitate and control cross-namespace usage of Secret resources. You can combine these with SecretTemplate to template a Secret from other Secrets you imported into the current Namespace. To work off of SecretTemplate's example in the docs and assuming that SecretExport exist for password and username, consider:

---
apiVersion: v1
kind: SecretImport
metadata:
  name: password
  namespace: my-ns
fromNamespace: other-ns

---
apiVersion: v1
kind: SecretImport
metadata:
  name: username
  namespace: my-ns
fromNamespace: other-ns

---
apiVersion: secretgen.carvel.dev/v1alpha1
kind: SecretTemplate
metadata:
  name: new-secret
spec:
  #! list of resources to read information off
  inputResources:
  - name: username-secret
    ref:
      apiVersion: v1
      kind: Secret
      name: username
  - name: password-secret
    ref:
      apiVersion: v1
      kind: Secret
      name: password
  #! the template that follows a subset of the Secret API
  template:
    #! data is used for templating in data that *is* base64 encoded, most likely Secrets.
    data:
      password: $(.password-secret.data.password)
      username: $(.username-secret.data.username)

@neil-hickey neil-hickey added carvel-accepted This issue should be considered for future work and that the triage process has been completed and removed carvel-triage This issue has not yet been reviewed for validity labels Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel-accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request
Projects
Status: Unprioritized
Development

No branches or pull requests

4 participants