WIP: main Update default values.yaml to make persistence work + update readme for secrets usage #16

Closed
hugosxm wants to merge 2 commits from hugosxm/helm-chart:main into main
First-time contributor
No description provided.
hugosxm added 2 commits 2023-11-16 14:43:08 +00:00
9bb51e1666
Fix wrong mountPath for default PVC in value.yaml
Signed-off-by: CAMPION Hugo <h.campion@geco-it.fr>
continuous-integration/drone/pr Build is passing Details
1583ce39c8
Update README: add instructions for the use of secrets
Signed-off-by: CAMPION Hugo <h.campion@geco-it.fr>
perfectra1n requested changes 2023-11-17 16:01:32 +00:00
@ -85,6 +85,31 @@ If you need to create another user, you could opt to execute the following comma
./vikunja user create --email <user@email.com> --user <user1> --password <password123>
```
### Utilizing secrets for `env` and `config.yml`
Contributor

Maybe we could change this header to be:
"Utilizing environment variables from Kubernetes secrets"?

"Each environment variable within the pod can be sourced from a secret in your values.yaml":

api:
  env:
    VIKUNJA_DATABASE_PASSWORD:
      valueFrom:
        secretKeyRef:
          name: vikunja-env
          key: VIKUNJA_DATABASE_PASSWORD
    VIKUNJA_DATABASE_USERNAME: "db-user"

Alternatively, instead of defining each and every key, if the keys within the secret are the names of environment variables, you could also do the following (example here):

api:
  envFrom:
    - secretRef:
      name: vikunja-secret-env
  env:
    VIKUNJA_DATABASE_USERNAME: "db-user"

This way we can show in the example that you can both use environment variables from secrets, how to use envFrom, etc.

I should've included this already in the README.md, so I'm thankful that you brought it up!

Maybe we could change this header to be: "Utilizing environment variables from Kubernetes secrets"? "Each environment variable within the pod can be sourced from a secret in your `values.yaml`": ```yaml api: env: VIKUNJA_DATABASE_PASSWORD: valueFrom: secretKeyRef: name: vikunja-env key: VIKUNJA_DATABASE_PASSWORD VIKUNJA_DATABASE_USERNAME: "db-user" ``` Alternatively, instead of defining each and every key, if the keys within the secret are the names of environment variables, you could also do the following (example [here](https://github.com/bjw-s/helm-charts/blob/a081de53024d8328d1ae9ff7e4f6bc500b0f3a29/charts/library/common/values.yaml#L155)): ```yaml api: envFrom: - secretRef: name: vikunja-secret-env env: VIKUNJA_DATABASE_USERNAME: "db-user" ``` This way we can show in the example that you can both use environment variables from secrets, how to use `envFrom`, etc. I should've included this already in the README.md, so I'm thankful that you brought it up!
@ -88,0 +101,4 @@
If your vikunja config needs to contain sensible data, like oauth config, you can source it from a secret in your `values.yaml`:
```yaml
api:
Contributor

Instead of:

  persistence:
    config:
      enabled: true
      type: secret
      mountPath: /etc/vikunja/config.yml

You could do the following:

api:
  persistence:
    config:
      type: secret
      name: asdf-my-custom-secret1

Since the config is already enabled by default.

Also this way you can provide the name of the secret, and you don't have to provide the mountPath again since it's already part of the template here.

Instead of: ```yaml persistence: config: enabled: true type: secret mountPath: /etc/vikunja/config.yml ``` You could do the following: ```yaml api: persistence: config: type: secret name: asdf-my-custom-secret1 ``` Since the config is already enabled by default. Also this way you can provide the name of the secret, and you don't have to provide the `mountPath` again since it's already part of the template [here](https://kolaente.dev/vikunja/helm-chart/src/commit/62112e8df085b4868bb934f64c0debccee3d1545/templates/api.yaml#L22).
Contributor

Created #17 so that the issue could at least be resolved, and so that more documentation could be available.

Created #17 so that the issue could at least be resolved, and so that more documentation could be available.
Contributor

@hugosxm I believe that my PR #17 should've resolved the issues you brought up previously, as well as increasing the documentation around the use cases that you provided. Let me know if there's anything else that you would like to see, I believe this PR can be closed out otherwise though.

Again, feel free to reach out, and thanks for your contribution and help!

@hugosxm I believe that my PR #17 should've resolved the issues you brought up previously, as well as increasing the documentation around the use cases that you provided. Let me know if there's anything else that you would like to see, I believe this PR can be closed out otherwise though. Again, feel free to reach out, and thanks for your contribution and help!
Author
First-time contributor

Closing this, #17 is merged

Closing this, https://kolaente.dev/vikunja/helm-chart/pulls/17 is merged
hugosxm closed this pull request 2023-12-08 11:01:51 +00:00
All checks were successful
continuous-integration/drone/pr Build is passing
Required
Details

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/helm-chart#16
No description provided.