<p>I am new to Kubernetes (aren't we all?).</p>

<p>Can a <a href="https://kubernetes.io/docs/concepts/configuration/secret/" rel="nofollow noreferrer">Secret</a>, consisting of course of keys and values, be represented as a <em>single</em> file when used by a container?</p>

<p>I understand that normally a Secret, when <a href="https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod" rel="nofollow noreferrer">mounted by a container</a>, is essentially a directory.  I was wondering if there was some syntactic sugar or other construct that I'm missing that could represent it as, say, a Java <code>Properties</code> file, whose keys would be the secret's keys, and whose values would be the secret's values.</p>

<p>This is not possible currently. The only way to get around this is to have a key value pair where the value is a base64 encoded JSON object.</p>

<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: mysecret
type: Opaque
data:
  conf.json: eyJrZXkiOiAidmFsdWUiLCAia2V5MiI6ICJ2YWx1ZTIifQ==
</code></pre>

<p>The <code>conf.json</code> value is just:</p>

<pre><code>echo -n '{"key": "value", "key2": "value2"}' | base64
</code></pre>
