22

I created a helm chart which has secrets.yaml as:

apiVersion: v1
kind: Secret
type: Opaque
metadata: 
 name: appdbpassword
stringData:
  password: password@1

My pod is:

apiVersion: v1
kind: Pod
metadata:
  name: expense-pod-sample-1
spec:
  containers:
    - name: expense-container-sample-1
      image: exm:1
      command: [ "/bin/sh", "-c", "--" ]
      args: [ "while true; do sleep 30; done;" ]
      envFrom:
      - secretRef:
              name: appdbpassword

Whenever I run the kubectl get secrets command, I get the following secrets:

name                                     Type                 Data    Age
appdbpassword                            Opaque               1      41m
sh.helm.release.v1.myhelm-1572515128.v1  helm.sh/release.v1   1      41m

Why am I getting that extra secret? Am I missing something here?

2
  • Which helm version are you using? Nov 4, 2019 at 12:18
  • @EduardoBaitello I am using 3.0.0 Nov 4, 2019 at 12:30

3 Answers 3

21
+50

Helm v2 used ConfigMaps by default to store release information. The ConfigMaps were created in the same namespace of the Tiller (generally kube-system).

In Helm v3 the Tiller was removed, and the information about each release version had to go somewhere:

In Helm 3, release information about a particular release is now stored in the same namespace as the release itself.

Furthermore, Helm v3 uses Secrets as default storage driver instead of ConfigMaps (i.e., it's expected that you see these helm secrets for each namespace that has a release version on it).

4
  • 2
    I would expect that when I use upgrade --install that I see only 1 secret and not 20 Jan 30, 2020 at 19:51
  • @MartinKosicky Helm 2 always created a new configMap for every release revision. The difference is only that Helm 3 is now using Secrets...If you have done a hundred upgrades, you will have a hundred revisions, and 100 Secrets consequently...You can see some examples here. Worth mentioning too that every time an install, upgrade, or rollback happens, the revision number is incremented by 1. Jan 30, 2020 at 20:22
  • Yes I agree it shouldn't keep the old secrets (I don;t need them anyway) Jan 31, 2020 at 7:59
  • 1
    helm should create a new namespace and put these annoying secrets there
    – BMW
    Jul 30, 2020 at 9:00
18

There is an option to helm upgrade to limit the number of old deployment secrets that are kept:

--history-max int      limit the maximum number of revisions saved per release.
                       Use 0 for no limit (default 10)
1
  • Is this mean that: We can only rollback 10 versions of a release, right?
    – Tho Quach
    Nov 26, 2021 at 9:26
0

This is because there is no Tiller anymore in Helm 3. Hence, release information is now stored in the same namespace as the release itself as a secret.

Which Helm uses as the default storage driver.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.