Web Applications
Main
The Main
tab is where the most common configuration options are set.
Container Settings
Start Command
The start command is the start command of the Docker container that is run for each application instance. If a start command is not set, the default start command of the Docker container is run.
It is best to avoid special characters or quotation marks in this start command, since these may not be escaped properly when the container is started.
Container Port
The port that your application exposes for receiving traffic.
Deploy Webhook
Auto-deploy when webhook is called
This option allows you to expose a webhook for your application which can update the container image that’s running. This is useful for programmatically redeploying a Docker image from an automated script.
Network Settings
Expose to external traffic
Selecting this option will create a public endpoint for your application. If this option is selected but a custom domain is not specified, the application will use a Porter domain.
Configure Custom Domain
Selecting this option will expand a section that allows you to configure a set of custom domains for your application. See the docs on custom domains for more information.
Enable TLS and automatically create certificates
This option should be selected if you would like Porter to manage certificates and SSL for your domains. When this is selected, the application will listen on both ports 80 and 443, and will redirect to HTTPS by default. When this option is not selected, the application will only listen on port 80. This is useful when the certificate is served by some other mechanism, like Cloudflare or AWS NLB.
Resources
RAM
The RAM
value is the amount of memory to assign your application, given in mebibytes (Mi). A mebibyte is roughly equivalent to 1.05 megabytes, so it allocates slightly more memory than a megabyte. For example if you are migrating from a service where 2 GB is used, 2000Mi
should be more than sufficient.
When your application exceeds its permitted RAM
, it is killed.
CPU
The CPU
value is the amount of CPU to assign your application, given in millicores. A millicore is 1/1000 of a CPU. Thus, to assign your application an entire CPU, set this value to 1000m
.
When your application exceeds its permitted CPU
, it may be throttled depending on other workloads running on the machine.
Autoscaling
You can enable autoscaling based the amount of CPU and RAM that your application uses:
- Minimum replicas — the minimum number of instances of your application to run.
- Maximum replicas — the maximum number of instances of your application to run.
- Target CPU Utilization — the threshold of CPU usage that your application needs to consume before it is autoscaled. For example, if you allocate 2 CPU (
2000m
) to your application and 1 instance is running, autoscaling will be triggered once your application reaches 1 CPU. - Target RAM Utilization — the threshold of RAM usage that your application needs to consume before it is autoscaled. For example, if you allocate 2000 Mi to your application and 1 instance is running, autoscaling will be triggered once your application reaches 1000 Mi.
Depending on cluster size, autoscaling rules are evaluated every 15-30 seconds, with new replicas spawned as necessary. If the current resource utilization is within a small window of the threshold, replicas will not be spawned to avoid issues where the autoscaler scales up and down rapidly as the current values change in response to scaling events. If your cluster has no available capacity on existing nodes and has not hit the maximum number of nodes, the cluster will scale up or down to fit resource utilization.
Environment
In this section, you can set environment variables for your application. You can input these directly, load them from an environment group, or copy them from a file that uses .env
formatting.
Advanced
Ingress Custom Annotations
The ingress custom annotations overwrite the default annotations that Porter adds to the ingress. The following annotations are added by default:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/proxy-body-size: 50m
nginx.ingress.kubernetes.io/proxy-send-timeout: "60"
nginx.ingress.kubernetes.io/proxy-read-timeout: "60"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "60"
cert-manager.io/cluster-issuer: letsencrypt-prod
Custom Health Checks
Custom health checks are endpoints that indicate if an application is healthy and ready to receive traffic. These are documented in detail in the Zero-Downtime Deployments guide.
Persistent Disks
Persistent disks mount a persistent filesystem into your application instance that can retain data across releases:
- Persistent Storage — the amount of storage allocated to this filesystem, given in Gibibytes. One gibibyte is roughly equivalent to 1.075 gigabytes.
- Mount Path — the absolute path within your Docker container to mount this filesystem. Note that setting this to an existing directory that your application uses can lead to unexpected behavior, so it is usually better to set this mount path to a root-level directory such as
/mount
.
Termination Grace Period
The termination grace period is the number of seconds after SIGTERM
is sent before the application will be forcefully killed. This is documented in detail in the Zero-Downtime Deployments guide.
Container Hooks
Container hooks are commands that can be run in the application before starting or stopping the application.