Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
ROX-28976: Optimize berserker load in long running cluster#64
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
0fc2370465122079ba82d18c50220e704c5169be03765eb45932361da9a9844a4262263746973d261f4d873b4cd77822639b9249f04a2cb7File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: prometheus | ||
| namespace: stackrox | ||
| labels: | ||
| app.kubernetes.io/name: stackrox | ||
| data: | ||
| prometheus.yml: |- | ||
| global: | ||
| scrape_interval: 30s | ||
| alerting: | ||
| alertmanagers: | ||
| - static_configs: | ||
| - targets: | ||
| - stackrox-monitoring-alertmanager:9093 | ||
| rule_files: | ||
| - /etc/prometheus/rules_*.yml | ||
| scrape_configs: | ||
| - job_name: "kubernetes-pods" | ||
| tls_config: | ||
| insecure_skip_verify: false | ||
| kubernetes_sd_configs: | ||
| - role: pod | ||
| namespaces: | ||
| own_namespace: true | ||
| relabel_configs: | ||
| - action: labelmap | ||
| regex: __meta_kubernetes_pod_label_(.+) | ||
| - source_labels: [__meta_kubernetes_namespace] | ||
| action: replace | ||
| target_label: namespace | ||
| - source_labels: [__meta_kubernetes_pod_name] | ||
| action: replace | ||
| target_label: pod | ||
| - source_labels: [__meta_kubernetes_pod_node_name] | ||
| action: replace | ||
| target_label: node_name | ||
| - job_name: "kubernetes-cadvisor" | ||
| scheme: https | ||
| metrics_path: /metrics/cadvisor | ||
| tls_config: | ||
| ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | ||
| insecure_skip_verify: true | ||
| authorization: | ||
| credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token | ||
| kubernetes_sd_configs: | ||
| - role: node | ||
| relabel_configs: | ||
| - action: labelmap | ||
| regex: __meta_kubernetes_node_label_(.+) | ||
| metric_relabel_configs: | ||
| - source_labels: [container] | ||
| regex: berserker | ||
| action: drop | ||
| - source_labels: [namespace] | ||
| regex: berserker-* | ||
| action: drop | ||
| - job_name: stackrox | ||
| tls_config: | ||
| insecure_skip_verify: false | ||
| kubernetes_sd_configs: | ||
| - role: endpoints | ||
| namespaces: | ||
| own_namespace: true | ||
| relabel_configs: | ||
| - source_labels: [__meta_kubernetes_endpoint_port_name] | ||
| action: keep | ||
| regex: monitoring | ||
| - source_labels: [__meta_kubernetes_endpoints_name] | ||
| action: replace | ||
| target_label: job | ||
| - source_labels: [__meta_kubernetes_namespace] | ||
| action: replace | ||
| target_label: namespace | ||
| - source_labels: [__meta_kubernetes_endpoint_node_name] | ||
| action: replace | ||
| target_label: node_name |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -13,13 +13,20 @@ kubectl -n stackrox create secret generic access-rhacs \ | ||
| kubectl create -f "${SCRIPT_DIR}/collector-config.yaml" | ||
| echo "Deploying Monitoring..." | ||
| monitoring_values_file="${COMMON_DIR}/../charts/monitoring/values.yaml" | ||
| yq -i '.resources.requests.memory = "8Gi"' "$monitoring_values_file" | ||
| yq -i '.resources.limits.memory = "8Gi"' "$monitoring_values_file" | ||
| helm_args=( | ||
| --set persistence.type="${STORAGE}" | ||
| --set exposure.type="${MONITORING_LOAD_BALANCER}" | ||
| ) | ||
| helm dependency update "${COMMON_DIR}/../charts/monitoring" | ||
| envsubst < "${COMMON_DIR}/../charts/monitoring/values.yaml" > "${COMMON_DIR}/../charts/monitoring/values_substituted.yaml" | ||
| envsubst < "$monitoring_values_file" > "${COMMON_DIR}/../charts/monitoring/values_substituted.yaml" | ||
| helm upgrade -n stackrox --install --create-namespace stackrox-monitoring "${COMMON_DIR}/../charts/monitoring" --values "${COMMON_DIR}/../charts/monitoring/values_substituted.yaml" "${helm_args[@]}" | ||
| rm "${COMMON_DIR}/../charts/monitoring/values_substituted.yaml" | ||
| echo "Deployed Monitoring..." | ||
| # Replace the prometheus ConfigMap with one that doesn't scrape as much info from berserker containers | ||
| kubectl -n stackrox delete configmap prometheus | ||
| kubectl create -f "${SCRIPT_DIR}"/prometheus.yaml | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer if we can override the offending values in the monitoring chart. Can you check if that is possible? Same with the update to the monitoring deploment. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean you want me to make the changes in stackrox/stackrox? I feel like 8Gi is too much for every case that the monitoring pod is used. I could make the changes to prometheus.yaml in stackrox/stackrox, but didn't want to pollute it with references to berserker. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I now use yq to set memory limit and request to 8Gi. Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would simply copy the ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tommartensen Requested the use of yq in a private conversation and it is okay with me too. | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we don't need that anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't need it in the first place. It is redundant with the line above it.