Docsright arrowBlackbirdright arrowCreating Deployment Instances with Blackbird

3 min • read

Creating Deployment Instances with Blackbird

The API Deployment Feature is a robust solution aimed at enhancing the development and quality assurance processes by providing a dedicated non-production environment. This feature enables teams to test, validate, and collaborate on APIs without affecting the production environment. Prerequisite includes having an API in your organization’s catalog.

Note: You must install Docker to use deployment commands with Blackbird. For more information, see Get Docker.

Create a new Deployment

To create a new deployment, run the deployment create command with your Dockerfile and context provided as arguments. If you have an existing Mock associated with a given name, you'll be prompted to delete it before proceeding.

Note: At this time deployments can only accept traffic on port 80. Due to this limitation, your application must listen on this port.

Update an existing Deployment

To update an existing deployment, run the deployment update command with your Dockerfile and context provided as arguments.

Delete a Deployment

To delete a running deployment, you can run the deployment delete command to remove it.

Deployment Status

To check the status of a running deployment, you can run the deployment status command.

Deployment Status with Application Logs

To check the status of a running deployment and see the application logs, you can run the deployment status command with the logs argument.

List Deployments

To list the running deployments, you can run the list command with the live deployment argument.

Secure a Deployment

By default the deployment endpoints are available to the public. In order to secure these endpoints we can use APIKeys. We can also create and set an APIKey on creation with the --apikey-header flag.

Limitations

Containers running as root

Images used for deployments can't run as root. You can use the root user to configure the image, but switch to another user before the end of the Dockerfile.

For example:

Server should listen on port 80

Currently, traffic to a deployments is sent to its container on port 80.

Troubleshooting

Deployment state never changes to 'ready'

The following are some reasons why a deployment may not become ready:

  1. Image is running as root. Switch to a non-root user anywhere in your Dockerfile.

  2. When the container starts there is no process running, or it runs and exits.

    Make sure that you defined an ENTRYPOINT in the Dockerfile.

    If the container has one, you can use the deployment logs to get your application's output:

Error upstream connect error or disconnect/reset before headers. reset reason: connection failure, transport failure reason: delayed connect error: 111 when connecting to a deployment.

This could be caused by the container listening on the wrong port. Make sure that your application listens on port 80.