/policy-governance-skills:fairwinds-polaris-and-goldilocksfrom policy-governance-skills
Validates Kubernetes workload configs with Polaris (resource limits, security context, health checks) and generates right-sizing recommendations via Goldilocks VPA.
Ships in policy-governance-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Not every Kubernetes configuration problem needs a custom-authored policy
engine. Fairwinds Polaris ships a curated, opinionated set of
best-practice checks (resource requests/limits set, security context
hardened, liveness/readiness probes present, image tags not latest,
no host network/PID namespace, etc.) as a ready-made scoring tool and
optional admission webhook — no Rego or YAML rule-authoring required to
get useful coverage on day one. Fairwinds Goldilocks solves an
adjacent but different problem: it runs a Vertical Pod Autoscaler (VPA)
in recommendation mode (never auto-applying changes) per namespace and
surfaces a dashboard of suggested CPU/memory requests based on observed
usage, so teams can right-size workloads instead of guessing at limits or
copy-pasting defaults. Together they cover "is this workload configured
according to baseline best practice" (Polaris) and "are this workload's
resource requests/limits actually sized correctly for what it uses"
(Goldilocks) — both lower-effort, narrower-scope tools than standing up
OPA/Gatekeeper or Kyverno from scratch, and a reasonable first step before
investing in custom policy authoring for gaps neither tool covers.
vertical-pod-autoscaler from the
kubernetes/autoscaler project) — Goldilocks is a UI/controller layer
on top of VPA's recommender component, not a replacement for it.
Install VPA in recommendation-only mode; do not enable VPA's
auto-update mode as a side effect of installing Goldilocks, since that
would let VPA evict and resize pods automatically rather than merely
recommend.fairwinds-stable
repo) — check chart version compatibility notes since Polaris's default
check set and severity levels have changed across major versions.Run a one-off Polaris scan against a live cluster or local manifests to get a baseline score before installing anything persistent:
polaris audit --format=pretty
# or against local YAML without a cluster:
polaris audit --audit-path ./k8s-manifests/ --format=json > polaris-report.json
Review the score and per-check breakdown — Polaris groups checks
into categories (Security, Reliability, Efficiency) and each
check into danger, warning, or pass. Prioritize danger-level
findings first (e.g. privileged containers, missing memory limits
that risk OOM-killing the node) over warning-level style issues.
Customize the check set with a config file — Polaris ships broad defaults, but every organization should tune severities and exclusions rather than accepting the defaults uncritically:
# polaris-config.yaml
checks:
cpuRequestsMissing: warning
memoryRequestsMissing: danger
memoryLimitsMissing: danger
readinessProbeMissing: warning
livenessProbeMissing: warning
runAsRootAllowed: danger
notReadOnlyRootFilesystem: warning
tagNotSpecified: danger
hostNetworkSet: danger
exemptions:
- controllerNames:
- legacy-batch-job
rules:
- readinessProbeMissing # batch job has no HTTP endpoint to probe
polaris audit --config polaris-config.yaml --format=pretty
Install the in-cluster dashboard for ongoing visibility rather than only ad hoc CLI runs:
helm repo add fairwinds-stable https://charts.fairwinds.com/stable
helm install polaris fairwinds-stable/polaris \
--namespace polaris --create-namespace \
-f polaris-config.yaml
Only after reviewing dashboard results, consider enabling the admission webhook to block new non-compliant workloads — start with it disabled/warn-only:
# values.yaml for the polaris helm chart
webhook:
enable: true
config:
checks:
memoryLimitsMissing: danger
Warning — destructive action risk: enabling Polaris's admission webhook with checks set to
dangerblocks matching create/update requests cluster-wide for every workload that fails, the same way a GatekeeperdenyConstraint does. Review the CLI/dashboard report for a full deploy cycle first, and confirm a rollback path (helm upgrade polaris --set webhook.enable=false, or deleting the webhook configuration) before enabling it against a production cluster.
Install VPA, then Goldilocks, for right-sizing — Goldilocks needs VPA's recommender already running:
# VPA (recommender only — do not enable the updater/admission components
# unless auto-resizing is explicitly wanted)
kubectl apply -f https://github.com/kubernetes/autoscaler/releases/latest/download/vpa-recommender.yaml
helm install goldilocks fairwinds-stable/goldilocks --namespace goldilocks --create-namespace
Opt namespaces in explicitly — Goldilocks only generates recommendations for labeled namespaces, so nothing is auto-enrolled:
kubectl label namespace payments goldilocks.fairwinds.com/enabled=true
Read recommendations from the dashboard or CLI, and treat them as
a starting point for a manual change, not an auto-applied resize —
Goldilocks' underlying VPA objects are created in updateMode: "Off"
(recommend-only) so nothing changes without a human editing the
Deployment/StatefulSet:
kubectl get vpa -n payments
kubectl describe vpa payments-api -n payments
Apply the recommended values manually (or via a reviewed PR to the manifest/Helm values), then re-check with Polaris to confirm the resource-limit checks now pass:
resources:
requests:
cpu: 150m # from Goldilocks target recommendation
memory: 256Mi
limits:
memory: 512Mi
Re-run both tools periodically (weekly dashboard review is reasonable) since usage patterns and best-practice adherence drift as workloads change — this isn't a one-time audit.
readinessProbeMissing forever unless exempted, and
an unreviewed default config trains teams to ignore the dashboard.Auto/Recreate update mode
as a shortcut to "automatic" right-sizing — that lets VPA evict and
restart pods with new resource values without a human review step,
which is a meaningfully different (and riskier) blast radius than the
recommend-only mode this skill assumes.Symptom: The Polaris admission webhook is enabled with default
severities and immediately blocks deploys for workloads that
legitimately don't need a readiness probe (e.g. CronJobs, batch Jobs),
causing an unplanned incident.
Fix: Run Polaris in CLI/dashboard-only (report) mode first, add
exemptions for controller types/names that legitimately fail specific
checks, and only enable the webhook once the exemption list reflects
real cluster workloads — the same audit-first discipline used for
Gatekeeper/Kyverno enforcement.
Symptom: A team installs Goldilocks, sees VPA objects appear, and
assumes resource requests/limits are now being adjusted automatically —
then is confused when nothing changes on its own.
Fix: Confirm the VPA updateMode is "Off" (Goldilocks' default) —
this is intentional; Goldilocks only recommends. Values must be applied
manually to the workload's own manifest/Helm values, then verified with
kubectl describe vpa and a follow-up Polaris scan.
Symptom: A workload is resized to Goldilocks' exact recommended CPU request, and shortly after starts getting CPU-throttled during a daily batch spike that wasn't represented in the VPA's observation window. Fix: Goldilocks/VPA recommendations reflect historical usage over their configured window — for workloads with known periodic spikes, pad the recommendation or size for the p95/p99 usage rather than the mean, and validate post-change behavior (throttling metrics, OOMKills) rather than trusting the recommendation as final.
Symptom: Polaris score looks good (high percentage), but the team still gets paged for issues the score gave no visibility into (e.g. an internal-only compliance rule about required annotations). Fix: Polaris's check set is a curated, generic best-practices list — it is not a substitute for organization-specific policy. Use opa-gatekeeper-policy-authoring or kyverno-policy-management to add custom checks for anything specific to your org that Polaris doesn't cover, rather than treating a good Polaris score as full policy coverage.
Symptom: Goldilocks is labeled onto every namespace cluster-wide on day one, producing hundreds of recommendation deltas that nobody reviews, and the dashboard becomes noise nobody looks at. Fix: Opt namespaces in incrementally (a few teams/services first), establish a review cadence (e.g. one namespace batch per sprint), and only expand coverage as teams demonstrate they're actually acting on recommendations.
A platform team wants a fast baseline audit before investing in custom Kyverno policies, plus right-sizing data for one overprovisioned service.
polaris-config.yaml:
checks:
cpuRequestsMissing: warning
memoryRequestsMissing: danger
memoryLimitsMissing: danger
readinessProbeMissing: warning
livenessProbeMissing: warning
runAsRootAllowed: danger
tagNotSpecified: danger
exemptions:
- controllerNames:
- nightly-report-job
rules:
- readinessProbeMissing
- livenessProbeMissing
CLI scan in CI (report-only, non-blocking initially):
polaris audit --audit-path ./k8s/ --config polaris-config.yaml --format=json \
> polaris-report.json
python3 -c "
import json, sys
r = json.load(open('polaris-report.json'))
score = r['ClusterInfo'].get('Version', 'n/a')
print('Polaris scan complete — see polaris-report.json for full detail')
"
Sample finding surfaced against a Deployment missing memory limits:
danger Deployment/payments-api memoryLimitsMissing
Memory limits should be set (container "api")
Fix applied to the manifest:
resources:
requests:
memory: 256Mi
limits:
memory: 512Mi
Separately, Goldilocks is enabled for the same namespace to get an evidence-based value instead of a guessed one:
kubectl label namespace payments goldilocks.fairwinds.com/enabled=true
kubectl get vpa payments-api -n payments -o jsonpath='{.status.recommendation}'
Output shows a target recommendation of cpu: 120m, memory: 340Mi based
on two weeks of observed usage — noticeably lower than the
previously-guessed cpu: 500m, memory: 1Gi the team had copy-pasted from
another service. The team updates the manifest to the recommended values,
re-runs polaris audit, and confirms memoryLimitsMissing and
cpuRequestsMissing both now pass.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin policy-governance-skills3 skills in this plugin
/kyverno-policy-managementGuides writing Kyverno ClusterPolicy/Policy resources using its YAML-native validate/mutate/generate rule syntax — a Rego-free alternative to OPA/Gatekeeper for Kubernetes admission control — plus audit-vs-enforce rollout and PolicyReport-based reporting. Use when the user asks to "write a Kyverno policy", "mutate resources on admission to inject a sidecar or default", "auto-generate a NetworkPolicy or ResourceQuota per namespace", "should we use Kyverno or OPA/Gatekeeper", or "why is my Kyverno validate rule not blocking/passing as expected".
/opa-gatekeeper-policy-authoringGuides authoring Rego ConstraintTemplates and Constraints for OPA Gatekeeper on Kubernetes — admission webhook enforcement, parameterized policies, dry-run/audit mode before switching to deny, and debugging Rego that under- or over-matches. Use when the user asks to "write a Gatekeeper ConstraintTemplate", "write a Rego policy for Kubernetes admission", "block pods that violate our security baseline with OPA", "add a Constraint with parameters", "why isn't my Gatekeeper policy denying anything", or "should we use OPA/Gatekeeper or Kyverno for cluster policy".
Other plugins' skills for the same job