Repository navigation
Conversation
…Alloy faster
Moving Loki from an emptyDir to a PersistentVolumeClaim timed out in prod.
The migration Job deleted the StatefulSet with --cascade=orphan. The
recreated StatefulSet adopted the running pod, tried to add the claim to
it in place, which Kubernetes forbids ("pod updates may not change
fields..."), and never got as far as replacing it. The claim stayed
Pending and Helm waited out its deadline.
statefulset-volume-migration 0.2.0 runs a script instead of one kubectl
call:
- layout differs: POST Loki's /flush, then delete the StatefulSet with
its pods (--cascade=foreground); the Loki release recreates both;
- layout matches: replace only pods that do not mount their claims, so
clusters 0.1.0 left wedged recover on the next apply;
- otherwise change nothing.
The Role can get and delete the StatefulSet and its pods by ordinal only.
Alloy rolled one node at a time (~30s each), so on 12 nodes its rollout
outlasted Helm's 5-minute wait and failed the same apply. It now updates
25% of the nodes at a time.
rvn-eks-addons 0.22.1.
Ravion Module Publish PlanDry run only. No Ravion API mutations were made.
Diffsrvn-eks-addons 0.23.0 -> 0.23.1--- remote
+++ compiled
- Each load balancer's security group is automatically allowed to reach pods through the EKS cluster security group (all TCP ports).
- Because `TargetGroupBinding` depends on the controller, enabling any load balancer automatically installs the **load balancer controller** - there is nothing extra to configure.
- Terraform source: [ravionhq/modules/compute/eks/addons](https://github.com/ravionhq/modules/tree/rvn-eks-addons@0.23.0/compute/eks/addons)
+ Terraform source: [ravionhq/modules/compute/eks/addons](https://github.com/ravionhq/modules/tree/rvn-eks-addons@0.23.1/compute/eks/addons)
## Prerequisites
@@
execution_environment_overrides:
security_group: << module.input.ravion_runner_security_group_id >>
plan_permissions: '<< module.input.terraform_plan_default_policies_enabled == false ? {"replace": module.input.terraform_plan_iam_policy_arns} : (module.input.terraform_plan_iam_policy_arns ? {"attach": module.input.terraform_plan_iam_policy_arns} : nil) >>'
- ref: rvn-eks-addons@0.23.0
+ ref: rvn-eks-addons@0.23.1
repo: https://github.com/ravionhq/modules
stack_id: <<stack.id>>
terraform_variables: |
flybayer
approved these changes
Oct 16, 2026
…lume-migration # Conflicts: # .github/workflows/helm-charts.yml # README.md # compute/eks/addons/rvn-eks-addons-definition.yml
The migration Job's Role names each pod it may read, up to statefulSet.maxReplicas, which the module left at the chart's default of 3. A loki_helm_values override with more replicas made the Job fail with Forbidden on ravion-loki-3 and blocked the Loki upgrade. Pass the most replicas any loki_helm_values document asks for, fixed or autoscaled.
1 of 2 tasks
Contributor
|
@mabadir @flybayer This PR could not be combined with the queued merge tree. Failed operation: merge #216 at How to resolve
No conflict diff was captured, and assembly stopped before a candidate commit was created. Use the exact commit comparisons and conflicting files above; there is no candidate-commit diff to link. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The prod eks-addons apply (
prun_3Kmskfkhw8FYBFveYLSwThrVZBL) failed withhelm_release.loki: context deadline exceeded, and Alloy's release hit the same deadline.Loki. The
statefulset-volume-migrationJob deleted the Loki StatefulSet with--cascade=orphan. The recreated StatefulSet then:Pod "ravion-loki-0" is invalid: spec: Forbidden: pod updates may not change fields other than ...);As a result,
storage-ravion-loki-0stayed Pending, Loki kept running on its emptyDir, and Helm timed out. Prod was fixed by hand: flush Loki, delete the pod.Alloy. The DaemonSet rolled one node at a time, about 30s per node. On 12 nodes that took longer than Helm's 5-minute wait.
What
statefulset-volume-migration0.2.0: the Job now runsfiles/migrate.sh(kubectl, with a shell from busybox, asebs-storagedoes). The script handles three cases:persistentPOST /flush), then delete the StatefulSet with its pods (--cascade=foreground). The Loki release recreates both. About one minute of Loki downtime.Other changes:
get/deleteon the one StatefulSet and on its pods named by ordinal (<name>-0to<name>-(maxReplicas-1)). Nolistorwatch.updateStrategy.rollingUpdate.maxUnavailable: 25%, so an upgrade takes about four rollout waves whatever the cluster size.rvn-eks-addons0.22.1.Upgrade impact: the chart version is part of
loki_volume_layout, so on upgrade the Job runs once everywhere. It's a no-op where the layout already matches, but Loki's pod annotation changes, so Loki restarts once.Tests
tests/test_statefulset_volume_migration.py, which is new and wired into the Helm Charts workflow:kubectlandwget;charts/test.sh statefulset-volume-migration: 9 checks on the rendered chart (images and command, ConfigMap equals the file, env, hook, RBAC scope).tofu testforaddon_resilienceandlogs: 34 passed, including new assertions for the flush URL, the busybox image and Alloy's update strategy.readme --checkpass. The tooling tests pass (144).Fix the pod permission bound before merging so larger Loki installations can complete the upgrade.
Findings
Fix with agent prompt
Summary
Changes Loki volume moves to flush first and delete the StatefulSet with its pods. It also replaces pods left without their claims by the earlier migration.
Acknowledged behavior: mabadir states that this upgrade changes Loki's pod annotation and causes one restart even when its volume layout already matches.
Acknowledged behavior: mabadir describes flushing as best effort; a failed flush does not stop the migration.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Migration Job] --> B{StatefulSet exists?} B -->|No| C[Finish] B -->|Yes| D{Volume layout differs?} D -->|Yes| E[Request Loki flush] E --> F[Delete StatefulSet and pods] F --> G[Loki release recreates them] D -->|No| H[Read each pod] H --> I{Required claim missing?} I -->|Yes| J[Request flush and replace pod] I -->|No| CReviews (1) · Last reviewed commit: "fix(eks-addons): replace Loki's pod when..." · Reviewed by Greptile