Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Beats] Custom configmap for Kubernetes Orchestrator Name #30229

Closed
mholttech opened this issue Feb 5, 2022 · 7 comments · Fixed by #30518
Closed

[Beats] Custom configmap for Kubernetes Orchestrator Name #30229

mholttech opened this issue Feb 5, 2022 · 7 comments · Fixed by #30518
Assignees
Labels
Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team

Comments

@mholttech
Copy link

Describe the enhancement:
#26056 introduced 3 methods to set orchestrator.cluster.name & orchestrator.cluster.url

  1. kube_config file
  2. kubeadm-config configmap
  3. GKE Metadata

I would like to see a separate configmap for deployments that aren't managed by kubeadm or GKE. While one can create a simple kubeadm-config configmap, this may cause other services that key off of the existence of this configmap to not work as expected.

Describe a specific use case for the enhancement or feature:
I have an EKS Cluster with Managed Node Groups and utilize Fleet containers in Kubernetes for monitoring. I was able to get the cluster name to populate by creating the kubeadm-config config map, however when I went to deploy Calico it saw this configmap and it was missing required information, causing Calico to not deploy successfully.

This is the configmap I deployed:

apiVersion: v1
kind: ConfigMap
metadata:
  name: kubeadm-config
  namespace: kube-system
data:
  ClusterConfiguration: |
    clusterName: cluster-1
    controlPlaneEndpoint: https://abcd1234.gr7.us-west-2.eks.amazonaws.com
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 5, 2022
@mholttech
Copy link
Author

@bvader Can you please make sure this gets routed to the appropriate team? Thanks!

@tetianakravchenko tetianakravchenko added the Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team label Feb 9, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 9, 2022
@tetianakravchenko tetianakravchenko self-assigned this Feb 15, 2022
@tetianakravchenko
Copy link
Contributor

tetianakravchenko commented Feb 21, 2022

Hi @mholttech!

Orchestrator fields are not supposed to be defined "manually" by custom configMap. The proper way here would be to use something similar to the GKE Metadata, but for EKS. I checked it quickly and seems there is nothing similar in EKS now - aws/containers-roadmap#686.

Meanwhile I would suggest to use rather add_fields processor and add orchestrator.cluster fields explicitly, instead of using kubeadm-config to avoid unexpected effects:

processors:
  - add_fields:
      target: orchestrator.cluster
      fields:
        name: cluster-1
        url: https://abcd1234.gr7.us-west-2.eks.amazonaws.com

As EKS metadata is missing, I'm going to adjust documentation with add_fields processor and close this issue.

@ottramst
Copy link

ottramst commented Sep 17, 2022

Hi!

Just clarification on this topic - so this means that when running Elastic Agent in EKS, there is currently no way of adding the orchestrator.cluster.name in the Agent configuration?
Seems a bit much to have an ingest pipeline just for adding a single field.

@tetianakravchenko
Copy link
Contributor

Hi @ottramst

you don't have to use ingest pipeline, you can add add_fields processor in the agent configuration, example - https://github.com/elastic/elastic-agent/blob/main/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml#L291-L295

@vnirocha
Copy link

Hey @tetianakravchenko

I'm running fleet managed elastic agents and there is no way to use processors on kubernetes integration. It seems like the team is already working on this feature (elastic/integrations#4363) but, until this moment, there is no way of doing, unless using the standalone implementation of the elastic agent.

@tetianakravchenko
Copy link
Contributor

Hi @vnirocha

I've just asked to promote the change you linked - elastic/integrations#4363 (comment). I believe version 1.26.0 should be available in next few days.
Please note that this change only applies to the elastic stack versions >= 8.4 https://github.com/elastic/integrations/pull/4363/files#diff-d20d8086b58468701d8a944fc3ead31ddcc098054affdcc335b69464b4c16c54R13

@radhane
Copy link

radhane commented Nov 2, 2023

Instead of adding processors which do not work in my case for all metrics in elastic 7.x with managed kubernetes, I have used a separate namespace with cluster name instead of adding all clusters in the default namespace. And used data_stream.namespace as cluster name filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants