Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions jsonnet/kube-prometheus/addons/pyrra.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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.

// limits: { cpu: '100m', memory: '100Mi' },
requests: { memory: '100Mi' },
},
replicas:: 1,
port:: 9099,

Expand All @@ -40,7 +45,6 @@
import 'github.com/pyrra-dev/pyrra/config/crd/bases/pyrra.dev_servicelevelobjectives.json'
),


_apiMetadata:: {
name: pyrra._config.name + '-api',
namespace: pyrra._config.namespace,
Expand Down Expand Up @@ -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.

'--prometheus-url=http://prometheus-k8s.%s.svc:9090' % pyrra._config.namespace,
],
// resources: pyrra._config.resources,
resources: pyrra._config.resources,
ports: [{ containerPort: pyrra._config.port }],
securityContext: {
allowPrivilegeEscalation: false,
Expand Down Expand Up @@ -103,7 +107,10 @@
spec: {
containers: [c],
// serviceAccountName: $.serviceAccount.metadata.name,
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)

},
},
},
},
Expand Down Expand Up @@ -186,7 +193,7 @@
args: [
'kubernetes',
],
// resources: pyrra._config.resources,
resources: pyrra._config.resources,
ports: [{ containerPort: pyrra._config.port }],
securityContext: {
allowPrivilegeEscalation: false,
Expand Down Expand Up @@ -216,7 +223,10 @@
spec: {
containers: [c],
serviceAccountName: pyrra.kubernetesServiceAccount.metadata.name,
nodeSelector: { 'kubernetes.io/os': 'linux' },
nodeSelector: {
'kubernetes.io/os': 'linux',
'kubernetes.io/arch': 'amd64',
},
},
},
},
Expand Down