<p>I am deploying authelia with their helm chart <a href="https://artifacthub.io/packages/helm/truecharts/authelia" rel="nofollow noreferrer">https://artifacthub.io/packages/helm/truecharts/authelia</a>.</p>
<p>I need to mount a ConfigMap to a specific file in the authelia container, however this is not available as a templated value in the <code>values.yaml</code>.</p>
<p>I'm struggling to understand what is the recommended way of doing something like this... this could generalise to &quot;how can I customise an helm deployment beyond what is allowed through the <code>values.yaml</code>?&quot;</p>
<p>I can only think of getting all the yaml from the chart, make the change I need and deploy like that... It can't be the best way of doing this</p>
<h4>solution</h4>
<h5>users_database.yml</h5>
<pre class="lang-yaml prettyprint-override"><code>###############################################################
#                         Users Database                      #
###############################################################

# This file can be used if you do not have an LDAP set up.

# List of users
users:
  admin:
    displayname: &quot;admin&quot;
    password: &quot;redacted&quot;
    email: admin@redacted
    groups:
      - admins
      - dev
</code></pre>
<h5>patches/authelia_users_database.yaml</h5>
<pre class="lang-yaml prettyprint-override"><code>spec:
  template:
    spec:
      containers:
      - name: authelia
        volumeMounts:
        - name: authelia-users-database
          mountPath: /etc/config
      volumes:
      - name: authelia-users-database
        configMap:
          name: authelia-users-database
</code></pre>
<h6>values.yaml</h6>
<pre class="lang-yaml prettyprint-override"><code>authentication_backend:
  file:
    enabled: true
      path: /etc/config/users_database.yml
</code></pre>
<h6></h6>
<pre><code>$ helm repo add authelia https://charts.authelia.com
$ helm repo update
$ helm upgrade --install authelia authelia/authelia --values values/authelia.yaml --version 0.8.34
$ kubectl create configmap authelia-users-database --from-file=users_database.yml --dry-run -o yaml | kubectl apply -f -
$ kubectl patch daemonset authelia --patch-file patches/authelia_users_database.yaml
</code></pre>

<p>I would say you could try to use <code>kubectl patch</code> to mount the ConfigMap to the authelia container afterwards. <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/" rel="nofollow noreferrer">Look here</a> for more information.</p>
<p>So create a <code>.yml</code> file with Deployment, Replicaset or Statefulset and add the ConfigMap configuration (just check which Kubernetes object suits best for you according to the Helm deployment). After deploying the application using the Helm chart; run the command <code>kubectl patch -f your-deployment-file.yml</code>.</p>
