Keep elastic cloud credentials separately & securly

I am using metricbeat to monitor the K8s cluster. I was using the following config,

https://raw.githubusercontent.com/elastic/beats/7.4/deploy/kubernetes/metricbeat-kubernetes.yaml

Here elastic cloud creds are referred like cloud.id: {ELASTIC_CLOUD_ID}, I am struggling to feed the credentials. Where should I define the {ELASTIC_CLOUD_ID}? I tried setting as an environment variable but the value is not replaced when execute the
kubectl apply -f metricbeat-kubernetes-7.4.yaml

Note: Hardcoding the cloud.id in the metricbeat-kubernetes-7.4.yaml is an option (it works fine with that) but I cannot commit the config file to Github with the credentials.

What is the best way to handle that?
I don't think config map with variable an option here.

Found the answer, posting for others benefit,
The solution is very well documented on https://github.com/elastic/examples/blob/master/beats-k8s-send-anywhere/README-Cloud.md

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