Cloud Agentics Talk to an engineer

Work / Migration

Migration, March 2024

3,000 microservices moved to Kubernetes with no downtime

A financial technology company ran more than 3,000 microservices on more than 300 physical servers. We moved every service to a Kubernetes platform with GitOps delivery. The server count fell by 40 % and no service was offline during the move.

3,000microservices movedJava and Go, in batches
40 %fewer serversfrom more than 300 to more than 180
5 minper deploymentfrom 2 to 4 hours
0minutes of downtimeduring the whole move

The estate before the migration

The client ran more than 3,000 microservices, written in Java and Go, on more than 300 physical servers. Every service was deployed by hand. The estate had four problems.

Hardware refresh

The physical servers were ageing and had to be replaced every 3 to 4 years at a high cost.

Low utilization

Average CPU utilization was below 20 %, and memory was over-provisioned across the clusters.

Manual deployment

Each service took 2 to 4 hours to deploy by hand, and a high share of deployments failed.

No automatic scaling

Capacity could not grow during peak traffic, so services degraded at peak.

300+physical serversbare metal
3,000+microservicesJava and Go
2 to 4 hdeployment timeper service, by hand

The migration method

We moved the services in batches with the strangler fig pattern. In this pattern, new services on the Kubernetes platform take over traffic from the old services one group at a time, until the old servers carry no traffic and are retired. No service was offline at any step. The work ran in five phases.

1

Plan

Service dependency mapReadiness of each service for containersRisk assessmentMigration order
2

Setup

Kubernetes clusters provisionedCI and CD pipelineObservability stackSecurity baseline
3

Pilot

20 non-critical servicesPatterns validatedTeam trainingRunbooks written
4

Batches

Services moved in batchesTraffic shifted per batchPerformance validatedRollback tested
5

Cutover

Final traffic switchPhysical servers retiredCost validatedMonitoring 24 hours a day

The platform

We designed a multi-cluster Kubernetes platform with one management plane, GitOps deployment and one observability stack for every service. The platform has three parts. Rancher gives one control plane for every cluster, and Kong Gateway applies rate limits and authentication in front of the services.

Rancher multi-cluster management ArgoCD GitOps deployment Vault secrets Harbor image registry
Production 40 nodes Staging 15 nodes Development 10 nodes
Kong Gateway API gateway HAProxy load balancing Prometheus and Grafana metrics Jaeger tracing ELK stack logs

Technology stack

AreaTools
Orchestration
KubernetesRancherHelm
CI and CD
ArgoCDJenkinsGitLab CI
Monitoring
PrometheusGrafanaJaeger
Security
TrivySonarQubeVault

The deployment pipeline

We built a GitOps pipeline that runs without manual steps. A deployment now takes 5 minutes instead of 2 to 4 hours. The pipeline has six stages. Jenkins or GitLab CI builds the image. Trivy and SonarQube scan the code and the image. Harbor stores the image, ArgoCD applies the change from Git and Kubernetes performs a rolling update.

Git commit CI build Security scan Image push to Harbor GitOps sync Rolling update
MeasureBeforeAfter
Deployment time per service2 to 4 h5 min
Deployments completed without failure, %6099.5
RollbackManualAutomated

Security controls

The client is a financial technology company, so we applied controls at every layer of the platform.

SonarQubeStatic analysisDependency check
Trivy scansImage signingHarbor registry
Network policiesPod security standardsRBAC
Vault secretsmTLSAudit logs

No known CVE in production

The pipeline blocks an image with a known vulnerability before it is deployed.

Secrets in Vault

HashiCorp Vault issues secrets dynamically and rotates them.

Network isolation

Kubernetes network policies limit traffic between services to the paths that are declared.

Assessment passed

The platform passed the client's internal red team and blue team security assessments.

Observability

Every one of the 3,000 services reports metrics, traces and logs to one stack.

Prometheus and Grafana

Prometheus collects metrics. Grafana shows dashboards and raises alerts.

Jaeger

Jaeger traces each request across the services it calls.

ELK stack

The ELK stack stores the logs of every service in one place, integrated with Splunk.

99.99 %uptimeservice level measure
< 50 msresponse timep95 of all requests
10 M+requests per dayacross the 3,000 services
< 1 %error ratefailed requests of all requests

Application monitoring with Dynatrace

For the critical workloads we deployed Dynatrace OneAgent. The agent instruments every service without a code change or an SDK. Davis, the Dynatrace analysis engine, identifies performance limits and their root causes. OneAgent is installed as a DaemonSet on every node and detects every service, container, pod and dependency. Performance of each service is recorded continuously. Davis raises an alert within seconds of an anomaly, with a root cause and a recommended change.

Deploy OneAgent Discover services Monitor Detect an anomaly Recommend a change
< 30 sto detect an issueanomaly alerts
100 %of services instrumentedno code changes
85 %shorter mean time to repairroot cause analysis by Davis
24 ha day of monitoringcritical workloads

Resource figures

Kubernetes places several services on each node, so the same load runs on fewer servers at higher utilization.

ResourceBefore, physicalAfter, KubernetesChange
CPU utilization, %15 to 2060 to 703.5 times
Servers300+180+40 % fewer
Deployment time per service2 to 4 h5 min95 % shorter
Operations effortVery highModerateStandardized
40 %fewer serversfrom more than 300 to more than 180
3.5×CPU utilizationfrom 15 to 20 % to 60 to 70 %
10×faster scalinga service now scales in seconds

What the client received

  • Three Kubernetes clusters, production, staging and development, with automatic scaling and one management plane in Rancher.
  • A GitOps pipeline from commit to rolling update, with a security scan at every build.
  • Security controls at the code, container, runtime and infrastructure layers.
  • One observability stack for metrics, traces and logs, and Dynatrace on the critical workloads.
  • Runbooks for every migration pattern and training for the client's team.
  • The physical servers retired after cutover, with the cost saving validated.