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

New components remote.kubernetes.secret and remote.kubernetes.configmap #4854

Merged
merged 40 commits into from
Sep 14, 2023

Conversation

captncraig
Copy link
Contributor

@captncraig captncraig commented Aug 17, 2023

Implements #2976

Comment on lines 29 to 30
`poll_frequency` | `duration` | Frequency to poll the kubernetes API. | `"1m"` | no
`poll_timeout` | `duration` | Timeout when polling the kubernetes API.. | `"15s"` | no
Copy link
Member

Choose a reason for hiding this comment

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

Should these components do a watch call against the Kubernetes API instead of a poll?

Copy link
Contributor Author

@captncraig captncraig Aug 17, 2023

Choose a reason for hiding this comment

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

I am worried about the number of connections we'd take up to do that. Each component would have its own watch for each agent, or we combine internally and have to manage either a watch per namespace or an overly broad watch on the cluster.

For something that is not expected to change at high frequency, I thought this was a good trade off.

Copy link
Contributor

@jkroepke jkroepke Aug 19, 2023

Choose a reason for hiding this comment

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

Mention that some managed Kubernetes services also have some lower rate limits or throttles.

Maybe a component can be watch multiple configmaps/secrets by an selector.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true, but that would also add significant complexity to the implementation here, as well as to what the user needs to understand about it. There is always an alternative to mount things directly to the agent pod if such limits are a serious problem.

There are use cases where we may want more "dynamic" loading of config maps (like for dynamically loading flow modules from configmaps with a certain selector), but for now we don't really have the river features (map/reduce) needed to take advantage of that. remote.kubernetes.configmaps["configmap_name"]["key_name"] could be possible, but I'm not a huge fan at present. I'd rather get this simpler version out, and go from there.

Copy link
Contributor

@clayton-cornell clayton-cornell left a comment

Choose a reason for hiding this comment

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

Minor spelling and phrase corrections

captncraig and others added 19 commits August 28, 2023 12:43
Comment on lines 52 to 55
if args.PollFrequency <= 0 {
return fmt.Errorf("poll_frequency must be greater than 0")
}
return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there also be a check that the PollTimeout is > 0? Otherwise it will always cancel the request

component/remote/kubernetes/kubernetes.go Outdated Show resolved Hide resolved
component/remote/kubernetes/kubernetes.go Outdated Show resolved Hide resolved
Copy link
Contributor

@spartan0x117 spartan0x117 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@clayton-cornell clayton-cornell left a comment

Choose a reason for hiding this comment

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

Docs are OK as-is.

@captncraig captncraig merged commit 7ebf224 into main Sep 14, 2023
6 checks passed
@captncraig captncraig deleted the cmp_remote_k8s branch September 14, 2023 21:56
@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Sep 18, 2023
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 22, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants