This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Deployer

Render and deploy Helm charts through simple target descriptions

What is Deployer?

Deployer streamlines Kubernetes resource deployment for developers by providing a straightforward toolset. It empowers developers to deploy specific subsets of services seamlessly within the inner development loop. Key features of Deployer include:

  1. Swift deployment of Helm Charts in Kubernetes environments.
  2. Precise control over Kubernetes resource deployment.
  3. Flexible management of Helm sub-charts during deployment.

Leveraging Deployer optimizes the inner development loop, resulting in quicker and more efficient deployment of Kubernetes resources.

1 - How to Deploy Services

Learn how to use Deployer to deploy selected subsets of services within the inner development loop, including enabling the optional Hot Code Reload feature.

Deployer gives you a toolset for deploying Kubernetes resources. You can get started by following these three steps:

  1. Create a deployment target description.
  2. Bring up the target.
  3. Manage your deployment.

Prerequisites

Before using Deployer, you must install the Terminal Client on your machine and set up a Kubernetes cluster you want to deploy to using Skyramp.

1. Create a Deployment Target Description

  1. Create a folder called targets at the root of your microservice repository. This folder will store your target description files.
  2. Inside the targets folder, create a target description file (e.g. helm-demo.yaml) to describe the target you want to deploy.
  3. Customize the target description file to match your deployment needs.

Example:

namespace: helm-namespace
containers:
  - type: helm
    releaseName: my-release
    path: charts/test1
    valuesPath: files/values.yaml
    values:
      server:
        enabled: true
        service:
          port: 10000
      service:
        port: 5000
        type: ClusterIP
    includes:
      - Deployment/my-release-test1 
      - Job/* # include all jobs
      - server/* # include subchart server with all subresources

Modify the values according to your specific deployment requirements. The target description file includes:

  • The namespace field, which defines the target Kubernetes namespace.
  • The containers section, where you configure the deployment settings, including the release name (releaseName), the path to your Helm charts (path), an optional values file path (valuesPath), and additional values to override (values).
  • The includes field (alternatively, excludes), which specifies the resources to include in the deployment. You can specify specific resources or use the * wildcard to include matching resources.

Learn more about what you can configure in your target description in Target Description ».

Enable Debugging with Hot Code Reload (Optional)

Deployer supports a powerful debugging feature known as Hot Code Reload. This feature allows you to debug your services in real-time without the need for re-deployments. You can attach your debugger, step through code, and make changes while your service is running.

A visual walkthrough of the Hot Code Reload feature is available in this video:

To enable Hot Code Reload, include a debug section in your target description file under containers.

Example:

debug:
  - containerName: Deployment/my-service
    runtimeType: go
    command: myservice
    debugPort: 33333
    mountPaths:
      - /workspaces/myproject/src/myservice

With this debug section, you can enable Hot Code Reload for debugging purposes. Here’s a breakdown of the parameters you can configure in the debug section:

  • containerName: The name of the container to use in debug mode.
  • runtimeType: The runtime type of your service, such as go, node, or python.
  • command: The application entry point that will run in a loop, relative to the first path specified in mountPaths.
  • debugPort: The local port of the running service to debug.
  • mountPaths: Path(s) mounted to the remote container.

With Hot Code Reload, any code changes you make will immediately take effect, streamlining your debugging process.

2. Bring Up the Target

Run the up command to deploy the target, replacing helm-demo with your target name:

skyramp deployer up helm-demo

Deployer will read the target description file and launch the deployment process. It will handle the deployment of Helm charts using the configurations from your target description. Deployer will create or update the necessary Kubernetes resources, removing the need for manual management.

3. Manage Your Deployment

View the Status of Deployments

Once you have run deployer up on a target, you can view the status of the deployment by running the status command:

skyramp deployer status

This will output the status of the deployment in a digestible table format.

Tear Down the Target

After testing or when you’re done with the deployment, you can bring down the target using the down command:

skyramp deployer down helm-demo

Deployer will clean up all the resources deployed using the skyramp deployer up command.

That’s it! With these steps, you can quickly start using Deployer to simplify the deployment of your Kubernetes resources.

2 - Target Description

Learn more about specific features and configurations of the target description.

The How to Deploy Services section covers the steps for deploying services to your cluster with Deployer and managing your deployment. This section provides additional details about the target description file used with Deployer.

Target Description File

The target description file is a crucial component of the Deployer tool, containing the configuration parameters required to deploy your system-under-test efficiently. This file should be placed under the targets folder at the root of your microservice repository. You can name it with a .yaml extension, such as my-deployment.yaml. With this file, you can define and control how your services are deployed and configured within your Kubernetes cluster.

Specifying the Namespace and Containers

A target description file must include a namespace parameter representing the Kubernetes namespace for the cluster. Additionally, it should have a containers section that defines the specific deployment settings. All the parameters described in this document are specified under the containers section.

Example:

namespace: helm-namespace
containers:
  - type: helm
    releaseName: my-release
    path: charts/test1

Defining Helm Values

You can provide a path to the values.yaml file for your Helm chart using valuesPath. Additional values to override or extend the configuration from the values.yaml file can be added to the values section. Both valuesPath and values should be placed under containers.

Example:

    valuesPath: files/values.yaml
    values:
      server:
        enabled: true
        service:
          port: 10000
      service:
        port: 5000
        type: ClusterIP

Including and Excluding Services

You have the option to explicitly include or exclude specific services in the deployment by specifying them in the includes or excludes section under containers.

Example:

includes:
  - Deployment/my-service
  - Service/my-service
  - Job/* # include all jobs
  - server/* # include subchart server with all subresources
  - /* # include all resources in root chart
excludes:
  - Deployment/excluded-service