Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Examples

Working examples for Attune, from a single policy to full production setups. Standalone .yaml files can be applied directly from the repo root with kubectl apply -f examples/<file>.yaml, while directory-based scenarios include their own instructions and may use kubectl apply -k.

Quick-start files

File Scenario Mode
01-getting-started.yaml Minimal policy for a single Deployment Recommend
02-canary-rollout.yaml Graduated 10% canary with auto-revert Canary
03-auto-mode.yaml Fully automated for trusted workloads Auto
04-hpa-coexistence.yaml Right-sizing alongside a HorizontalPodAutoscaler Recommend
05-cluster-defaults.yaml Cluster Prometheus address, no token Recommend
06-multi-workload-selector.yaml Label selector targeting many Deployments Recommend
07-sidecar-exclusion.yaml Skip service mesh sidecars with excludedContainers Recommend

Start with 01-getting-started.yaml to see recommendations without touching any pods. Promote to 02-canary-rollout.yaml once you trust the numbers. If you want shared Prometheus settings, continue with 05-cluster-defaults.yaml for cluster-wide defaults or 11-namespace-defaults.yaml for a namespace-only setup.

Advanced scenario files

File Scenario Mode
08-observe-mode.yaml Validate Prometheus connectivity before generating recommendations Observe
09-oneshot-mode.yaml Resize one pod per reconcile cycle for cautious rollout OneShot
10-cronjob-policy.yaml Recommend-only sizing for CronJobs and Jobs Recommend
11-namespace-defaults.yaml Namespace-scoped defaults layered over cluster defaults Mixed
12-scheduled-auto-mode.yaml Auto mode limited to maintenance windows with per-cycle budgets Auto
13-multi-datasource.yaml Mimir, Thanos, per-policy bearer token, and TLS Recommend
14-startup-boost.yaml Temporary CPU boost for cold-start workloads (JVMs, ML models) Auto

Composite scenarios

These directories contain complete, multi-resource setups that mirror real-world deployments:

Directory What it shows
multi-namespace/ Dev/staging/prod policies with Kustomize overlays, different aggressiveness per environment. Shared Prometheus address, no token
full-stack/ Everything needed for one app: namespace, Deployment, ServiceMonitor, AttuneDefaults, AttunePolicy, and Grafana dashboard ConfigMap. Prometheus address, no token
prometheus-auth/ Per-namespace token, one operator identity, and a namespace exception

Prerequisites

All examples assume:

  • Kubernetes 1.32+ (1.32 requires the InPlacePodVerticalScaling feature gate; 1.33–1.34 beta enabled by default; 1.35+ GA)
  • Prometheus reachable inside the cluster. The manifests here use an address and no token. Authenticated Prometheus is prometheus-auth/.
  • Attune operator installed:
helm install attune oci://ghcr.io/attune-io/charts/attune \
  --namespace attune-system --create-namespace

kubectl plugin (optional)

The operator works without any kubectl plugin. You can inspect policies with standard commands:

kubectl get attunepolicy -A
kubectl describe attunepolicy <name> -n <namespace>

For a richer experience, install the optional kubectl attune plugin:

# Via Krew (recommended)
kubectl krew install attune

# Or download from GitHub Releases
# https://github.com/attune-io/attune/releases

The plugin adds commands like kubectl attune status, kubectl attune recommendations, kubectl attune doctor, and kubectl attune explain. Some examples reference these commands, but they always show the standard kubectl equivalent first.