Services /

Deployment Services

Deployment services allow you to deploy images from a Northflank Build service or an image hosted on an external registry. Check our supported registries.

They can be used in a Pipeline or linked to a Build service and form a key component of Continuous Integration and Deployment on Northflank.

Creating a Deployment Service

Deployment service creation varies depending on whether the image's source is Northflank or an external registry. You can always change your deployment source by editing your Deployment service later.

If the image exists in a private registry you need to enter the respective credentials.

To make the service available internally or publicly, you can choose to add ports right away, or you can do this after creating the service in the service's networking tab.

Creating a Deployment service with a Build service

Selecting Northflank as deployment source enables you to deploy your images from a Build service, linked via a Pipeline.

  1. Select your Project
  2. Choose Service from the Create new drop-down menu in the top right corner of the dashboard
  3. Select Deployment service type
  4. Enter a Service name and description. You must give each service in your project a unique name, this will be used to create your Northflank domain names.
  5. Select Northflank as the deployment source
  6. (Optional) Add ports and configure them
  7. Select a Plan with the appropriate resources
  8. Click Create service
Creating Deployment Service

Creating a Deployment service with an image from an external registry

  1. Select your Project
  2. Choose Service from the Create new drop-down menu in the top right corner of the dashboard
  3. Select Deployment service type
  4. Enter a Service name and description. You must give each service in your project a unique name, this will be used to create your Northflank domain names.
  5. Select External Image as the deployment source
  6. Choose your image's Registry Provider
  7. Enter the image path. Do not include the registry service's URL in the external image path, for example: docker.io/nginxinc/nginx-unprivileged:latest should be entered as nginxinc/nginx-unprivileged:latest.
Using a private image
If you want to use a private image from Docker toggle public image to private image. Some registries, such as Google Container Registry, always require you to enter Credentials in which case the field will display automatically.
Enter your Credentials in JSON format, referencing the registry service's full URL for the image location.
  1. Verify the location and credentials of the external image
  2. (Optional) Add ports and configure them
  3. Select a Plan with the appropriate resources
  4. Click Create service

Using a Deployment Service

There are two ways to use your Deployment service:

You can switch between the two at any point.

To use your Deployment service with a Northflank Build service you need to have a Pipeline set up. Read how to set up a Pipeline.

Using a Deployment service with a Build service

  1. Select your Project
  2. Select Services from the Project menu
  3. Select your Deployment service from the Services list
  4. Select link to Pipeline to add your Deployment service to a Pipeline. If you don't have any pipelines you'll be prompted to create one.
  5. Drag and drop your Deployment service into a stage on your pipeline (you can always change stage or remove this later)
  6. Select the Build service you want to deploy from the Pipeline menu
  7. Deploy a specific build from a branch or pull request, or link a branch or pull request to your Deployment service. If you link a branch or pull request the Deployment service will always use the latest successful build from that branch or pull request.

Using a Deployment service with an external registry

  1. Select your Project
  2. Select Services from the Project menu
  3. Select your Deployment service from the Services list
  4. Select Add external deployment
  5. Choose your image's Registry Provider
  6. Enter the Image Path. Do not include the registry service's URL in the external image path, for example: docker.io/nginxinc/nginx-unprivileged:latest should be entered as nginxinc/nginx-unprivileged:latest.
    • Using a private image
    1. If you want to use a private image from Docker toggle public image to private image. Some registries, such as Google Container Registry, always require you to enter Credentials in which case the field will display automatically.
    2. Enter your Credentials in JSON format, referencing the registry service's full URL for the image location (Learn more about Docker config
      )
  7. Verify the location and credentials of the external image
  8. Save and redeploy

Learn more about using Deployment services in a Pipeline.

Deployment Service Options

You can configure many aspects of your Deployment service. Most importantly, you can configure ports, scale instances, add or reduce resources, and change the image to deploy - which includes switching between an external and an internal source for the deployed image.

From the service header you can:

  • Redeploy, restarting all active instances
  • Scale the number of instances running, from 0 to 10
  • Pause the service, which automatically scales the service down to 0 instances

From the Deployment service dashboard tabs you can access the following:

Environment

