-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prombench: Added parca for continous profiling support.
Fixes #552 Signed-off-by: bwplotka <[email protected]>
- Loading branch information
Showing
6 changed files
with
185 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: parca | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: parca | ||
rules: | ||
- apiGroups: [""] | ||
resources: | ||
- nodes | ||
- nodes/proxy | ||
- services | ||
- endpoints | ||
- pods | ||
verbs: ["get", "list", "watch"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: parca | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: parca | ||
subjects: | ||
- kind: ServiceAccount | ||
name: parca | ||
namespace: default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: parca | ||
data: | ||
# TODO(bwplotka): Add config reloader, otherwise pod has to manually deleted. | ||
parca.yaml: |- | ||
"object_storage": | ||
"bucket": | ||
"config": | ||
"directory": "/var/lib/parca" | ||
"type": "FILESYSTEM" | ||
scrape_configs: | ||
- job_name: prometheus | ||
scrape_interval: 30s | ||
scrape_timeout: 40s | ||
scheme: http | ||
kubernetes_sd_configs: | ||
- role: endpoints | ||
tls_config: | ||
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | ||
insecure_skip_verify: true | ||
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token | ||
relabel_configs: | ||
- action: keep | ||
source_labels: [__meta_kubernetes_service_label_app] | ||
regex: prometheus|prometheus-meta | ||
- source_labels: [__meta_kubernetes_service_label_prometheus] | ||
target_label: prometheus | ||
# Each prometheus is configured with external path option, so it serves on certain hardcoded path. Adjust it. | ||
- source_labels: [__meta_kubernetes_namespace] | ||
regex: prombench-(.*) | ||
target_label: pr_number | ||
- source_labels: [__profile_path__] | ||
target_label: __init_profile_path | ||
- source_labels: [__meta_kubernetes_service_label_app, __init_profile_path] | ||
regex: prometheus-meta;(.*) | ||
replacement: /prometheus-meta$1 | ||
target_label: __profile_path__ | ||
- source_labels: [prometheus, pr_number, __init_profile_path] | ||
regex: test-.*;(.*);(.*) | ||
replacement: /$1/prometheus-release$2 | ||
target_label: __profile_path__ | ||
- source_labels: [prometheus, pr_number, __init_profile_path] | ||
regex: test-pr-.*;(.*);(.*) | ||
replacement: /$1/prometheus-pr$2 | ||
target_label: __profile_path__ | ||
- regex: __init_profile_path | ||
action: labeldrop | ||
- source_labels: [__address__] | ||
target_label: instance | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: parca | ||
labels: | ||
app: parca | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: parca | ||
template: | ||
metadata: | ||
labels: | ||
app: parca | ||
spec: | ||
serviceAccountName: parca | ||
securityContext: | ||
fsGroup: 65534 | ||
runAsUser: 65534 | ||
containers: | ||
- image: ghcr.io/parca-dev/parca:v0.18.0 | ||
args: | ||
- /parca | ||
- "--http-address=:7070" | ||
- "--config-path=/etc/parca/parca.yaml" | ||
- "--path-prefix=/profiles" | ||
- "--log-level=info" | ||
- "--cors-allowed-origins=*" | ||
- "--debuginfod-upstream-servers=https://debuginfod.systemtap.org" | ||
- "--debuginfod-http-request-timeout=5m" | ||
livenessProbe: | ||
exec: | ||
command: | ||
- /grpc_health_probe | ||
- -v | ||
- -addr=:7070 | ||
initialDelaySeconds: 5 | ||
name: parca | ||
terminationMessagePolicy: FallbackToLogsOnError | ||
volumeMounts: | ||
- mountPath: /etc/parca | ||
name: config | ||
- mountPath: /var/lib/parca | ||
name: storage | ||
ports: | ||
- name: parca-web | ||
containerPort: 7070 | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: parca | ||
# TODO(bwplotka): Make it persistent at some point. | ||
- name: storage | ||
emptyDir: {} | ||
terminationGracePeriodSeconds: 120 | ||
nodeSelector: | ||
node-name: main-node | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: parca | ||
labels: | ||
app: parca | ||
spec: | ||
type: NodePort | ||
ports: | ||
- name: parca-web | ||
port: 80 | ||
targetPort: parca-web | ||
selector: | ||
app: parca | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: ingress-parca | ||
annotations: | ||
kubernetes.io/ingress.class: "nginx" | ||
nginx.ingress.kubernetes.io/ssl-redirect: "false" | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- backend: | ||
service: | ||
name: parca | ||
port: | ||
name: parca-web | ||
path: /profiles | ||
pathType: Prefix |