Skip to content

kubernetes.config.config_exception.ConfigException: Invalid kube-config file. No configuration found.

When running docker-compose up I get the following error from the smo container:

smo       |   File "/usr/local/lib/python3.11/site-packages/kubernetes/config/kube_config.py", line 772, in _get_kube_config_loader
smo       |     raise ConfigException(
smo       | kubernetes.config.config_exception.ConfigException: Invalid kube-config file. No configuration found.

I suspect this is related to this remark in the README:

Regarding the Karmada config, the docker compose YAML mounts the ~/.kube directory inside the container meaning that the SMO expects the karmada kubeconfig file to be inside that directory. Afterwards, the user can specify the name of the config file in the KARMADA_KUBECONFIG environment variable of the config/flask.env file.

Can you be more explicit (or give pointers) on how to properly set the "kube-config"?