Add, edit, or delete Environment variables and Docker credentials.

Networking

Configure ports and regenerate TLS certificates for your public ports.

Instances

View active and terminated instances. You can click on a specific instance to view its logs.

Scaling

Choose to make the service free or use a paid plan and select how many instances to deploy.

Billing

View the charges associated with the service and delete the service.

Delete service

You can delete the service from the billing page. Deleting a Deployment Service will unlink any associated Build Service and remove it from any Pipelines it is used in.

Changing Deployment Source

You can change between deploying an image from a Northflank Build service and an image hosted on an external registry at any time.

Converting a Deployment service to use a Build service

To link a Build service with a Deployment service you will need to add the Deployment service to a Pipeline.

If you don't have a Pipeline set up:

  1. Select your Project
  2. Choose Pipeline from the Create new drop-down menu in the top right corner of the dashboard
  3. Enter a name and description for the Pipeline

If you have a Pipeline:

  1. Select your Project
  2. Select Pipelines from the Project menu.
  3. Select the Pipeline to use the Deployment service in
  4. Drag and drop the Deployment service to a stage in the Pipeline
  5. Find the Build service you want to deploy from in the sidebar and click Deploy
  6. Choose to either link a branch or pull request with the Deployment service (to automatically deploy the latest commit), or deploy a specific build from a branch or pull request

Deploy or link to a build service

  1. If you've chosen to link a branch or pull request, click link service on the Deployment service you want to use, or click link to stage to link to all the Deployment services in a stage
  2. If you've chosen to deploy a specific build, select the build you want to use and click deploy to service on the Deployment service in the Pipeline; or deploy to stage to deploy to all the Deployment services in a stage

Converting a Deployment service to use an External Image

Please note this will remove the Deployment service from any Pipelines it is used in.

  1. Select your Project
  2. Select Services from the Project menu
  3. Select the Deployment service you want to convert from the Services list
  4. Click Switch to external image on the Deployment dashboard overview
  5. Choose your image's Registry Provider
  6. Enter the Image Path. Do not include the registry service's URL in the external image path, for example: docker.io/nginxinc/nginx-unprivileged:latest should be entered as nginxinc/nginx-unprivileged:latest.
Using a private image
If you want to use a private image from Docker toggle public image to private image. Some registries, such as Google Container Registry, always require you to enter Credentials in which case the field will display automatically.
Enter your Credentials in JSON format, referencing the registry service's full URL for the image location.
  1. Verify the location and credentials of the external image
  2. Save and redeploy

External Registries

You can deploy images hosted on an external Docker registry supported by Northflank.

To deploy an image from an external source, you need access to either a public image (for example nginxinc/nginx-unprivileged

), or a private image and its associated credentials.

Supported registries

Northflank supports the following container registries:

You can select a registry when you create or edit a Deployment service which is using an external source.

Public registries

To use a public image you only need to select the registry service and enter the external image's path.

Private registries

If your selected registry supports public and private images you can select which option you want to use with the toggle below the image path field. If your selected registry only supports private images, you will automatically be asked to enter your credentials.

Image path

You should enter the image path in the following format: [username]/[image]:[tag]. Do not include the registry service's URL in the external image path, for example: registry.io/nginxinc/nginx-unprivileged:latest should be entered as nginxinc/nginx-unprivileged:latest.

Credentials

To deploy a private docker image, input the credentials from your Docker config as a JSON object in the following format:

{
  "auths": {
    "[Full registry url]": {
      "auth": "[Your auth key]"
    }
  }
}

Make sure you refer to the correct URL to authenticate with a supported registry service.

Supported RegistryAuthentication URLCredentials guide
DockerHubhttps://index.docker.io/v1/DockerHub: managing access tokens
(EU) Google Container Registryhttps://eu.gcr.io/Google Container Registry: Authentication methods: access tokens
(US) Google Container Registryhttps://us.gcr.io/Google Container Registry: Authentication methods: access tokens
GitLabOnly available on self-managed GitLab instancesGitLab: Personal access tokens
GitHubhttps://docker.pkg.github.comGitHub: Creating a personal access token

© 2020 Northflank Ltd. All rights reserved.

TermsPrivacy

contact@northflank.com