struct RailsApp::Entrypoints::DeploymentStrategy

Overview

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.

Included Modules

Defined in:

rails_app_operator.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

def self.new(pull : JSON::PullParser) #

def self.new(*, duration_minutes : Int64 | Nil = nil, surge : Nil | String = nil, max_unavailable : Nil | String = nil) #

[View source]

Instance Method Detail

def duration_minutes : Int64 | Nil #

How long a deployment should take in minutes.


def max_unavailable : String | Nil #

def surge : String | Nil #

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