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

Load secret info from k8s Secret objects. #319

Closed
docwhat opened this issue Jul 30, 2020 · 7 comments · Fixed by #482
Closed

Load secret info from k8s Secret objects. #319

docwhat opened this issue Jul 30, 2020 · 7 comments · Fixed by #482
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@docwhat
Copy link

docwhat commented Jul 30, 2020

Is your feature request related to a problem? Please describe.

I'm using HelmResource CRD objects to install and manage helm v3 packages. Putting a secret in clear text in a HelmResource yaml file, to be committed in a git repository, is a no-no.

Secrets need to be stored separately, ideally in a sealed secret.

Describe the solution you'd like

Instead of storing secret information in the values.yaml, the values.yaml should allow pointing at an exist k8s Secret object by name and namespace.

Describe alternatives you've considered

There isn't really any way to use the chart with the current design without leaking secrets.

Additional context

I like the project. It looks cool!

@docwhat docwhat added the enhancement New feature or request label Jul 30, 2020
@PrasadG193 PrasadG193 added good first issue Good for newcomers help wanted Extra attention is needed and removed good first issue Good for newcomers labels Sep 26, 2020
@lukasmrtvy
Copy link

lukasmrtvy commented Dec 29, 2020

Is possible to resolve ENV variables in comm_config.yaml ?
What about this?

communications:
  slack:
    enabled: false
    channel: $(MY_SLACK_CHANNEL)
    token: $(MY_SLACK_API_TOKEN)
    notiftype: short
extraEnv:
  - name: MY_SLACK_CHANNEL
    value: "foo"
  - name: MY_SLACK_API_TOKEN
    valueFrom:
      secretKeyRef:
        name: mysecret
        key: token

Btw: extraEnv is not supporting valueFrom in helm chart, but its easy to do..

@docwhat
Copy link
Author

docwhat commented Dec 29, 2020

That seems like it would work. Is using environment variables the ideal way to set secrets?

@robincher
Copy link

Have a similar related questions to @lukasmrtvy

Can i use an Env variables to overwrite the configMap values?

If so, where should i put it? At the Deployment level with the corresponding container env vars ? or at the config level shown above.

extraEnv:
  - name: MY_SLACK_CHANNEL
    value: "foo"
  - name: MY_SLACK_API_TOKEN
    valueFrom:
      secretKeyRef:
        name: mysecret
        key: token

@lebenitza
Copy link

Any news about this?

@pierluigilenoci
Copy link
Contributor

Any news? @ebrianne already solved this here: https://github.com/ebrianne/helm-charts/pull/9

@ebrianne
Copy link
Contributor

ebrianne commented May 6, 2021

If that's fine I can make a PR soon to integrate this into the official chart

@pierluigilenoci
Copy link
Contributor

@ebrianne I've added a comment about your solution here: #480 (comment), could you please take a look?

@mergify mergify bot closed this as completed in #482 May 25, 2021
mergify bot pushed a commit that referenced this issue May 25, 2021
)

##### ISSUE TYPE
 - Feature Pull Request

##### SUMMARY
I have implemented in the helm chart the possibility to pass the communication config as a k8s secret and configure in the value files via an existingSecret. It can be configured in the values file via these:

```yaml
communications:
    existingSecret: false
    existingSecretName: ""
```

Fixes #319 #211 #226 #233
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants