Deployments and logs
Every deploy creates a deployment. The service's Deployments tab lists the latest 50, and the Logs tab shows what the running service writes.
What starts a deployment
- Creating a service
- The Deploy button on the service
- Redeploy on an earlier deployment
- A call to the service's deploy hook
- An automatic rollback after a failed database deployment
Saving Settings or Environment variables doesn't deploy. Click Deploy to apply your changes. Domains apply right away without a deployment.
Statuses
| Status | Meaning |
|---|---|
| Queued | Waiting for the service's running deployment to finish |
| Building | Harblet clones and builds the repository. Git services only. |
| Deploying | The new version is starting |
| Deployed | The new version runs and gets the traffic. The newest one is marked Current. |
| Failed | Something went wrong. Image and Git services keep running the version before it. Databases go back to it. |
| Cancelled | Cancelled by you, or replaced by a newer queued deployment |
A service runs one deployment at a time. A new deployment waits as Queued while another one builds or deploys. If a deployment is already queued, the newer one replaces it, so several deploys in a row end on the newest.
Follow a deployment
Click a deployment to open it. The newest one opens by itself while it runs or when it failed.
- Build shows the output of the build, for Git services.
- Deploy shows what Kubernetes reports while the new version starts, one event per line in UTC. A successful deployment ends with "Ready: The new version is running." For image services and databases, the events show without a heading.
- A failed deployment shows the reason above the output.
The Started by column shows who started it: a member, Deploy hook, or Rollback for automatic database rollbacks. Source shows the commit for Git services, or the image and its digest for image services.
The Overview page in the sidebar shows the ten newest deployments across all projects, plus an alert for every service whose latest deployment failed.
Health checks
A new deployment gets traffic only once it's healthy. Without a port, Harblet starts the new version without a check.
- With a port, Harblet waits until the port accepts connections.
- With a health check path, Harblet waits until the path answers with a 2xx or 3xx status within one second. Set it under Settings → Health check path, for example
/health. A health check path needs a port.
Once the check passes, the new version gets traffic alongside the old one. After it has stayed healthy for 10 seconds, the old version stops.
Harblet keeps checking every 10 seconds after the deployment. While the check fails, the service gets no traffic and visitors get an error until it passes again. Harblet doesn't restart a service because its check fails, only when it crashes.
When a deployment fails
A deployment fails when:
- the build fails,
- the image can't be pulled, or its name is invalid,
- the container keeps crashing,
- the service doesn't become healthy within 5 minutes.
The deployment then shows the reason, usually Kubernetes' own message. For image and Git services, the version before it keeps running and keeps the traffic. For databases, Harblet deploys the version that ran before.
To find out why a container crashes, open the Logs tab. It shows the output of the new version, also while the old one still serves traffic.
Cancel a deployment
Open the ⋮ menu of a queued deployment or of a running build and click Cancel. Once a deployment is Deploying, it can't be cancelled.
Redeploy an earlier deployment
Open the ⋮ menu of an earlier deployment and click Redeploy to go back to it. Harblet deploys the same image again, without a new build, with the deployment's port, health check and environment variables from back then.
- Redeploy is offered for deployments that produced an image.
- For Git services, Harblet keeps the images of the last five builds. Older builds may fail to redeploy.
- To go back to your current settings afterwards, click Deploy.
Live logs
The Logs tab streams the output of the service's newest instance. It starts with the last 500 lines and follows new output as it arrives.
- Filter logs narrows the lines to those that contain your text.
- The badge shows whether the instance is Running, Starting or Crashed, or why it's waiting, such as
ImagePullBackOff. Next to it, Harblet shows how often the instance restarted. - After a crash, the tab shows the output of the crashed run under "Output of the last crashed run".
- After a deploy, the tab switches to the new instance within a few seconds.
Harblet doesn't store live logs. For long-term logs, send them from your app to an external logging service.