-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Investigate if it is possible to set orchestrator fields from Cloud provider kubernetes metadata #33081
Comments
Work on this issue might require an alignment on how to organize the code better: Based on that, we might reconsider work done in elastic/cloudbeat#455, see the relevant disscussion https://github.com/elastic/cloudbeat/pull/455/files#r999273250 |
Hi, My team @elastic/cloud-security-posture has just implemented a processor that uses the GetKubernetesClusterIdentifier function. We would be happy if you can create another action item to revisit how we can organize the various implementation better. cc @ChrsMark |
@tetianakravchenko fyi that in GKE autopilot the fields are not set. |
@tetianakravchenko AKS is missing kubeconfig and it doesn't container the cluster name or the cluster url. |
hey @ChrsMark and @tetianakravchenko,
... I was thinking
A couple of use case how I see this to play out:
I don't mean this to be the final solution but it could be easily be a temporary fix until we find a better way to fix this in code. What do you guys think? |
That would work yes, and specially if we define this in integration level and not just in data_stream level. However in that case we expose sth that is a "patch" to the users and at some point we will remove this so I have mixed feelings about this and I would prefer prioritizing the backend implementation and invest time directly on this. In any case, that would be doable if @mlunadia agrees with that from product perspective. |
hello @ChrsMark and @tetianakravchenko, @gizas , kubectl debug node/aks-nodepool1-36348082-vmss000000 -it --image=mcr.microsoft.com/dotnet/runtime-deps:6.0 -- /bin/bash -c 'apt-get update; \
apt-get install -y curl jq; \
RESOURCE_NAME=$(curl -s -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" | jq .compute.resourceGroupName); \
arrIN=(${RESOURCE_NAME//_/ }); \
echo ${arrIN[2]}; Here I'm using a debug command to get a node shell to query the AKS metadata from inside the K8s cluster. The AKS metadata expose the cluster name inside a field under the jsonpath |
Nice! I guess this can be added at https://github.com/elastic/beats/blob/25786cdda70b31cb1738373265bf3a0f3dec76f6/libbeat/processors/add_cloud_metadata/provider_azure_vm.go similarly to what we do for the gke case at https://github.com/elastic/beats/blob/25786cdda70b31cb1738373265bf3a0f3dec76f6/libbeat/processors/add_cloud_metadata/provider_google_gce.go. In general we try to add the cloud provider specific implementation under the |
This is a predefined IP for Azure. I guess the result will be the same for [168.63.129.16] ? |
This approach will not work for cases when the Resource group or cluster name contains the
![]()
|
Hi, Any updates or solution here? |
Hi, any updates? |
support for AWS already included in agent version 8.9.0 and later(See release-notes-8.9.0.html Issue 35182) For AKS is still in the roadmap |
I've implemented a simple workaround, setting the cluster name as a environment variable on the pod:
|
The best way to retrieve the AKS cluster name is by using the azure sdk and for the given subscription Id list the Managed Clusters. Then we can filter by the resourceGroupName which we get from the metadata endpoint. |
Well, you could at least get the resourcegroup/cluster name from: Would like to output that value in an advanced watcher template, but I have no idea how to escape/format that forward slash in order for the message parser to recognise and read the value of that key. |
Azure
Describe the enhancement:
orchestrator.cluster.name
andorchestrator.cluster.url
will not be set when metricbeat is running on AKS.as mentioned in https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html#_dashboard_32:
this feature was introduced by #26056
Similar to how we support GKE Metadata now, we should investigate if it is possible to get k8s cluster name and k8s cluster url to set
orchestrator.cluster
fields using the Azure kubernetes metadata.AWS
EKS: initial investigation - #30229 (comment)
Google cloud
we already provide setting
orchestrator.cluster.*
from GKE metadataThe text was updated successfully, but these errors were encountered: