Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
fcb3bde
chore: update image tags for prod release
github-actions[bot] Jan 27, 2026
bd881cf
Merge pull request #389 from nudgebee/test-prod-2701
blue4209211 Jan 27, 2026
8c455c3
fix: switch OTel Collector ClickHouse exporter from native TCP to HTTP
mayankpande88 Feb 1, 2026
9460317
fix: fix for version
mayankpande88 Feb 1, 2026
27d03db
chore: update image tags for prod release
github-actions[bot] Feb 1, 2026
3902852
Merge branch 'prod' into fix-cpllector-deprication
mayankpande88 Feb 1, 2026
cb97027
Merge pull request #392 from nudgebee/feat/node-agent-headless-service
mayankpande88 Feb 6, 2026
c14b204
Merge pull request #391 from nudgebee/fix-cpllector-deprication
blue4209211 Feb 6, 2026
6394d87
fix: set loki datasource isDefault=false to prevent Grafana crash
mayankpande88 Mar 5, 2026
da6033c
chore: update image tags for prod release
github-actions[bot] Mar 5, 2026
89eb0bb
style: quote namespace variable and improve readability of loki helm …
mayankpande88 Mar 5, 2026
224c8fe
chore: bump chart version to 0.0.117
mayankpande88 Mar 5, 2026
fedf346
Merge pull request #394 from nudgebee/fix/loki-default-datasource
blue4209211 Mar 5, 2026
92e0ee3
fix: readme
mayankpande88 Mar 6, 2026
45fd023
Merge pull request #395 from nudgebee/mayankpande88-patch-15
blue4209211 Mar 8, 2026
0da1c77
chore: updated release version
mayankpande88 Mar 23, 2026
390b40e
chore: update image tags for prod release
github-actions[bot] Mar 23, 2026
73e2021
Merge pull request #403 from nudgebee/mayankpande88-patch-16
blue4209211 Mar 23, 2026
04fab81
fix: expose rate_limit params for crash loop and image pull backoff t…
mayankpande88 Mar 23, 2026
093c020
chore: update image tags for prod release
github-actions[bot] Mar 23, 2026
3062636
Merge pull request #404 from nudgebee/fix/expose-rate-limit-params
blue4209211 Mar 24, 2026
5301ce5
chore: updated version
mayankpande88 Mar 25, 2026
8ef7cb4
chore: update image tags for prod release
github-actions[bot] Mar 25, 2026
3795e49
Merge pull request #405 from nudgebee/mayankpande88-patch-18
blue4209211 Mar 25, 2026
d16d595
fix: add --no-paginate to nudgebee-agent ECR query in release workflows
mayankpande88 Apr 1, 2026
da98129
chore: update image tags for prod release
github-actions[bot] Apr 1, 2026
e1bee32
Merge pull request #408 from nudgebee/fix/ecr-no-paginate-prod
mayankpande88 Apr 1, 2026
27350f6
chore: updated version
mayankpande88 Apr 2, 2026
06835b0
Merge pull request #409 from nudgebee/mayankpande88-patch-19
mayankpande88 Apr 2, 2026
e652538
fix: default runner.clickhouse_enabled to false to prevent secret loo…
mayankpande88 Apr 5, 2026
064128f
chore: bump chart version to 0.0.121
mayankpande88 Apr 5, 2026
d3c36ec
Merge pull request #411 from nudgebee/fix-clickhouse-enabled-param-prod
blue4209211 Apr 5, 2026
dbefaab
fix: remove invalid matchers field from AlertmanagerConfig receiver
mayankpande88 Apr 11, 2026
21f043c
chore: update image tags for prod release
github-actions[bot] Apr 11, 2026
52cb81e
ci: add kubeconform validation and helm template rendering to CI
mayankpande88 Apr 11, 2026
0da6c48
Merge pull request #413 from nudgebee/fix-alertconfig-prod
blue4209211 Apr 11, 2026
235a4b9
feat: add new flags to installation script for self-hosted and compon…
mayankpande88 Apr 14, 2026
7351f08
fix: reduce alert-rule noise with rate/ratio-based thresholds
mayankpande88 Apr 29, 2026
1c52baa
chore: bump chart version to 0.0.123
mayankpande88 Apr 29, 2026
3877f76
fix: replace probabilistic with tail sampling and add memory limiter …
mayankpande88 Apr 29, 2026
d796014
fix: aggregate 5xx ratio across status codes in ApplicationAPIFailures
mayankpande88 Apr 29, 2026
e6a1839
Merge pull request #415 from nudgebee/fix/installation-script-new-fla…
mayankpande88 Apr 29, 2026
14bf977
Merge pull request #417 from nudgebee/fix/alert-rules-reduce-noise
mayankpande88 Apr 29, 2026
804ecae
fix(otel): make filter/drop_health_check OTTL conditions parse
mayankpande88 Apr 29, 2026
77d4d04
chore: update image tags for prod release
github-actions[bot] Apr 29, 2026
78e34b4
Merge pull request #418 from nudgebee/fix/otel-drop-health-check-ottl…
mayankpande88 Apr 29, 2026
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
2 changes: 1 addition & 1 deletion .github/configs/ct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target-branch: prod
chart-dirs:
- charts
chart-repos: []
validate-chart-schema: false
validate-chart-schema: true
validate-maintainers: false
validate-yaml: true
exclude-deprecated: true
Expand Down
45 changes: 31 additions & 14 deletions .github/workflows/helm-dev-lint.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,60 @@
# CI Workflow for Agent Helm chart
name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
helm-test:
helm-lint-and-validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Add dependency chart repos
run: |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add opencost https://opencost.github.io/opencost-helm-chart
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo add bitnami https://charts.bitnami.com/bitnami

