<p>I have a question about kubectl command with flag --selector. In help menu it says,</p>

<pre><code>-l, --selector="": Selector (label query) to filter on
</code></pre>

<p>how ever it does't work as i expect, 
for example, i want to get RC who have selector like</p>

<pre><code>    "spec": {
    "replicas": 2,
    "selector": {
        "app": "tas-core"
    },
</code></pre>

<p>when i give command</p>

<pre><code>kubectl get pod --selector="app:tas-core"
</code></pre>

<p>system report: the provided selector "app:tas-core" is not valid: unable to parse requirement: label key: invalid value 'app:tas-core', Details: must match regex [a-z0-9?(.a-z0-9?)* / ] a-z0-9?</p>

<p>after i check the regexp </p>

<pre><code>[[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* / ] [a-z0-9]([-a-z0-9]*[a-z0-9])?
</code></pre>

<p>i still can't find any string which can pass the regexp!
i gave,</p>

<pre><code>kubectl get rc -l app/tas-core
</code></pre>

<p>nothing has been returned.
How could i use it?</p>

<p>I have also another question, how to filter all pods which with label like</p>

<pre><code>"labels": {
  "app": "tas-core"
}
</code></pre>

<p>?  </p>

<p>Try</p>
<pre><code>kubectl get pods --selector=app=tas-core
</code></pre>
<p>as in <a href="http://kubernetes.io/docs/user-guide/kubectl-cheatsheet/" rel="noreferrer">http://kubernetes.io/docs/user-guide/kubectl-cheatsheet/</a></p>
