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

jsonnet: run pyrra only on amd64 nodes with configured resource requests #1720

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

paulfantom
Copy link
Member

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.

Solving #1718

Type of change

What type of changes does your code introduce to the kube-prometheus? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Changelog entry

Please put a one-line changelog entry below. Later this will be copied to the changelog file.

jsonnet: run pyrra only on amd64 nodes with configured resource requests

Copy link
Member

@metalmatze metalmatze left a comment

Choose a reason for hiding this comment

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

Nice work!

We can also work on arm images for Pyrra, if that's something people want.

@@ -22,6 +22,11 @@
namespace:: error 'must provide namespace',
version:: error 'must provide version',
image: error 'must provide image',
resources: {
// TODO(paulfantom): configure limits when we have more operational data
Copy link
Member

Choose a reason for hiding this comment

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

Pyrra has a built in cache for graphs. This can, by default, be up to 512MiB. We can make this configurable in Pyrra and set this, plus some extra, as it's limit.

resources: {
// TODO(paulfantom): configure limits when we have more operational data
// limits: { cpu: '100m', memory: '100Mi' },
requests: { cpu: '4m', memory: '100Mi' },
Copy link
Member

Choose a reason for hiding this comment

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

This might get the API throttled just a bit too much. Currently, we convert the time series into another format.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since the most important part of this PR is to allow easy customization of those resources and not figure out the best possible values, I've removed cpu resource requirements and left only memory ones. We can change this later on.

Signed-off-by: Paweł Krupa (paulfantom) <pawel@krupa.net.pl>
@@ -72,10 +76,10 @@
image: pyrra._config.image,
args: [
'api',
'--api-url=http://%s.%s.svc.cluster.local:9444' % [pyrra.kubernetesService.metadata.name, pyrra.kubernetesService.metadata.namespace],
'--prometheus-url=http://prometheus-k8s.%s.svc.cluster.local:9090' % pyrra._config.namespace,
'--api-url=http://%s.%s.svc:9444' % [pyrra.kubernetesService.metadata.name, pyrra.kubernetesService.metadata.namespace],
Copy link
Member Author

Choose a reason for hiding this comment

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

I've removed cluster.local as not all clusters use this DNS suffix.

nodeSelector: { 'kubernetes.io/os': 'linux' },
nodeSelector: {
'kubernetes.io/os': 'linux',
'kubernetes.io/arch': 'amd64',
Copy link
Member Author

Choose a reason for hiding this comment

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

This can be removed when pyrra publishes arm64 images (WIP: pyrra-dev/pyrra#249)

@paulfantom paulfantom marked this pull request as ready for review April 25, 2022 11:17
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

This lgtm. When can we get this merged? @metalmatze

@github-actions github-actions bot added the stale label Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants