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

Disable kubeadm for filebeat (both filbeat.input and filbeat.autodiscover) #40301

Merged
merged 36 commits into from
Sep 18, 2024

Conversation

gizas
Copy link
Contributor

@gizas gizas commented Jul 19, 2024

  • Enhancement

NOTE: Dont merge until elastic/elastic-agent-autodiscover#98 is also merged

Proposed commit message

WHAT: Provide a configuration option to disable /api/v1/namespaces/kube-system/configmaps/kubeadm-config for filebeat autodiscovery and add_kubernetes_metadata processor. In more details user will disable the api requests by using configuration use_kubeadm: false

In this PR we added the option in order to support both filbeat.input and filebeat.autodiscover blocks of configuration.

WHY: https://github.com/elastic/enhancements/issues/21172

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

  1. Follow same steps as described [Kubernetes - Metricbeat] Providing config option to disable Kubeadm config api requests #40086
  2. The filebeat configuration should contain only autodiscover config: https://github.com/elastic/beats/blob/main/deploy/kubernetes/filebeat-kubernetes.yaml#L133C1-L150C42

Related issues

Screenshots

Screenshot 2024-09-10 at 11 27 21 AM

LOG processing continues successfully:

Screenshot 2024-09-10 at 11 51 22 AM

For the filebeat.input block:

Screenshot 2024-09-10 at 2 17 25 PM

LOG processing continues successfully:
Screenshot 2024-09-10 at 2 30 40 PM

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 19, 2024
@gizas gizas added the Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team label Jul 19, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 19, 2024
@mergify mergify bot assigned gizas Jul 19, 2024
Copy link
Contributor

mergify bot commented Jul 19, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @gizas? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

Copy link

cla-checker-service bot commented Sep 10, 2024

💚 CLA has been signed

@gizas gizas marked this pull request as ready for review September 10, 2024 09:18
@gizas gizas requested review from a team as code owners September 10, 2024 09:18
@@ -97,6 +97,15 @@ func NewPodEventer(uuid uuid.UUID, cfg *conf.C, client k8s.Interface, publish fu
}

metaConf := config.AddResourceMetadata
// We initialise the use_kubeadm variable based on modules KubeAdm base configuration
err = metaConf.Namespace.SetBool("use_kubeadm", -1, config.KubeAdm)
if err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added due to go-lint errors

@gizas gizas changed the title Disable kubeadm for filebeat autodiscover Disable kubeadm for filebeat (both filbeat.input and filbeat.autodiscover) Sep 10, 2024
gizas and others added 3 commits September 10, 2024 16:23
Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
…_metadata.asciidoc

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
Copy link
Contributor

mergify bot commented Sep 11, 2024

backport-8.x has been added to help with the transition to the new branch 8.x.

@mergify mergify bot added the backport-8.x Automated backport to the 8.x branch with mergify label Sep 11, 2024
@v1v v1v removed the backport-v8.x label Sep 11, 2024
@gizas gizas enabled auto-merge (squash) September 18, 2024 13:53
@gizas gizas merged commit 89cd840 into main Sep 18, 2024
128 of 131 checks passed
@gizas gizas deleted the kubeadm_filebeat branch September 18, 2024 15:18
mergify bot pushed a commit that referenced this pull request Sep 18, 2024
…over) (#40301)

* disable kubeadm for filebeat autodiscover

* Update filebeat/_meta/test/docs/01_playground/filebeat.yaml

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>

* Update libbeat/processors/add_kubernetes_metadata/docs/add_kubernetes_metadata.asciidoc

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>

* Update dev-tools/kubernetes/filebeat/Dockerfile.debug

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>

* fixing docs and adding mericbeat references

* fixing docs and adding mericbeat references

* Update filebeat/_meta/config/filebeat.autodiscover.reference.yml.tmpl

Co-authored-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>

---------

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
Co-authored-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
(cherry picked from commit 89cd840)

# Conflicts:
#	metricbeat/module/kubernetes/util/kubernetes.go
gizas added a commit that referenced this pull request Sep 19, 2024
…ut and filbeat.autodiscover) (#40889)

* Disable kubeadm for filebeat (both filbeat.input and filbeat.autodiscover) (#40301)

* disable kubeadm for filebeat autodiscover

* Update filebeat/_meta/test/docs/01_playground/filebeat.yaml

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>

* Update libbeat/processors/add_kubernetes_metadata/docs/add_kubernetes_metadata.asciidoc

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>

* Update dev-tools/kubernetes/filebeat/Dockerfile.debug

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>

* fixing docs and adding mericbeat references

* fixing docs and adding mericbeat references

* Update filebeat/_meta/config/filebeat.autodiscover.reference.yml.tmpl

Co-authored-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>

---------

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
Co-authored-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
(cherry picked from commit 89cd840)

# Conflicts:
#	metricbeat/module/kubernetes/util/kubernetes.go

* fixing worng backport comments

---------

Co-authored-by: Andrew Gizas <andreas.gkizas@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants