Answers: <p>Finnaly, I found the solution, thanks to @simbo1905.</p>
  
  <p>All that I need to fix that problem:
  values.yaml Child Chart 1 (or two)</p>
  
  <pre><code>postgresql:
    nameOverride: chart-1-postgres
  </code></pre>
  
  <p>In the Child Chart 2 <code>nameOverride</code> became to chart-2-postgres.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-04-02T03:19:17.777Z
Answers: 2019-04-02T03:19:17.777Z
Answers: Alexey Vinogradov
Body: <p>For example, I have this charts structure:</p>
  
  <pre><code>├── parentChart
  │   ├── charts
  │   │   ├── childChart1
  │   │   │   ├── charts
  │   │   │   │   └── postgresql-3.11.6.tgz
  │   │   │   ├── Chart.yaml
  │   │   │   ├── requirements.lock
  │   │   │   ├── requirements.yaml
  │   │   │   ├── templates
  ...
  │   │   │   └── values.yaml
  │   │   ├── childChart2
  │   │   │   ├── charts
  │   │   │   │   └── postgresql-3.11.6.tgz
  │   │   │   ├── Chart.yaml
  │   │   │   ├── requirements.lock
  │   │   │   ├── requirements.yaml
  │   │   │   ├── templates
  ...
  │   │   │   └── values.yaml
  │   └── Chart.yaml
  ...
  </code></pre>
  
  <p>In the childChart1 and childChart2 I have this dependency:
  Child1:</p>
  
  <pre><code>dependencies:
    - name: postgresql
      version: 3.11.6
      repository: alias:stable
      alias: child1-postgres
  ...
  </code></pre>
  
  <p>Child2:</p>
  
  <pre><code>dependencies:
    - name: postgresql
      version: 3.11.6
      repository: alias:stable
      alias: child2-postgres
  ...
  </code></pre>
  
  <p>First problem: I expect that after deploy parent chart I will have 4 deployment:</p>
  
  <ol>
  <li>childChart1</li>
  <li>childChart1 Postgresql</li>
  <li>childChart2</li>
  <li>childChart2 Postgresql</li>
  </ol>
  
  <p>Am I right?</p>
  
  <p>If I don't do anything wrong with a first problem, why I see this message when I trying to deploy this charts:</p>
  
  <pre><code>$ helm install $opts --name $NAME --namespace $NAME $package --wait --timeout 9999
  Error: release test failed: secrets "test-postgresql" already exists
  </code></pre>
  
  <p>P.S. I have this helm version:</p>
  
  <pre><code>$ helm version
  Client: &amp;version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}
  Server: &amp;version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}
  </code></pre>
  
Comments: CC BY-SA 4.0
Comments: 2019-03-31T18:15:39.967Z
Comments: the error is probably saying exactly what is wrong, the Postgres chart creates a secrets “${x}-secret” to store a generated password. you have identical releases and they are creating clashing secrets. read the docs for the chart to see how to give it a unique name for the release and it is likely to use that name as a prefix to the resources. worst case read the actual chart templates it’s a very readable format.
Comments: simbo1905
Tags: <kubernetes><helm><openshift>
Title: How to use same Helm dependency in many charts?
UserDisplayName: Alexey Vinogradov
ThreadText: # How to use same Helm dependency in many charts?
  
  (Asked by: username_0 on 2019-03-29)
  
  For example, I have this charts structure:
  
  ```
  ├── parentChart
  │   ├── charts
  │   │   ├── childChart1
  │   │   │   ├── charts
  │   │   │   │   └── postgresql-3.11.6.tgz
  │   │   │   ├── Chart.yaml
  │   │   │   ├── requirements.lock
  │   │   │   ├── requirements.yaml
  │   │   │   ├── templates
  ...
  │   │   │   └── values.yaml
  │   │   ├── childChart2
  │   │   │   ├── charts
  │   │   │   │   └── postgresql-3.11.6.tgz
  │   │   │   ├── Chart.yaml
  │   │   │   ├── requirements.lock
  │   │   │   ├── requirements.yaml
  │   │   │   ├── templates
  ...
  │   │   │   └── values.yaml
  │   └── Chart.yaml
  ...
  
  ```
  
  In the childChart1 and childChart2 I have this dependency:
  Child1:
  
  ```
  dependencies:
    - name: postgresql
      version: 3.11.6
      repository: alias:stable
      alias: child1-postgres
  ...
  
  ```
  
  Child2:
  
  ```
  dependencies:
    - name: postgresql
      version: 3.11.6
      repository: alias:stable
      alias: child2-postgres
  ...
  
  ```
  
  First problem: I expect that after deploy parent chart I will have 4 deployment:
  
  1. childChart1
  2. childChart1 Postgresql
  3. childChart2
  4. childChart2 Postgresql
  
  Am I right?
  
  If I don't do anything wrong with a first problem, why I see this message when I trying to deploy this charts:
  
  ```
  $ helm install $opts --name $NAME --namespace $NAME $package --wait --timeout 9999
  Error: release test failed: secrets "test-postgresql" already exists
  
  ```
  
  P.S. I have this helm version:
  
  ```
  $ helm version
  Client: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}
  Server: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}
  
  ```
  
  **Tags:** kubernetes, helm, openshift
  
  > **Comments:**
  > **username_1**: the error is probably saying exactly what is wrong, the Postgres chart creates a secrets “${x}-secret” to store a generated password. you have identical releases and they are creating clashing secrets. read the docs for the chart to see how to give it a unique name for the release and it is likely to use that name as a prefix to the resources. worst case read the actual chart templates it’s a very readable format.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-04-02. Score: 2 | Accepted answer
  
  Finnaly, I found the solution, thanks to @username_1.
  
  All that I need to fix that problem:
  values.yaml Child Chart 1 (or two)
  
  ```
  postgresql:
    nameOverride: chart-1-postgres
  
  ```
  
  In the Child Chart 2 `nameOverride` became to chart-2-postgres.
  
  
  ---
  
  