Connecting to Kubernetes error " The label b '*' is not a valid label

10/8/2018

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

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

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

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

-- knowdotnet
kubernetes

1 Answer

10/8/2018

Your script looks correct.

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.

You can read more about label syntax here.

Hope it helps.

-- getslaf
Source: StackOverflow