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

Add kubelet availability check for systemd CI. #216

Merged
merged 4 commits into from
Jun 4, 2024

Conversation

jefchien
Copy link

@jefchien jefchien commented Jun 3, 2024

Description: In some cases (systemd), kubelet isn't available on collector start up. Instead of failing and stopping the collector, return nil and wait for kubelet to be available and initialize the rest of the receiver after.

Behavior matches the collector recommendation for long-running starting operations.

	// Start tells the component to start. Host parameter can be used for communicating
	// with the host after Start() has already returned. If an error is returned by
	// Start() then the collector startup will be aborted.
	// If this is an exporter component it may prepare for exporting
	// by connecting to the endpoint.
	//
	// If the component needs to perform a long-running starting operation then it is recommended
	// that Start() returns quickly and the long-running operation is performed in background.
	// In that case make sure that the long-running operation does not use the context passed
	// to Start() function since that context will be cancelled soon and can abort the long-running
	// operation. Create a new context from the context.Background() for long-running operations.
	Start(ctx context.Context, host Host) error

This allows other receivers to become available and used while the container insights receiver waits. The receiver will perform the kubelet check (ListPods) once every 10 seconds.

@jefchien jefchien requested a review from mxiamxia as a code owner June 3, 2024 20:36
@jefchien jefchien merged commit 82dc971 into aws-cwa-dev Jun 4, 2024
@jefchien jefchien deleted the wait-for-kubelet branch June 4, 2024 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants