struct

RailsApp::Entrypoints::DeploymentStrategy

Inherits YAML::Serializable / JSON::Serializable / Kubernetes::Serializable / Struct / Value / Object

The strategy to use when updating this entrypoint, useful for slow canary rollouts.

When you need to deploy your app safely, it can be best to roll it out slowly over several minutes. If your first few pods fail health checks, the deployment will pause. You can then use kubectl rollout undo deployment in your deployment script to roll the deployment back.

How those health checks fail is specific to your app, but a useful pattern is for the pod to track the number of failures (for example, the number of HTTP 500s or exceptions raised in background jobs) as a percentage of all units of work since the pod started and, when that number exceeds some threshold (for example, 5%), return a failure response for the health check.

deployment_strategy:
  duration_minutes: 10
  surge: 5%
  max_unavailable: 0%

WARNING: This is an experimental property and is subject to change.

Constructors

new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
new(pull : JSON::PullParser)
new(*, __pull_for_json_serializable pull : JSON::PullParser)
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
new(*, duration_minutes : Int64 | Nil = nil, surge : Nil | String = nil, max_unavailable : Nil | String = nil)
Source

Instance methods

duration_minutes

How long a deployment should take in minutes.

max_unavailable
surge

The number or percentage of pods to roll out at a time.