<p>I am trying to mount a file probes.json to an image. I started with trying to create a configmap similar to my probes.json file by manually specifying the values. </p>

<p>However, when I apply the replicator controller, I am getting an error.</p>

<p>How should I pass my JSON file to my configmap / how can I specify my values in data parameter?</p>

<p>I tried the below steps, however, I got an error. </p>

<pre><code>$ cat probes.json 
[
  {
    "id": "F",
    "url": "http://frontend.stars:80/status"
  },
  {
    "id": "B",
    "url": "http://backend.stars:6379/status"
  },
  {
    "id": "C",
    "url": "http://client.stars:9000/status"
  }
]
</code></pre>

<p>Configmap: </p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: my-vol-config
  namespace: stars
data:
  id: F
  id: B
  id: C
  F: |
   url: http://frontend.stars:80/status
  B: |
   url: http://backend.stars:6379/status
  C: |
   url: http://client.stars:9000/status
</code></pre>

<p>ReplicaContainer:</p>

<pre><code>apiVersion: v1
kind: ReplicationController
metadata:
  name: management-ui
  namespace: stars
spec:
  replicas: 1
  template:
    metadata:
      labels:
        role: management-ui
    spec:
      containers:
      - name: management-ui
        image: calico/star-collect:v0.1.0
        imagePullPolicy: Always
        ports:
        - containerPort: 9001
        volumeMounts:
          name: config-volume
        - mountPath: /star/probes.json
      volumes:
        - name: config-volume
          configMap:
             name: my-vol-config
</code></pre>

<p>Error: </p>

<pre><code>kubectl apply -f calico-namespace/management-ui.yaml
service "management-ui" unchanged
error: error converting YAML to JSON: yaml: line 20: did not find expected key
</code></pre>

<p>This part, <code>-</code> should be with <code>name:</code> on first line under <code>volumeMounts</code></p>

<pre><code>    volumeMounts:
      name: config-volume
    - mountPath: /star/probes.json
</code></pre>

<p>Like so:</p>

<pre><code>    volumeMounts:
      - name: config-volume
        mountPath: /star/probes.json
</code></pre>
