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

feat: etcd collector #1589

Merged
merged 12 commits into from
Aug 12, 2024
Merged

feat: etcd collector #1589

merged 12 commits into from
Aug 12, 2024

Conversation

nvanthao
Copy link
Member

@nvanthao nvanthao commented Jul 30, 2024

Description, Motivation and Context

New etcd collector that will collect these output from a Kubernetes cluster.

Demo: https://www.loom.com/share/6f72f73d983b457eada0044bd19f9406

etcdctl endpoint health
etcdctl endpoint status
etcdctl member list
etcdctl alarm list

We only supported distributions that we have access to etcd:

  • kURL (static pod by kubeadm)
  • k0s/embedded-cluster, process managed by k0scontroller

Checklist

  • New and existing tests pass locally with introduced changes.
  • Tests for the changes have been added (for bug fixes / features)
  • The commit message(s) are informative and highlight any breaking changes
  • Any documentation required has been added/updated. feat: etcd collector doc troubleshoot.sh#572

Does this PR introduce a breaking change?

  • Yes
  • No

@nvanthao nvanthao added the type::feature New feature or request label Jul 30, 2024
@nvanthao nvanthao requested a review from a team as a code owner July 30, 2024 22:44
@nvanthao nvanthao changed the title Gerard/sc 109302/etcd collector feat: etcd collector Jul 31, 2024
pkg/collect/etcd.go Outdated Show resolved Hide resolved
Makefile Outdated
@@ -105,6 +105,9 @@ tidy:
bin/support-bundle:
go build ${BUILDFLAGS} ${LDFLAGS} -o bin/support-bundle github.com/replicatedhq/troubleshoot/cmd/troubleshoot

bin/support-bundle-linux:
Copy link
Member

Choose a reason for hiding this comment

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

This is a good addition. Would the target below be better to get all binaries? Builds run in parallel, so additional compiling time should be negligible

build-linux: tidy
	@echo "Build cli binaries"
	GOOS=linux GOARCH=amd64 $(MAKE) -j bin/support-bundle bin/preflight bin/analyze bin/collect

pkg/collect/etcd.go Outdated Show resolved Hide resolved
Name: "etcd-client",
Image: "quay.io/coreos/etcd:latest",
Command: []string{"sleep"},
Args: []string{"1d"},
Copy link
Member

Choose a reason for hiding this comment

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

Even if we delete the pod once done, isn't sleeping 1d too long? If deleting fails, say deletion fails or interrupted by user, the pod will be lingering there for a while. A shorter time period like 5m would be better IMO

Containers: []corev1.Container{
{
Name: "etcd-client",
Image: "quay.io/coreos/etcd:latest",
Copy link
Member

Choose a reason for hiding this comment

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

I think this ought to be passed in as input. In airgap EC environments, we would bundle an etcd image and then pass in the image name to the collector i.e the image would be something like registry.namespace/etcd:tag

Copy link
Member Author

Choose a reason for hiding this comment

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

that's a great idea! I've made the requested changes. please let me know how it goes/

@nvanthao nvanthao requested a review from banjoh August 4, 2024 22:37
@nvanthao nvanthao force-pushed the gerard/sc-109302/etcd-collector branch from 7273a35 to 9a88e17 Compare August 8, 2024 00:18
banjoh
banjoh previously approved these changes Aug 9, 2024
Copy link
Member

@banjoh banjoh left a comment

Choose a reason for hiding this comment

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

LGTM

"etcdctl endpoint health",
"etcdctl endpoint status",
"etcdctl member list",
"etcdctl alarm list",
Copy link
Member

Choose a reason for hiding this comment

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

Can we add etcdctl version here?

Output looks like this

etcdctl version: 3.5.1
API version: 3.5

@nvanthao nvanthao merged commit 47656a8 into main Aug 12, 2024
27 checks passed
@nvanthao nvanthao deleted the gerard/sc-109302/etcd-collector branch August 12, 2024 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants