feat(autoscaler): auto-detect Bottlerocket and set super_t - #393
Conversation
…caler Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Ben <ben@armosec.io>
Signed-off-by: Ben <ben@armosec.io>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughChangesThe node-agent autoscaler now detects Bottlerocket nodes per node group and selects Bottlerocket SELinux autoscaler
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant NodeGrouper
participant TemplateRenderer
participant HelmTemplate
participant DaemonSet
NodeGrouper->>TemplateRenderer: provide Bottlerocket group flag
TemplateRenderer->>TemplateRenderer: choose super_t or spc_t
TemplateRenderer->>HelmTemplate: pass SELinuxType
HelmTemplate->>DaemonSet: render SELinux options
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
Summary:
|
Summary
Makes the node-agent autoscaler auto-detect AWS Bottlerocket nodes and render those node groups' DaemonSets with
seLinuxOptions.type: super_tautomatically, so customers on Bottlerocket no longer need--set nodeAgent.seLinuxType=super_t. Bottlerocket's strict SELinux policy makes the defaultspc_ttype crash-loop the eBPF node-agent;super_tgrants the required privileges.Changes
nodeagentautoscaler/nodegrouper.go: newNodeGroup.HasBottlerocket, case-insensitivebottlerocketmatch onnode.Status.NodeInfo.OSImage, OR-ed across a group's nodes; gated by config.nodeagentautoscaler/templaterenderer.go:TemplateData.SELinuxType=super_tfor Bottlerocket groups else configured default; threaded throughNewTemplateRenderer.config/config.go: newnodeAgentAutoscaler.seLinuxType(defaultspc_t) andnodeAgentAutoscaler.bottlerocketAutoDetect(opt-out, defaulttrue).nodeagentautoscaler/integration_test.go,docs/node-agent-autoscaler.md: integration coverage + docs.Scope: autoscaler install path only. Standard single-DaemonSet and
multipleDaemonSetsinstalls are unchanged. Companion chart PR: kubescape/helm-chartsfeature/bottlerocket-autoscaler-selinux. Ship this operator image with/before the chart bump (old operator + new template would leave a literal{{ .SELinuxType }}; reverse is a safe fallback).Testing
go test ./config/ ./nodeagentautoscaler/→ pass (72 tests).go test -tags=integration ./nodeagentautoscaler/→ pass (renders the real Helm template, asserts super_t vs spc_t).go vet ./...andgo test -race ./nodeagentautoscaler/→ clean.Docs
docs/node-agent-autoscaler.md— new "AWS Bottlerocket auto-detection" section (in this PR).AI Review
Local AI review: subagent-driven-development per-task reviews + final whole-branch review (
claude-opus) — clean, no Critical/Important findings; cross-repo contract verified end-to-end.Scope: full diff (operator changed Go files).
AI Context
AI-skills: notify-me,superpowers:brainstorming,superpowers:writing-plans,superpowers:subagent-driven-development,superpowers:finishing-a-development-branch
Summary by CodeRabbit
New Features
super_tSELinux setting automatically.Documentation