# Help ! ERROR : util/kubernetes.go:114	Error initializing Kubernetes metadata enricher: unable to build kube config due to error: invalid configuration: no configuration has been provided, try setting KUBERNETES\_MASTER environment variable

**URL:** <https://discuss.elastic.co/t/help-error-util-kubernetes-go-114-error-initializing-kubernetes-metadata-enricher-unable-to-build-kube-config-due-to-error-invalid-configuration-no-configuration-has-been-provided-try-setting-kubernetes-master-environment-variable/305584>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Tags:** docker\
**Created:** [May 25, 2022, 9:54am UTC](https://discuss.elastic.co/t/help-error-util-kubernetes-go-114-error-initializing-kubernetes-metadata-enricher-unable-to-build-kube-config-due-to-error-invalid-configuration-no-configuration-has-been-provided-try-setting-kubernetes-master-environment-variable/305584 "2022-05-25T09:54:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![k3s\_thriver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/k3s_thriver/32/106141_2.png) [@k3s\_thriver](https://discuss.elastic.co/u/k3s_thriver)\
**Post date:** [May 25, 2022, 9:54am UTC](https://discuss.elastic.co/t/help-error-util-kubernetes-go-114-error-initializing-kubernetes-metadata-enricher-unable-to-build-kube-config-due-to-error-invalid-configuration-no-configuration-has-been-provided-try-setting-kubernetes-master-environment-variable/305584/1 "2022-05-25T09:54:58Z")

</div>

I run metricbeat in docker in k3s environment and I got an error.  
"ERROR util/kubernetes.go:114 Error initializing Kubernetes metadata enricher: unable to build kube config due to error: invalid configuration: no configuration has been provided, try setting KUBERNETES\_MASTER environment variable"

my configuration:  
metrics.yml

```auto
- module: kubernetes
  metricsets:
    - pod
  period: 5s
  enabled: true
  hosts: ["https://k3s_thriver.metricbeat.com:10250"]
  bearer_token_file: /hostfs/etc/rancher/k3s/token
  ssl.verification_mode: "none"
  
  fields_under_root: true
  fields:
    environment: "Cluster"
    application: "k3s"
    server_group: "cor"
    object: "K3S Metrics"
    ci_hint: ""
    source_hint: ""
    eti_hint: ''
    kb_link: ''
    application_dashboard: ''
    node_detail_dashboard: ''

```

what is the issue? any help I will appreciate. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![framsouza](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/framsouza/32/95958_2.png) [@framsouza](https://discuss.elastic.co/u/framsouza)\
**Post date:** [May 27, 2022, 8:11am UTC](https://discuss.elastic.co/t/help-error-util-kubernetes-go-114-error-initializing-kubernetes-metadata-enricher-unable-to-build-kube-config-due-to-error-invalid-configuration-no-configuration-has-been-provided-try-setting-kubernetes-master-environment-variable/305584/2 "2022-05-27T08:11:52Z")

</div>

Hello,

It doesn't seem to be an error with the ECK, it's more like a Kubernetes issue.  
If you look closer at the error message, it says:

unable to build kube config due to error: **invalid configuration** : no configuration has been provided, **try setting KUBERNETES\_MASTER environment variable**

Did you try to specify the KUBERNETES\_MASTER environment variable? Again, this is not an ECK/Elasticsearch issue, feel free to open an issue/question on the Kubernetes discuss [https://discuss.kubernetes.io/](https://discuss.kubernetes.io/)

---

<div class="post-metadata">

**Author:** ![k3s\_thriver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/k3s_thriver/32/106141_2.png) [@k3s\_thriver](https://discuss.elastic.co/u/k3s_thriver)\
**Post date:** [June 1, 2022, 3:25am UTC](https://discuss.elastic.co/t/help-error-util-kubernetes-go-114-error-initializing-kubernetes-metadata-enricher-unable-to-build-kube-config-due-to-error-invalid-configuration-no-configuration-has-been-provided-try-setting-kubernetes-master-environment-variable/305584/3 "2022-06-01T03:25:57Z")

</div>

I used to define it. Guess what, I just didn't put a "-" and whitespaces mistake when I defined the env. No wonder I can't get it right

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 29, 2022, 3:26am UTC](https://discuss.elastic.co/t/help-error-util-kubernetes-go-114-error-initializing-kubernetes-metadata-enricher-unable-to-build-kube-config-due-to-error-invalid-configuration-no-configuration-has-been-provided-try-setting-kubernetes-master-environment-variable/305584/4 "2022-06-29T03:26:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
