chore: add kube-proxy removal - #2109
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
WalkthroughThe PR adds kubectl to the kube-eleven runtime image, invokes a new removeKubeProxy helper from the worker during Kubernetes version upgrades to delete kube-proxy ConfigMap and DaemonSet, and updates kustomization image tags to ChangesKubectl integration and kube-proxy removal
Sequence Diagram(s)sequenceDiagram
participant Worker as kube-eleven worker
participant Kubectl as kubectl binary
participant KubeAPI as Kubernetes API
Worker->>Kubectl: execute delete ConfigMap `kube-proxy` (kube-system)
Kubectl->>KubeAPI: DELETE configmap kube-proxy (kube-system)
Worker->>Kubectl: execute delete DaemonSet `kube-proxy` (kube-system)
Kubectl->>KubeAPI: DELETE daemonset kube-proxy (kube-system)
KubeAPI-->>Worker: return deletion results
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@services/kube-eleven/Dockerfile`:
- Around line 12-13: The Dockerfile currently downloads kubectl using the
KC_VERSION variable but does not verify its integrity; update the RUN step that
sets KC_VERSION and fetches kubectl to also download the corresponding
kubectl.sha256 (or kubectl.sha256sum) from dl.k8s.io, verify the binary with
sha256sum -c (or by computing sha256 and comparing) before marking it
executable, and fail the build if the checksum check fails; reference the
KC_VERSION variable and the kubectl binary name so the verification uses the
exact downloaded artifact and apply the same pattern to the other Dockerfiles
(services/testing-framework/Dockerfile, services/kuber/Dockerfile,
services/manager/Dockerfile).
In
`@services/kube-eleven/internal/worker/service/task_reconcile_infrastructure.go`:
- Line 37: The call to removeKubeProxy is executing on every update; wrap the
removeKubeProxy(logger, k8s.ClusterInfo.Id(), k8s.Kubeconfig) invocation inside
the same upgrade-only predicate used elsewhere in this reconcile (i.e., only
when an upgrade is requested or desired version changes) so it runs only during
upgrade reconciles; locate the existing upgrade check in
task_reconcile_infrastructure.go (the predicate that detects an upgrade) and
move or guard the removeKubeProxy call with that condition.
- Around line 93-105: The current loop in task_reconcile_infrastructure.go
treats any error from KubectlDeleteResource as "kube-proxy not deployed"; change
this to inspect each returned error from KubectlDeleteResource for the specific
"not found" case (or translate it into an IsNotFound/kube resource-not-exist
check) and only ignore those, while logging and returning non-NotFound errors
(including auth/RBAC/connectivity) with their details; update the anyerror logic
(and the surrounding function that calls KubectlDeleteResource) to aggregate or
fail fast on real errors instead of collapsing them into the generic
logger.Error message so the code logs the specific error and halts/propagates
appropriately.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 68149b4b-ba7a-4217-a56a-4c6142b82e97
📒 Files selected for processing (2)
services/kube-eleven/Dockerfileservices/kube-eleven/internal/worker/service/task_reconcile_infrastructure.go
Add kube-proxy removal for clusters that will upgrade from v0.12.x to the next release with ebpf cilium
Summary by CodeRabbit
New Features
Chores