use multiple secrets if scrape config exceeds K8s secret limit#2232
use multiple secrets if scrape config exceeds K8s secret limit#2232AndrewChubatiuk wants to merge 1 commit into
Conversation
8cf847c to
6d36761
Compare
There was a problem hiding this comment.
3 issues found across 16 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
286ce17 to
22d00e0
Compare
|
@cubic-ai-dev |
@AndrewChubatiuk I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
2 issues found across 17 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/controller/operator/factory/vmsingle/vmsingle.go">
<violation number="1" location="internal/controller/operator/factory/vmsingle/vmsingle.go:129">
P2: `prevDeploy` is always constructed with `extraConfigSecretCount=0`, even when the previous deployment had extra config secrets. This causes unnecessary deployment updates on every reconciliation for VMSingle instances with oversized scrape configs, as the prevDeploy/newDeploy comparison will always see a volume/mount diff.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| if prevCR != nil { | ||
| var err error | ||
| prevDeploy, err = newDeploy(ctx, prevCR) | ||
| prevDeploy, err = newDeploy(ctx, prevCR, 0) |
There was a problem hiding this comment.
P2: prevDeploy is always constructed with extraConfigSecretCount=0, even when the previous deployment had extra config secrets. This causes unnecessary deployment updates on every reconciliation for VMSingle instances with oversized scrape configs, as the prevDeploy/newDeploy comparison will always see a volume/mount diff.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/controller/operator/factory/vmsingle/vmsingle.go, line 129:
<comment>`prevDeploy` is always constructed with `extraConfigSecretCount=0`, even when the previous deployment had extra config secrets. This causes unnecessary deployment updates on every reconciliation for VMSingle instances with oversized scrape configs, as the prevDeploy/newDeploy comparison will always see a volume/mount diff.</comment>
<file context>
@@ -125,22 +126,22 @@ func CreateOrUpdate(ctx context.Context, cr *vmv1beta1.VMSingle, rclient client.
if prevCR != nil {
var err error
- prevDeploy, err = newDeploy(ctx, prevCR)
+ prevDeploy, err = newDeploy(ctx, prevCR, 0)
if err != nil {
return fmt.Errorf("cannot generate prev deploy spec: %w", err)
</file context>
22d00e0 to
16ff747
Compare
7590330 to
e748449
Compare
e748449 to
5af4c85
Compare
vmagent and vmsingle: use additional secrets if default scrape config size exceeds K8s secret limit. fixes #1048
Summary by cubic
Splits oversized scrape configs for
vmagent/vmsingleinto multiple gzip-compressed Secrets and loads overflow jobs viascrape_config_files. Addsconfig-reloadersupport to mirror and decompress watched files into an EmptyDir and clean up stale files.New Features
vmagent/vmsingle: When scrape config exceeds the 1MB Secret limit, overflow jobs are split using compressed-size-aware packing into extra Secrets (jobs.yaml). Pods mount a sharedsc-files-outEmptyDir;config-reloaderwatches per-bucket raw Secret dirs and writes decompressed files to matching subdirs. The main config adds ascrape_config_filesglob, and stale extra Secrets are removed automatically.config-reloader: Added--target-dirpaired with--watched-dir(counts must match). Detects gzip and decompresses. Copies files on init/start and on change, and removes orphaned files in the target.Bug Fixes
Written for commit 5af4c85. Summary will update on new commits.