Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Migrate kubernetes module#70

Merged
exekias merged 23 commits intoelastic:masterfrom
ChrsMark:migrate_k8s
Jun 30, 2020
Merged

Migrate kubernetes module#70
exekias merged 23 commits intoelastic:masterfrom
ChrsMark:migrate_k8s

Conversation

@ChrsMark
Copy link
Member

@ChrsMarkChrsMark commentedJun 11, 2020
edited
Loading

ImplementingKubernetes package migration
Important Notes:

  1. container,system,node,pod,volume metricsets require access to the Kubelet API. Usually these are enabled when Metricbeat is deployed as Daemonset on k8s nodes.
  2. state_* metricsets require the deploymentkube-state-metrics on the k8s cluster in order to retrieve metrics from it.
  3. apiserver,scheduler,proxy andcontrollermanager require access to each component of the k8s cluster accordingly.

Wondering how all these would be possible in combination withagent. Do we need to define how agent will run in k8s (deployment, daemonset) in order to make it work?@exekias do you have anything in mind about this?

Docs:https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-kubernetes.html

Migration Steps:

  • docker-compose -f snapshot.yml -f local.yml up --force-recreate
  • PACKAGES=kubernetes mage ImportBeats
  • icon check
  • Review titles and descriptions in manifest files
  • adddocs/README.md
  • screenshots check
  • check spelling
  • Review fields file and exported fields in docs
  • Metricbeat: add missing configuration options
  • Define all variable properties
  • use stream.dataset field instead of event.dataset

Screenshots

Screenshot 2020-06-26 at 13 01 04
Screenshot 2020-06-26 at 12 59 05
Screenshot 2020-06-26 at 12 57 41
Screenshot 2020-06-26 at 12 58 45

