<p>We've got checked-in YML files which contain our k8s &quot;deployment descriptors&quot; (is there a better name for these things?)</p>
<p>I'm looking at a Service descriptor like...</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: regalia-service
  namespace: sem
spec:
  selector:
    app: &quot;proxy&quot;
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
</code></pre>
<p>I look in a different repo that is doing basically the same thing and I notice the spec.selector.app value is missing the quotes. Like...</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: scimitar-service
  namespace: sem
spec:
  selector:
    app: proxy
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
</code></pre>
<p>I <em>think</em> these 2 Service descriptors are doing the same thing but how do I <em>know</em>?</p>
<p>Are the quotes significant in k8s descriptors?</p>
<p>Is this a YML thing or a k8s thing?</p>

Bob Kuhar
<p>As you probably already find out, in yaml syntax strings values rarely need quotes. If the value is quoted, it is always a string, if unquoted it is inspected to be something else but defaults for being a string.</p>
<p>For most the string you can left them unquoted and as you already find out you will have similar results. But there are some cases where the quotes are required such as <code>string</code> started with some special character <code>%#@#$</code> or contains <code>whitespace</code> or the value looks like a number but in fact should be a string (like <code>45</code>, <code>true</code> or <code>false</code></p>
<p>For more reading please have a look this blog post about <a href="http://blogs.perl.org/users/tinita/2018/03/strings-in-yaml---to-quote-or-not-to-quote.html" rel="noreferrer">quoting in yaml</a>.</p>
