Deploy
Deploying Services in KoalaOps
KoalaOps provides a streamlined deployment process for Kubernetes-based services. This guide outlines how to deploy a service using the Deploy section, detailing how to configure images, CI/CD workflows, Git references, and Kubernetes resources.
Deployment Options
You can deploy a service in KoalaOps in two ways:
- Deploy Existing Image: Use an already-built container image and deploy it to the selected environment.
- Build Image: Trigger a new build from a Git branch before deployment.
Deployment Configuration
The Deploy interface includes multiple configuration sections:
1. Image Selection
- Deploy Existing Image:
- Image Tag: Choose an existing image tag from the repository to deploy.
- Git Code Reference: Always uses
main
or the adjacent branch ofmain
in the organization; this cannot be changed.
- Build Image:
- Image Tag: Optionally, provide a custom image tag name.
- Git Code Reference: Users can select a branch, tag, or commit to build an image before deployment.
2. Kubernetes Resources
- Config Reference: Defines the source of configuration for the service. KoalaOps allows two configuration approaches:
- Central Repository: Configurations are managed separately from the service repository.
- Within the Repository: Configuration files reside within the service repository.
There are advantages and trade-offs between these approaches. Central repositories ensure consistency across services but may add complexity in managing global changes. Storing configurations within the application repository simplifies per-service modifications but may lead to duplication across multiple services. Choosing the right approach depends on factors such as maintainability, security, and deployment flexibility.
For more information on managing configurations centrally vs. within repositories, refer to this blog post.
3. CI Workflows
- Git CI Reference: Specifies the Git branch or tag on which to rely for the CI/CD pipeline configuration.
4. Environment Selection
- Choose the target environment for the deployment (e.g., dev, staging, production).
Service Creation and Import
When creating or importing a new service into KoalaOps, several configuration files and settings are generated to facilitate deployment:
Configuration Files
.koala.toml
: This file contains essential service metadata, including:- ServiceName: Defines the service name.
- Owners: Lists responsible users or teams.
- ServerFramework: Specifies the technology stack (e.g.,
go-server
). - ArtifactRepository: Points to the image registry used for deployments.
- DeploymentRepo & Path: Indicates the central repository managing deployments.
- Deployment Directory (
deploy/
): Contains Kubernetes manifests, Helm charts, or other deployment-related configurations.
Environment Configuration
For each service, environments such as dev
and prod
are defined with the following attributes:
- Namespace & Cluster: Specifies Kubernetes namespace and cluster location.
- Cloud Provider: Defines the target cloud provider (e.g.,
GCP
). - Ingress Settings: Determines whether ingress is enabled and specifies the host.
- Auto-Deployment & Scaling Policies:
- AutoDeploy: Controls automatic deployments.
- HPAEnabled: Enables horizontal pod autoscaling.
- HPATargetCPUUtilizationPercentage: Sets CPU-based autoscaling thresholds.
SSL and Monitoring Configuration
- SSLConfig: Specifies TLS certificate name and issuer (e.g., Let’s Encrypt).
- Metrics & Tracing: Configures observability tools such as Prometheus and OpenTelemetry.
These settings ensure consistency across environments and simplify deployments using KoalaOps’ automation capabilities.
Advanced Rollouts: Canary & Blue-Green Deployments
KoalaOps supports advanced deployment strategies using Argo Rollouts, enabling Canary and Blue-Green rollouts. These strategies provide a safer and more controlled approach to rolling out updates to production, reducing risk and ensuring higher availability.
Why Use Advanced Rollouts?
- Minimize Downtime: New versions are gradually introduced without affecting all users at once.
- Risk Mitigation: Canary and Blue-Green strategies allow early detection of issues before full deployment.
- Improved User Experience: Reduces the impact of faulty deployments by limiting exposure to a subset of users.
- Easier Rollbacks: If an issue is detected, rollback can be performed with minimal disruption.
Deployment Strategies
1. Canary Deployment
In a Canary Deployment, a small percentage of traffic is gradually shifted to the new version while monitoring performance and stability before rolling out fully.
2. Blue-Green Deployment
A Blue-Green Deployment maintains two environments: one running the current stable version (Blue) and the other running the new version (Green). Once validated, traffic is switched instantly to the Green version.
Prerequisites: Enabling Argo Rollouts
To use these deployment strategies effectively, Argo Rollouts must be enabled on the relevant Kubernetes clusters:
- Go to the Control Plane section.
- Select the GitOps tab.
- Locate Argo Rollouts under Featured Addons.
- Generate the required pull requests to enable Argo Rollouts for the relevant clusters.
For further assistance with Argo Rollouts, don’t be hesitant to contact KoalaOps Support!