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

fix: helm chart secret persistence #5

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Conversation

ericchu94
Copy link

The client-info secret is deleted by helm when a chart is upgraded. This is especially cumbersome when using declarative tools like helmsmans:

$ helmsman -f helmsman2.yaml --show-diff  --show-secrets

 _          _
| |        | |
| |__   ___| |_ __ ___  ___ _ __ ___   __ _ _ __
| '_ \ / _ \ | '_ ` _ \/ __| '_ ` _ \ / _` | '_ \
| | | |  __/ | | | | | \__ \ | | | | | (_| | | | |
|_| |_|\___|_|_| |_| |_|___/_| |_| |_|\__,_|_| |_| version: v3.17.0
A Helm-Charts-as-Code tool.

2024-05-29 22:35:31 INFO: validating environment variables in helmsman2.yaml
2024-05-29 22:35:31 INFO: Parsed [[ helmsman2.yaml ]] successfully and found [ 1 ] apps
2024-05-29 22:35:31 INFO: Validating desired state definition
2024-05-29 22:35:31 INFO: Setting up kubectl
2024-05-29 22:35:31 INFO: Setting up helm
2024-05-29 22:35:32 INFO: Getting chart information
2024-05-29 22:35:33 INFO: Charts validated.
2024-05-29 22:35:33 INFO: Preparing plan
2024-05-29 22:35:33 INFO: Acquiring current Helm state from cluster
synology-csi, client-info-secret, Secret (v1) has been removed:
- # Source: synology-csi/templates/client-info.yaml
- apiVersion: v1
- kind: Secret
- metadata:
-   labels:
-     app.kubernetes.io/instance: synology-csi
-     app.kubernetes.io/managed-by: Helm
-     app.kubernetes.io/name: synology-csi
-     app.kubernetes.io/version: v1.1.2
-     helm.sh/chart: synology-csi-0.9.3
-     helm.sh/template: client-info.yaml
-   name: client-info-secret
- data:
-   client-info.yml: '-------- # (110 bytes)'
2024-05-29 22:35:34 INFO: Checking if any Helmsman managed releases are no longer tracked by your desired state ...
2024-05-29 22:35:34 INFO: No untracked releases found
2024-05-29 22:35:34 NOTICE: -------- PLAN starts here --------------
2024-05-29 22:35:34 NOTICE: Release [ synology-csi ] will be updated -- priority: 0
2024-05-29 22:35:34 NOTICE: -------- PLAN ends here --------------

I believe the original intention is for helm to create the secret on install, using the IsInstall flag, and ignore it afterwards. Unfortunately, that isn't how helm works, and if the resource is not rendered on upgrade, it will actually be removed.

@Bickio
Copy link

Bickio commented Jun 2, 2024

This issue also occurs with helmfile, and is a real pain to work around. Would love to see this merged.

@ericchu94 This comment also needs an update: https://github.com/zebernst/synology-csi-talos/blob/main/charts/synology-csi/values.yaml#L15

@ericchu94
Copy link
Author

@ericchu94 This comment also needs an update: https://github.com/zebernst/synology-csi-talos/blob/main/charts/synology-csi/values.yaml#L15

Updated

@zebernst
Copy link
Owner

Good catch! This wasn't an issue with my setup (configured things differently) but TY for the bugfix!

@zebernst zebernst merged commit cd2ada0 into zebernst:main Aug 30, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants