<p>currently we're adding features to 3rd party helm charts we're deploying (for example - in prometheus we're adding an authentication support as we use nginx ingress controller).</p>

<p>Obviously, this will cause us headaches when we want to upgrade those helm charts, we will need to perform "diffs" with our changes.</p>

<p>What's the recommended way to add functionality to existing 3rd party helm charts? Should i use umbrella charts and use prometheus as a dependency? then import value from the chart? (<a href="https://github.com/helm/helm/blob/master/docs/charts.md#importing-child-values-via-requirementsyaml" rel="nofollow noreferrer">https://github.com/helm/helm/blob/master/docs/charts.md#importing-child-values-via-requirementsyaml</a>)</p>

<p>Or any other recommended way?</p>

<p>-- EDIT --</p>

<p>Example - as you can see, i've added 3 nginx.ingress.* annotations to support basic auth on <strong>prometheus</strong> ingress resource - of course if i'll upgrade, i'll need to manually add them again, which will cause problems</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
{{- if .Values.prometheus.ingress.annotations }}
  annotations:
{{ toYaml .Values.prometheus.ingress.annotations | indent 4 }}
{{- end }}
{{- if .Values.alertmanager.ingress.nginxBasicAuthEnabled }}
    nginx.ingress.kubernetes.io/auth-realm: "Authentication Required - ok"
    nginx.ingress.kubernetes.io/auth-secret: {{ template "prometheus-operator.fullname" . }}-prometheus-basicauth
    nginx.ingress.kubernetes.io/auth-type: "basic"
{{- end }}
  name: {{ $serviceName }}
  labels:
    app: {{ template "prometheus-operator.name" . }}-prometheus
{{ include "prometheus-operator.labels" . | indent 4 }}
{{- if .Values.prometheus.ingress.labels }}
{{ toYaml .Values.prometheus.ingress.labels | indent 4 }}
{{- end }}
spec:
  rules:
    {{- range $host := .Values.prometheus.ingress.hosts }}
    - host: {{ . }}
      http:
        paths:
          - path: "{{ $routePrefix }}"
            backend:
              serviceName: {{ $serviceName }}
              servicePort: 9090
    {{- end }}
{{- if .Values.prometheus.ingress.tls }}
  tls:
{{ toYaml .Values.prometheus.ingress.tls | indent 4 }}
{{- end }}
{{- end }}
</code></pre>

ArielB
<p>I think that might answer your <a href="https://stackoverflow.com/a/52554219/11977760">question</a>.</p>

<ul>
<li><a href="https://github.com/helm/helm/blob/master/docs/chart_template_guide/subcharts_and_globals.md" rel="nofollow noreferrer" title="Subcharts and Globals">Subcharts and Globals</a></li>
<li><a href="https://github.com/helm/helm/blob/master/docs/chart_best_practices/requirements.md" rel="nofollow noreferrer">Requirements</a></li>
<li><a href="https://github.com/helm/helm/blob/master/docs/helm/helm_dependency.md" rel="nofollow noreferrer">Helm Dependencies</a></li>
</ul>

<p>This led me to find the <a href="https://github.com/helm/helm/blob/master/docs/chart_template_guide/subcharts_and_globals.md#overriding-values-from-a-parent-chart" rel="nofollow noreferrer">specific part I was looking for</a>, where the parent chart can override sub-charts by specifying the chart name as a key in the parent <code>values.yaml</code>.</p>

<p>In the application chart's <code>requirements.yaml</code>:</p>

<pre><code>dependencies:
- name: jenkins
  # Can be found with "helm search jenkins"
  version: '0.18.0'
  # This is the binaries repository, as documented in the GitHub repo
  repository: 'https://kubernetes-charts.storage.googleapis.com/'
</code></pre>

<p>Run:</p>

<pre><code>helm dependency update
</code></pre>

<p>In the application chart's <code>values.yaml</code>:</p>

<pre><code># ...other normal config values

# Name matches the sub-chart
jenkins: 
  # This will be override "someJenkinsConfig" in the "jenkins" sub-chart
  someJenkinsConfig: value 
</code></pre>