- uses: azure/setup-helm@v3
- uses: azure/setup-helm@v4
with:
version: v3.10.0
version: v3.14.0

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
check-latest: true
python-version: '3.12'

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.3.1
uses: helm/chart-testing-action@v2.7.0

- name: Run chart-testing (lint)
run: ct lint --debug --config ./.github/configs/ct.yaml --lint-conf ./.github/configs/lintconf.yaml --check-version-increment=false

- name: Build chart dependencies
run: helm dependency build charts/nudgebee-agent

- name: Render templates
run: helm template nudgebee-agent charts/nudgebee-agent --namespace nudgebee-agent > /tmp/rendered.yaml

- name: Install kubeconform
run: |
curl -sSLo /tmp/kubeconform.tar.gz https://github.com/yannh/kubeconform/releases/download/v0.6.7/kubeconform-linux-amd64.tar.gz
tar -xzf /tmp/kubeconform.tar.gz -C /usr/local/bin kubeconform

- name: Validate rendered templates
run: |
kubeconform \
-strict \
-summary \
-schema-location default \
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \
-skip SecurityContextConstraints \
/tmp/rendered.yaml
46 changes: 31 additions & 15 deletions .github/workflows/helm-prod-test.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
# CI Workflow for Agent Helm chart
name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "prod" ]
pull_request:
branches: [ "prod"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
helm-test:
helm-lint-and-validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Add dependency chart repos
run: |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add opencost https://opencost.github.io/opencost-helm-chart
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo add bitnami https://charts.bitnami.com/bitnami

- uses: azure/setup-helm@v3
- uses: azure/setup-helm@v4
with:
version: v3.10.0
version: v3.14.0

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
check-latest: true
python-version: '3.12'

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.3.1
uses: helm/chart-testing-action@v2.7.0

- name: List changed charts
id: list-changed
run: |
## If executed with debug this won't work anymore.
changed=$(ct --config ./.github/configs/ct.yaml list-changed)
charts=$(echo "$changed" | tr '\n' ' ' | xargs)
if [[ -n "$changed" ]]; then
Expand All @@ -52,3 +47,24 @@ jobs:

- name: Run chart-testing (lint)
run: ct lint --debug --config ./.github/configs/ct.yaml --lint-conf ./.github/configs/lintconf.yaml

- name: Build chart dependencies
run: helm dependency build charts/nudgebee-agent

- name: Render templates
run: helm template nudgebee-agent charts/nudgebee-agent --namespace nudgebee-agent > /tmp/rendered.yaml

- name: Install kubeconform
run: |
curl -sSLo /tmp/kubeconform.tar.gz https://github.com/yannh/kubeconform/releases/download/v0.6.7/kubeconform-linux-amd64.tar.gz
tar -xzf /tmp/kubeconform.tar.gz -C /usr/local/bin kubeconform

- name: Validate rendered templates
run: |
kubeconform \
-strict \
-summary \
-schema-location default \
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \
-skip SecurityContextConstraints \
/tmp/rendered.yaml
2 changes: 1 addition & 1 deletion .github/workflows/release-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Update Helm Package for Nudgebee RC
working-directory: ./charts/nudgebee-agent
run: |
nudgebee_app_image=`aws ecr describe-images --repository-name nudgebee-agent --filter tagStatus=TAGGED --query 'sort_by(imageDetails[?imageTags], &imagePushedAt)[-1].imageTags[0]' --region us-east-1 --output text`
nudgebee_app_image=`aws ecr describe-images --repository-name nudgebee-agent --filter tagStatus=TAGGED --query 'sort_by(imageDetails[?imageTags], &imagePushedAt)[-1].imageTags[0]' --region us-east-1 --output text --no-paginate`
echo "nudgebee_app_image: $nudgebee_app_image"
yq -i ".runner.image.tag=\"$nudgebee_app_image\"" values.yaml

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Update Helm Package for Nudgebee
working-directory: ./charts/nudgebee-agent
run: |
nudgebee_app_image=`aws ecr describe-images --repository-name nudgebee-agent --filter tagStatus=TAGGED --query 'sort_by(imageDetails[?imageTags], &imagePushedAt)[-1].imageTags[0]' --region us-east-1 --output text`
nudgebee_app_image=`aws ecr describe-images --repository-name nudgebee-agent --filter tagStatus=TAGGED --query 'sort_by(imageDetails[?imageTags], &imagePushedAt)[-1].imageTags[0]' --region us-east-1 --output text --no-paginate`
echo "nudgebee_app_image: $nudgebee_app_image"
yq -i ".runner.image.tag=\"$nudgebee_app_image\"" values.yaml

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![CI](https://github.com/nudgebee/k8s-agent/actions/workflows/helm-test.yml/badge.svg?branch=main)](https://github.com/nudgebee/k8s-agent/actions/workflows/helm-test.yml) [![Release Charts](https://github.com/nudgebee/k8s-agent/actions/workflows/release.yml/badge.svg?branch=main)](https://github.com/nudgebee/k8s-agent/actions/workflows/release.yml)

# NudgeBee Kubernetes agent
Module to connect kubernetes to NudgeBee.

Expand Down
4 changes: 2 additions & 2 deletions charts/nudgebee-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ icon: https://nudgebee-documents.s3.amazonaws.com/images/Nudgebee-logo.png
# these are set to the right value by .github/workflows/release.yaml
# we use 0.0.1 as a placeholder for the version` because Helm wont allow `0.0.0` and we want to be able to run
# `helm install` on development checkouts without updating this file. the version doesn't matter in that case anyway
version: 0.0.115
appVersion: 0.0.115
version: 0.0.124
appVersion: 0.0.124
dependencies:
- name: opencost
version: 2.0.1
Expand Down
31 changes: 31 additions & 0 deletions charts/nudgebee-agent/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,35 @@ spec:
- hostPath:
path: /sys/kernel/debug
name: debugfs
{{- end }}
{{- if (and .Values.nodeAgent.enabled .Values.nodeAgent.service.enabled) }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "nudgebee-agent.fullname" . }}-node-agent
namespace: {{ .Release.Namespace }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "80"
prometheus.io/path: /metrics
Comment thread
mayankpande88 marked this conversation as resolved.
{{- with .Values.nodeAgent.service.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "nudgebee-agent.labels" . | nindent 4 }}
component: node-agent
{{- with .Values.nodeAgent.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
clusterIP: None
selector:
{{- include "node-agent.selectorLabels" . | nindent 4 }}
component: node-agent
ports:
- name: http
port: 80
targetPort: http
protocol: TCP
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ spec:
receiver: 'nudgebee-agent'
receivers:
- name: 'nudgebee-agent'
matchers:
- severity=~".*"
webhookConfigs:
- url: 'http://{{ include "nudgebee-agent.fullname" . }}-runner.{{ .Release.Namespace }}.svc/api/alerts'
sendResolved: true
Expand Down
78 changes: 55 additions & 23 deletions charts/nudgebee-agent/templates/prometheus-alert-rule.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{{- if (and (not (default false .Values.runner.victoria_metrics_enabled)) (default false .Values.alertmanager.create_nb_default_rules)) }}
{{- /*
Container-ID exclusions for the log-error and HTTP-failure rules.

The log-error regex additionally excludes log-collection infrastructure
(fluent-bit, loki, opensearch, etc.), which emits steady error-level
log streams that are transport/ingest failures — not app-level signal.
*/ -}}
{{- $excludeLog := ".*(prometheus|grafana|kube-system|nudgebee-agent|containerd|kubelet|keda|actions-runner-system-1|fluent-bit|fluentd|loki|opensearch|elasticsearch|logstash|datadog|newrelic|otel|promtail).*" -}}
{{- $excludeApi := ".*(prometheus|grafana|kube-system|nudgebee-agent|containerd|kubelet|keda|karpenter|actions-runner-system-1).*" -}}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
Expand All @@ -13,48 +22,71 @@ spec:
rules:
- alert: KubeHpaMaxedOut
expr: >-
kube_horizontalpodautoscaler_status_current_replicas{job="kube-state-metrics"}
==
kube_horizontalpodautoscaler_status_current_replicas{job="kube-state-metrics"}
==
kube_horizontalpodautoscaler_spec_max_replicas{job="kube-state-metrics"}
> 1
for: 15m
labels:
severity: warning
annotations:
description: >-
HPA {{`{{ $labels.namespace }}`}}/{{`{{ $labels.horizontalpodautoscaler }}`}}
HPA {{`{{ $labels.namespace }}`}}/{{`{{ $labels.horizontalpodautoscaler }}`}}
has been running at max replicas for longer than 15 minutes.
summary: HPA is running at max replicas
# Fires when a container's error/critical log rate is >3x its historical
# baseline (1h window offset 1h — the offset keeps an ongoing spike from
# polluting the baseline and silencing sustained incidents). The 0.1/s
# floor is an activity floor (≥6 err/min) that avoids ratio blowups on
# idle containers. The baseline>0 guard prevents cold-start containers
# (no historical data) from firing on their first error burst.
- alert: HighErrorCriticalLogs
expr: >-
increase(container_log_messages_total{level=~"error|critical",
container_id!~".*(prometheus|grafana|kube-system|nudgebee-agent|containerd|kubelet|keda|actions-runner-system-1).*"}[5m])
> 1
for: 5m
expr: |
rate(container_log_messages_total{level=~"error|critical", container_id!~"{{ $excludeLog }}"}[5m])
> 3 * rate(container_log_messages_total{level=~"error|critical", container_id!~"{{ $excludeLog }}"}[1h] offset 1h)
and
rate(container_log_messages_total{level=~"error|critical", container_id!~"{{ $excludeLog }}"}[5m]) > 0.1
and
rate(container_log_messages_total{level=~"error|critical", container_id!~"{{ $excludeLog }}"}[1h] offset 1h) > 0
for: 10m
annotations:
summary: "High error/critical logs - Sample: {{`{{ printf \"%.80s\" $labels.sample }}`}}"
description: "The total count of container log messages with error or critical level is higher for the past 5 minutes, grouped by container_id. Container ID: {{`{{ $labels.container_id }}`}} Log Sample: {{`{{ $labels.sample }}`}} Failure Count: {{`{{ printf \"%.0f\" $value }}`}}"
description: "Container log error rate is more than 3x its 1h baseline. Container ID: {{`{{ $labels.container_id }}`}} Log Sample: {{`{{ $labels.sample }}`}} Current rate (err/s): {{`{{ printf \"%.2f\" $value }}`}}"
labels:
severity: critical
severity: warning
# Fires when >5% of a container's HTTP traffic is 5xx for 10m, with an
# activity floor of 0.1 req/s so ratios don't blow up on low-volume
# containers. 4xx is excluded — those are client errors (bad request,
# unauthorised, etc.) and don't indicate the application failing.
- alert: ApplicationAPIFailures
expr: >-
increase(container_http_requests_total{container_id!~".*(prometheus|grafana|kube-system|nudgebee-agent|containerd|kubelet|keda|karpenter|actions-runner-system-1).*",
status=~"5..|4.."}[5m]) > 1
for: 5m
expr: |
(
sum by (container_id, method, path) (rate(container_http_requests_total{status=~"5..", container_id!~"{{ $excludeApi }}"}[5m]))
/ on (container_id) group_left ()
sum by (container_id) (rate(container_http_requests_total{container_id!~"{{ $excludeApi }}"}[5m]))
Comment thread
mayankpande88 marked this conversation as resolved.
) > 0.05
and on (container_id)
sum by (container_id) (rate(container_http_requests_total{container_id!~"{{ $excludeApi }}"}[5m])) > 0.1
for: 10m
annotations:
summary: "API Failures - {{`{{ $labels.method }}`}} {{`{{ printf \"%.50s\" $labels.path }}`}} ({{`{{ $labels.status }}`}})"
description: "Application reported API failure. Container ID: {{`{{ $labels.container_id }}`}} Request Path: {{`{{ $labels.path }}`}} Request Method: {{`{{ $labels.method }}`}} Failure Count: {{`{{ printf \"%.0f\" $value }}`}}"
summary: "High 5xx rate - {{`{{ $labels.method }}`}} {{`{{ printf \"%.50s\" $labels.path }}`}}"
description: "Aggregate 5xx rate across status codes exceeds 5% of total traffic. Container ID: {{`{{ $labels.container_id }}`}} Request Path: {{`{{ $labels.path }}`}} Request Method: {{`{{ $labels.method }}`}} 5xx Ratio: {{`{{ printf \"%.2f\" $value }}`}}"
labels:
severity: critical
# Fires when a pod has been in Terminating state for >30 minutes — that
# is 60x the Kubernetes default terminationGracePeriodSeconds (30s), well
# past any legitimate graceful termination. max_over_time smooths across
# kube-state-metrics scrape gaps so the alert stays firing instead of
# flapping on each missed scrape.
- alert: KubePodStuckTerminating
expr: >-
count(kube_pod_deletion_timestamp) by (namespace, pod) *
count(kube_pod_status_reason{reason="NodeLost"} == 0) by
(namespace, pod) > 0
for: 5m
expr: |
(time() - max_over_time(kube_pod_deletion_timestamp[20m])) > 1800
unless on (namespace, pod)
max_over_time(kube_pod_status_reason{reason="NodeLost"}[20m]) == 1
for: 15m
labels:
severity: critical
severity: warning
annotations:
summary: Pod stuck in terminating state
description: "Pod {{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod }}`}} blocked in Terminating state."
description: "Pod {{`{{ $labels.namespace }}`}}/{{`{{ $labels.pod }}`}} blocked in Terminating state for over 30 minutes."
{{- end }}
Loading
Loading