<p>Does someone know how to solve this issue: <code>WARN | main | o.s.c.k.c.ConfigMapPropertySource | Can't read configMap with name: [commons] in namespace:[dev]. Ignoring</code>
I have this configuration in my <code>bootstrap-prod.yml</code>:</p>

<pre><code>spring:
  cloud:
    kubernetes:
      config:
        name: ${spring.application.name} 
        sources:
          - name: commons 
        namespace: dev
      secrets:
        name: commons-secret
      reload:
        enabled: true
</code></pre>

<p>But the application fails to start because of that error. 
 Same issue as described here: <a href="https://github.com/spring-cloud/spring-cloud-kubernetes/issues/138" rel="nofollow noreferrer">https://github.com/spring-cloud/spring-cloud-kubernetes/issues/138</a>
 I bound the namespace's ServiceAccount to the cluster <code>view</code> role.</p>

<p>What's strange is in the same namespace there are 2 applications, the first one (a spring clud gateway app) can read its configMap but the second one (a simple spring boot web app) can't.
What am I missing? 
The application is deployed on GKE.</p>

<pre><code>#:::::::::::::::::DEPLOYMENT::::::::::::::::::
apiVersion: apps/v1
kind: Deployment
metadata:
  name: appservice
  namespace: dev
spec:
  ...

</code></pre>

<p>And the ConfigMap:</p>

<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: commons
  namespace: dev
data:
  application.yml: |-
    server:
      tomcat:
          basedir: ..${file.separator}tomcat-${spring.application.name}
    spring:
      profiles:
        active: prod
      cache:
        ...
</code></pre>

<p>Thanks for your help</p>

akuma8
<p>I found the issue, I guess it is. The problem came from a malformatted yaml. 
If you take a lookk at the ConfigMap configuration we have: </p>

<pre><code>...
data:
  application.yml: |-
    server:
      tomcat:
          basedir: ..${file.separator}tomcat-${spring.application.name} # issue is here, bad indentation
    spring:
      profiles:
        active: prod
...
</code></pre>

<p>After changing that to:</p>

<pre><code>data:
  application.yml: |-
    server:
      tomcat:
        basedir: ..${file.separator}tomcat-${spring.application.name}
    spring:
      profiles:
        active: prod
</code></pre>

<p>Everything seems to work fine. It's a bit strange that the error message doesn't point out that explicitly. </p>
