Managing services

Once you have created a Kalix project, use the Kalix Console or the kalix CLI to deploy container images.

Kalix services are automatically fault-tolerant and highly available. When you deploy a service, Kalix creates multiple service instances. When the service load increases, Kalix automatically scales up by adding more instances, and when the load decreases, it automatically scales down.

Deploy

To deploy a service:

  1. Log in:

    CLI
    1. In a command or terminal window, if you haven’t authorized kalix, enter the following command:

      kalix auth login

      The Kalix Console opens in a browser window.

    2. If you are not logged into the Console, log in.

    3. Click Authorize.

      The kalix prompt confirms the successful authorization attempt.

    4. Set your project to be the current Kalix project:

      kalix config set project <project name>

      Subsequent commands apply to the current project, as defined with config set project. Alternatively you can append --project <project name> to work with service commands.

  2. Deploy:

    CLI

    Assuming a service name of my-service, enter the following:

    kalix service deploy \
        my-service \
        my-container-uri/container-name:tag-name

Verify service status

To verify the status of a service:

Console

From the Dashboard, the Services card displays the Status of all services in a project:

Services card
CLI

Use the following command:

kalix service list

A service status can be one of the following:

  • Ready: All service instances are up to date and fully available.

  • UpdateInProgress: Service is updating.

  • Unavailable: No service instances are available.

  • PartiallyReady: Some, but not all, service instances are available.

Update a deployed service

First, package and tag the changes to your service. When you redeploy, Kalix performs a rolling update.

To re-deploy:

CLI
  • Update the deployed my-service service with a new package tagged tag-name-2:

    kalix service deploy \
        my-service \
        my-container-uri/container-name:tag-name-2

Removing a deployed service

Remove a deployed service using the CLI delete command. The following example removes a deployed service, where my-service is the service name:

kalix service delete my-service