<p>ASP.NET Core SPA with external config in wwwroot/config/config.json</p>

<p>Contents of config.json:</p>

<pre><code>{
  "termsAndConditionsLink": "https://some-dev-url.with/legal/terms/"
}
</code></pre>

<p>When the file is <strong>not being overwritten by a ConfigMap</strong>, it works fine and I am able to get the full content of file.</p>

<pre><code>curl https://dev-app.com/config/config.json
{
  "termsAndConditionsLink": "https://some-dev-url.with/legal/terms/"
}
</code></pre>

<p>When ConfigMap data is mounted to this path with Volume, it is not returned entirely.</p>

<pre><code>curl https://dev-app.com/config/config.json
{
  "termsAndCon
</code></pre>

<p>The file is present in pod:</p>

<pre><code>pwd
/app/wwwroot/config

ls -la
total 12
drwxrwxrwx 3 root root 4096 Nov 20 08:48 .
drwxr-xr-x 6 root root 4096 Nov 20 08:46 ..
drwxr-xr-x 2 root root 4096 Nov 20 08:48 ..2018_11_20_08_48_02.390652870
lrwxrwxrwx 1 root root   31 Nov 20 08:48 ..data -&gt;         ..2018_11_20_08_48_02.390652870
lrwxrwxrwx 1 root root   18 Nov 20 08:48 config.json -&gt; ..data/config.json

cat config.json
{
  "termsAndConditionsLink": "https://some-dev-url.with/legal/terms/"
}
</code></pre>

<p><strong>ConfigMap.yaml</strong></p>

<pre><code>kind: ConfigMap
apiVersion: v1
metadata:
  name: my-config
data:
  config.json: |-
    {
      "termsAndConditionsLink": "https://some-dev-url.with/legal/terms/"
    }
</code></pre>

<p><strong>Deployment.yaml</strong></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: my-app
  labels:
    ...
spec:
  template:
    metadata:
      labels:
        ...
    spec:
      containers:
        ...
          volumeMounts:
            - name: my-volume
              mountPath: /app/wwwroot/config
      volumes:
        - name: my-volume
          configMap:
            name: my-config
</code></pre>

edbighead
<p>Do you mean that any other files in the <code>/app/wwwroot/config</code> directory are gone when mounting a volume at that location from the ConfigMap?</p>

<p>Have you tried <a href="https://kubernetes.io/docs/concepts/storage/volumes/#projected" rel="nofollow noreferrer">projected</a> volume:</p>

<pre><code>volumes:
  - name: my-volume
    projected:
      sources:
      - configMap:
          name: my-config
</code></pre>

<p><strong>EDIT:</strong> For those that may come across such problem and don't read through the messages below the posts - after exchanging messages with @edbighead, another suggestion was to use <code>subPath</code> in the Deployment to leave the config directory writeable as ConfigMap volume mounts are read-only:</p>

<pre><code>mountPath: /app/wwwroot/config/config.json 
subPath: config.json
</code></pre>

<p>That apparently <em>solved the problem</em>.</p>
