Skip to content

vmdistributed: support trafficMode#2100

Open
AndrewChubatiuk wants to merge 1 commit intomasterfrom
vmdistributed-traffic-modes
Open

vmdistributed: support trafficMode#2100
AndrewChubatiuk wants to merge 1 commit intomasterfrom
vmdistributed-traffic-modes

Conversation

@AndrewChubatiuk
Copy link
Copy Markdown
Contributor

@AndrewChubatiuk AndrewChubatiuk commented Apr 24, 2026

fixes #1995


Summary by cubic

Add per‑zone traffic modes to vmdistributed to control read and write routing. This lets you put a zone into read-only, write-only, read-write, or maintenance without removing it.

  • New Features
    • Added spec.zones[*].trafficMode with read-write (default), read-only, write-only, maintenance.
    • vmauth now routes by mode: read-only excluded from write targets; write-only from read targets; maintenance from both.
    • For read-only or maintenance, the zone’s VMInsert is scaled to 0 replicas to block writes.
    • Defaulting sets missing trafficMode to read-write; CRDs, API docs, and CHANGELOG updated.

Written for commit 827eaa1. Summary will update on new commits.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 11 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="docs/CHANGELOG.md">

<violation number="1" location="docs/CHANGELOG.md:17">
P3: Improve this changelog sentence for clarity and correctness: use “allows disabling read, write, or all traffic to a zone.”

(Based on your team's feedback about clarifying behavior and roles in documentation text.) [FEEDBACK_USED]</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread docs/CHANGELOG.md
Comment thread api/operator/v1alpha1/vmdistributed_types.go Outdated
@AndrewChubatiuk AndrewChubatiuk force-pushed the vmdistributed-traffic-modes branch from 15a23ec to 827eaa1 Compare April 24, 2026 10:11
Copy link
Copy Markdown
Collaborator

@vrutkovs vrutkovs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, but it needs a few more unit tests and e2e test preferably - and example / documentation update

vmCluster.Spec = *vmClusterSpec
rclient.Scheme().Default(&vmCluster)
if (z.TrafficMode == vmv1alpha1.VMDistributedTrafficModeReadOnly || z.TrafficMode == vmv1alpha1.VMDistributedTrafficModeMaintenance) && vmCluster.Spec.VMInsert != nil {
vmCluster.Spec.VMInsert.ReplicaCount = ptr.To(int32(0))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that make vmagent start accumulating the queue for RO clusters? Also, needs a comment why we do this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vmdistributed: configure read-only and write-only zones

2 participants