RailsApp::Entrypoints
Inherits YAML::Serializable / JSON::Serializable / Kubernetes::Serializable / Struct / Value / Object
The entrypoints for your application — each type of process
you run, such as a Rails server and Sidekiq, is a separate
entrypoint. This is similar to entries in a Procfile.
Constructors
Instance methods
Optional override for the command to run to run this entrypoint if it differs from the CMD directive in your container image. For example, to run Sidekiq:
command: [bundle, exec, sidekiq]
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.
The domain your app should be accessible on. This will provision Ingress and Certificate resources so that this entrypoint will be reachable via the public internet. Without this property or domains, it will only be accessible via plaintext inside the cluster.
If domain and domains are both provided, domains takes precedence.
The domains your app should be accessible on. This will provision Ingress and Certificate resources so that this entrypoint will be reachable via the public internet. Without this property or domain, it will only be accessible via plaintext inside the cluster.
If domain and domains are both provided, domains takes precedence.
A list of Env objects representing environment variables.
Either a value or value_from (in YAML: valueFrom)
must be provided.
env:
- name: REDIS_URL
value: redis://redis
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: "postgres-app"
value: "uri"
The source of an environment variable, such as a ConfigMap or Secret.
HTTP health checks to ensure 2 things:
- New pods must pass these health checks before old pods are terminated
- Pods will be checked on the
run_everyinterval to make sure it's still alive. If it failsfailure_thresholdtimes, the pod will be restarted. If it continues to fail, it will enter aCrashLoopBackOffstate.
Optional override for the container image for this entrypoint if it differs from the rest of your app. This is useful when you want to deploy something to support your app, such as a Prometheus exporter.
Properties to assign to any Ingress that gets created for this entrypoint.
The name of your entrypoint, such as web or worker
A Hash(String, String) containing label/value pairs —
pods for this RailsApp or Entrypoints will only be assigned
to nodes that have these labels. For example, if you set
kubernetes.io/arch: arm64 here, pods will only be assigned
to nodes running Arm64 processors.
The path matcher for the Ingress resource, defaults to "/". All incoming requests from outside the cluster with this entrypoint's domain and path will be routed to this entrypoint.
Defines the way the path is matched, defaulting to Prefix.
Prefixmatches any request path that starts withpathExactmatches only that exact pathImplementationSpecificdepends on the KubernetesIngressClass. This operator usesnginxas theIngressClass, whichImplementationSpecifichere.
entrypoints:
- name: web
domain: example.com
path: /
The port your entrypoint will be listening on. This will provision a Service resource so the entrypoint will be reachable from inside the Kubernetes cluster.
The number of pods to run for this entrypoint, defaulting to 1.
The resources you want to allocate for each pod and/or limit each pod to.
Use the given Kubernetes ServiceAccount to run pods for this app. This is extremely rare to need to set, so if you don't know what to set here, you almost certainly want to leave it blank.