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

Option to avoid creating empty output resources (ConfigMaps/Secrets) #425

Open
nabadger opened this issue Jun 6, 2024 · 0 comments
Open

Comments

@nabadger
Copy link

nabadger commented Jun 6, 2024

Description

In our use-case, we don't make use of Workspace or Module outputs. I've noticed that these resources are still created with empty data.

It would be beneficial to have the option to avoid creating these empty resources.

The potential benefits are:

  1. Less resources on k8s. We actually impl. ResourceQuotas here and hit this - it was only then that I noticed they were empty. I'm not sure this was the case with the v1 operator which seems to have them populated.
  2. Less reconciliation work for the controllers todo

If we went down the route of not writing out the secret, then it could be a breaking feature since applications may be relying on these (i.e. referencing them in their Deployment manifests.

I therefore think we should have options around this, perhaps something like:

createOutputResourcesIfEmpty: true|false  # default true  

Potential YAML Configuration

apiVersion: app.terraform.io/v1alpha2
kind: Module
metadata:
  name: this
spec:
  organization: kubernetes-operator
  token:
    secretKeyRef:
      name: tfc-operator
      key: token
  destroyOnDeletion: true
  module:
    source: app.terraform.io/kubernetes-operator/module-random/provider
    version: 0.0.5
  variables:
  - name: counter
  createOutputResourcesIfEmpty: true|false  # default true  
  outputs:
  - name: secret
    sensitive: true
  - name: random_strings
  workspace:

Regarding an option to disable outputs entirely, I suspect this would have to be a cmd-line arg to the controller.

References

#418

Community Note

  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants