RolloutPolicy CRD Reference

Complete field reference for the RolloutPolicy custom resource (API version kubestead.io/v1alpha1).

Full schema example

rolloutpolicy-full.yaml
apiVersion: kubestead.io/v1alpha1
kind: RolloutPolicy
metadata:
  name: my-service-canary
  namespace: production
spec:
  targetDeployment: my-service
  metricSource:
    prometheus:
      url: http://prometheus.monitoring:9090
      tlsSkipVerify: false
  steps:
    - trafficPercent: 5
      soakMinutes: 5
      gate:
        query: rate(http_errors{job="my-service"}[2m])
        threshold: 0.01
        comparison: lessThan
    - trafficPercent: 25
      soakMinutes: 10
    - trafficPercent: 100
  onFailure:
    action: rollback
    retainCanaryPodMinutes: 10
    notify:
      slack: "#deploy-failures"
      pagerduty:
        integrationKey: "{{ secrets.PD_KEY }}"
  onSuccess:
    notify:
      slack: "#deploys"

Steps

FieldTypeRequiredDescription
trafficPercentintegeryesPercentage of traffic routed to canary pods at this step (0-100).
soakMinutesintegernoMinutes to wait after reaching target traffic before evaluating the gate. Default: 5.
gate.querystringnoPromQL, Datadog query string, or NRQL query evaluated against the current metric source.
gate.thresholdfloatno (if query set)Numeric threshold. If the query result exceeds this (or falls below, depending on comparison), the step fails.
gate.comparisonenumnolessThan (default) or greaterThan.

Metric sources

Configure exactly one metric source per policy. Available sources:

SourceKeyPlans
PrometheusmetricSource.prometheusAll
DatadogmetricSource.datadogAll
Grafana MimirmetricSource.mimirTeam, Platform
VictoriaMetricsmetricSource.victoriaTeam, Platform
New RelicmetricSource.newrelicTeam, Platform
InfluxDBmetricSource.influxTeam, Platform

Notifications

Both onFailure.notify and onSuccess.notify accept the same configuration block:

FieldDescription
slackChannel name (e.g. #deploys-alerts). Requires Slack app configured in workspace settings.
pagerduty.integrationKeyPagerDuty Events API v2 routing key. Use {{ secrets.KEY_NAME }} to reference Kubestead secrets store.
opsgenie.apiKeyOpsGenie REST API key.
webhook.urlGeneric HTTPS webhook URL. Payload is JSON with event, deployment, rolloutPolicy, and metrics fields.

RBAC (Platform plan)

Platform plan teams can restrict who can create, update, or delete RolloutPolicy objects. See the security page for an overview of the RBAC model.