<p>We have Kuberenetes 1.9.1 based Orchestration. We are using python 3.6 to write a script to connect to K8S api's.</p>

<pre><code>from kubernetes import client, config
try:
    kubeconnection = client.CoreV1Api(config.load_kube_config())
except Exception as ex:
        print("Error:",ex)
</code></pre>

<p>This statement throwing an error "The label  b '*' is not a valid A-Label".</p>

<p>We expect this script to run from one of the container. No guess if soemthing incorrect in my script of some configuration issue etc..?
O/s is Centos 7</p>

knowdotnet
<p>Your script looks correct.</p>

<p>I can suggest that something wrong with labels you use, according to documentation asterisk symbol can't be used in label name. Perhaps this is the root of your issue.   </p>

<p>You can read more about label syntax <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set" rel="nofollow noreferrer">here</a>.</p>

<p>Hope it helps.</p>