Manual Testing

  1. Using the testing env introduced atAdd k8s manifests to deploy stack along with Agent #89 we spin up the Stack and Agent on a k8s cluster.
  2. For the 2 different configs (seeAdd k8s manifests to deploy stack along with Agent #89) enable the Package once for node scope Agent and once for cluster scope.
  3. Verify that all datasets are shipping metrics and Dashboards are being populated.

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@elasticmachine
Copy link

elasticmachine commentedJun 11, 2020
edited
Loading

💚 Build Succeeded

Pipeline ViewTest ViewChangesArtifactspreview

Expand to view the summary

Build stats

  • Build Cause:[Branch indexing]

  • Start Time: 2020-06-29T17:25:26.637+0000

  • Duration: 4 min 49 sec

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@mtojekmtojek marked this pull request as draftJune 12, 2020 06:51
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark
Copy link
MemberAuthor

@exekias@mtojek this one seems to be completed in terms of "package migration". Would love your feedback here.

Manual testing is also possible already (usinghttps://github.com/elastic/integrations-dev/issues/58) in order to verify that data are being collected and Dashboards work ok.

We still need to verify what will happen with Agent's side regarding docs and manifests around the Deployment strategies on k8s.

@mtojek
Copy link
Contributor

I think you can convert it to ordinary pull-request. Thanks for the contribution.

@ChrsMarkChrsMark marked this pull request as ready for reviewJune 25, 2020 07:22
@mtojekmtojek changed the title[WIP] Migrate kubernetes moduleMigrate kubernetes moduleJun 25, 2020
Copy link

@exekiasexekias left a comment

Choose a reason for hiding this comment

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

Didn't test it, but it looks good. I think we need to improve docs, left a comment on that regard

@@ -0,0 +1,38 @@
title: Kubernetes apiserver metrics

Choose a reason for hiding this comment

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

Suggested change
title:Kubernetesapiserver metrics
title:KubernetesAPI Server metrics

ChrsMark reacted with thumbs up emoji
Comment on lines 37 to 38
title: Kubernetes apiserver metrics
description: Collect Kubernetes apiserver metrics

Choose a reason for hiding this comment

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

Suggested change
title:Kubernetesapiserver metrics
description:Collect Kubernetesapiserver metrics
title:KubernetesAPI Server metrics
description:Collect KubernetesAPI Server metrics

ChrsMark reacted with thumbs up emoji

This integration is used to collect metrics from
[Kubernetes clusters](https://kubernetes.io/).

Choose a reason for hiding this comment

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

I'm missing many of the explanations that we have here:https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html

It would be nice to provide good understanding on the variety of datasets that we have and how they need to be configured

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Nice catch! Added!

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark
Copy link
MemberAuthor

Updated the Docs and changed the sample json events with new ones according to the new indexing approach.

@@ -0,0 +1,2 @@
- name: kubernetes
type: group
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that according to latest changes inimport-beat, pushed by@kaiyan-sheng , this empty file is not required.

ChrsMark reacted with thumbs up emoji
@@ -0,0 +1,2 @@
- name: kubernetes
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

ChrsMark reacted with thumbs up emoji
@@ -0,0 +1 @@
metricsets: ["event"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it need any configuration options? There is even no "period" defined hence wondering.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I added the configuration manually in themanifest.yml and missed that. 👍

@@ -0,0 +1,44 @@
title: Kubernetes Node metrics
release: experimental
Copy link
Contributor

Choose a reason for hiding this comment

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

Please adjusts all release fields. We will release all new packages as "beta".

ChrsMark reacted with thumbs up emoji
show_user: true
default:
- kube-state-metrics:8080
title: Kubernetes state_resourcequota metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can update the title to a pleasant, human-readable form (no underscore).

ChrsMark reacted with thumbs up emoji
format_version: 1.0.0
name: kubernetes
title: Kubernetes
version: 0.0.1
Copy link
Contributor

Choose a reason for hiding this comment

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

version: 0.1.0

ChrsMark reacted with thumbs up emoji
requirement:
kibana:
versions: '>=7.3.0 <8.0.0'
elasticsearch: {}
Copy link
Contributor

Choose a reason for hiding this comment

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

This field (elasticsearch) can be removed.

ChrsMark reacted with thumbs up emoji
categories:
- metrics
release: beta
removable: true
Copy link
Contributor

Choose a reason for hiding this comment

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

This field too.

ChrsMark reacted with thumbs up emoji
description: Collect metrics from Kubernetes
inputs:
- type: kubernetes/metrics
title: Collect Kubernetes API Server, Container, Controller Manager, Event, Node, Pod, Proxy, Scheduler, state_container, state_cronjob, state_deployment, state_node, state_persistentvolume, state_persistentvolumeclaim, state_pod, state_replicaset, state_resourcequota, state_service, state_statefulset, state_storageclass, System and Volume metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe you can shorten this one :D

simply - Collect Kubernetes metrics?

ChrsMark reacted with thumbs up emoji
inputs:
- type: kubernetes/metrics
title: Collect Kubernetes API Server, Container, Controller Manager, Event, Node, Pod, Proxy, Scheduler, state_container, state_cronjob, state_deployment, state_node, state_persistentvolume, state_persistentvolumeclaim, state_pod, state_replicaset, state_resourcequota, state_service, state_statefulset, state_storageclass, System and Volume metrics
description: Collecting API Server, Container, Controller Manager, Event, Node, Pod, Proxy, Scheduler, state_container, state_cronjob, state_deployment, state_node, state_persistentvolume, state_persistentvolumeclaim, state_pod, state_replicaset, state_resourcequota, state_service, state_statefulset, state_storageclass, System and Volume metrics from Kubernetes
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that all captions, descriptions, etc. should present names which are human readable (no underscores).

ChrsMark reacted with thumbs up emoji
@mtojek
Copy link
Contributor

mtojek commentedJun 26, 2020
edited
Loading

Just noticed on screenshots, please improve case sensitivity on screenshots.

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark
Copy link
MemberAuthor

Thanks for the review@mtojek! Comments should be addressed now.

@ChrsMarkChrsMark requested a review frommtojekJune 26, 2020 09:13
Copy link
Contributor

@mtojekmtojek left a comment

Choose a reason for hiding this comment

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

Good job, Christos!

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark
Copy link
MemberAuthor

ChrsMark commentedJun 26, 2020
edited
Loading

@exekias@andresrc this integration is completed. Tested manually usingtesting/environments/kubernetes. Let me know if we can merge/ship it already or we want to wait for aRunning Agent on k8s part on Agent's side.

@mtojek
Copy link
Contributor

@ChrsMark

I think you have to merge this PR, otherwise you'll have to rebase against the master branch, as there are some breaking changes coming:#132

@exekias
Copy link

++ Let's get this in. I think it would be nice to follow up with docs on the Agent side on how to deploy in Kubernetes

Merging this on behalf of@ChrsMark, as he is off

ChrsMark reacted with thumbs up emojiChrsMark reacted with rocket emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

2 more reviewers

@exekiasexekiasexekias approved these changes

@mtojekmtojekmtojek approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

Integration:kubernetesKubernetesNew IntegrationIssue or pull request for creating a new integration package.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@ChrsMark@elasticmachine@mtojek@exekias@andrewkroh

Comments


[8]ページ先頭

©2009-2026 Movatter.jp