<p>I have defined a deployment file:</p>

<pre><code>---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ ... }}
  labels:
    app.kubernetes.io/name: {{ ... }}
    helm.sh/chart: {{ ... }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
    ...
</code></pre>

<p>My service implements JWT validation and thus requires a public key. Can I somehow specify in the deployment file to serve a locally generated pub key file to my service?</p>

AJ.
<p>You can do it with <code>configmaps</code>. Config maps are resources that are used to deploy single files (basically). I'm currently using one for my clusters nginx configuration. </p>

<p>In your config file , write the contents of your public key to your data field and then tell your deployment to use that config file and read from it. It's very similar to mounting a volume for a single file only. You may need to update your deployed image to read from the mounted location though.</p>

<p>Search for <code>nginx in kubernetes</code> for examples of how people use configmaps to deploy their configurations (in your case public key) to the clusters.</p>

<p>For testing you can create your config map with this command <code>kubectl create configmap public-conf --from-file=./your-public-key</code>. This will create a configmap called public-conf. You can run <code>kubectl get configmap</code> to see your newly created configmap.</p>
