Cloud Native 13 min read

Deploy Multi‑Cluster Applications on Kubernetes with Devtron: A Step‑by‑Step Guide

This tutorial walks you through installing Devtron on Kubernetes, creating additional Kind clusters, adding them as managed clusters, configuring environments, adding custom Helm repositories, and deploying a sample Spring Boot application across multiple clusters using Devtron's UI and chart groups.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Deploy Multi‑Cluster Applications on Kubernetes with Devtron: A Step‑by‑Step Guide

In this tutorial you will learn how to develop applications on Kubernetes using Devtron in a multi‑cluster environment.

Install Devtron on K8s

First, add the Devtron Helm repository and install the operator. You can choose to include the CI/CD module, but it is not required for this guide.

$ helm repo add devtron https://helm.devtron.ai
$ helm install devtron devtron/devtron-operator \
    --create-namespace --namespace devtroncd \
    --set installer.modules={cicd}

Refer to the Devtron documentation for detailed installation instructions.

Create a Second Kind Cluster

Use Kind to create a local second cluster named c1: $ kind create cluster --name c1 The context for this cluster is kind-c1. After creation it becomes the default context.

Generate a bearer token for the new cluster so Devtron can communicate with it:

$ curl -O https://raw.githubusercontent.com/devtron-labs/utilities/main/kubeconfig-exporter/kubernetes_export_sa.sh && bash kubernetes_export_sa.sh cd-user devtroncd https://raw.githubusercontent.com/devtron-labs/utilities/main/kubeconfig-exporter/clusterrole.yaml

Copy the printed bearer token.

Obtain the Kind cluster’s internal IP address:

$ docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' c1-control-plane

In the Devtron dashboard, navigate to

Global Configuration → Clusters and Environments → Add cluster

, provide the Kind cluster URL and the bearer token.

After adding, the second cluster appears in the managed cluster list.

Create Environments

Define three environments and assign them to clusters: a local environment on the default cluster and two remote environments ( remote-dev and remote-devqa) on the Kind cluster. Each environment uses a namespace with the same name.

Switch to the Clusters view to see both clusters connected to Devtron.

Add a Custom Helm Repository

Devtron supports Helm charts. Add a custom repository (e.g., piomin) that hosts the spring-boot-api-app chart version 0.3.2:

https://piomin.github.io/helm-charts/

Navigate to

Global Configurations → Chart repositories → Add repository

and add the repository named piomin.

Verify the new chart in the Chart Store section.

Deploy the Sample Spring Boot Application

The sample Spring Boot (Kotlin) application resides at:

https://github.com/piomin/sample-spring-kotlin-microservice.git

Key controller code:

@RestController<br/>@RequestMapping("/persons")<br/>class PersonController(val repository: PersonRepository) {<br/>    val log: Logger = LoggerFactory.getLogger(PersonController::class.java)<br/><br/>    @GetMapping("/{id}")<br/>    fun findById(@PathVariable id: Int): Person? {<br/>        log.info("findById({})", id)<br/>        return repository.findById(id)<br/>    }<br/><br/>    @GetMapping("/age/{age}")<br/>    fun findByAge(@PathVariable age: Int): List<Person> {<br/>        log.info("findByAge({})", age)<br/>        return repository.findByAge(age)<br/>    }<br/><br/>    @GetMapping<br/>    fun findAll(): List<Person> = repository.findAll()<br/><br/>    @PostMapping<br/>    fun add(@RequestBody person: Person): Person = repository.save(person)<br/><br/>    @PutMapping<br/>    fun update(@RequestBody person: Person): Person = repository.update(person)<br/><br/>    @DeleteMapping("/{id}")<br/>    fun remove(@PathVariable id: Int): Boolean = repository.removeById(id)<br/>}

Build and push the container image with Jib Maven plugin:

<plugin><br/>  <groupId>com.google.cloud.tools</groupId><br/>  <artifactId>jib-maven-plugin</artifactId><br/>  <version>3.3.0</version><br/>  <configuration><br/>    <to><br/>      <image>piomin/sample-spring-kotlin-microservice</image><br/>      <tags><br/>        <tag>1.1</tag><br/>      </tags><br/>    </to><br/>    <container><br/>      <user>999</user><br/>    </container><br/>  </configuration><br/></plugin>

Build and push the image: $ mvn clean compile jib:build -Pjib,tomcat In Devtron, select the target environment (e.g., local) and use the Helm chart’s values.schema.json to fill in configuration values such as the image tag.

After deployment, verify the application status and access the Swagger UI via port‑forward:

$ kubectl port-forward svc/sample-spring-boot-api 8080:8080

Open http://localhost:8080/swagger-ui.html in a browser.

Pod logs can be viewed directly in the Devtron UI without using kubectl commands.

Deploy to Remote Cluster

Switch the target environment to remote-dev, which is associated with the kind-c1 cluster, and deploy the same application.

The application now runs on both clusters.

Deploy an Application Group

Use Devtron’s “Chart Group” feature to deploy the Spring Boot chart together with a PostgreSQL chart in a single logical group.

Create the group via Chart Store → Create Group, selecting bitnami/postgresql and the custom spring-boot-api-app chart.

Deploy the group to the desired environment (e.g., remote-devqa) and set the image tag and PostgreSQL secret via extraEnvVarsSecret.

Summary

Devtron simplifies multi‑cluster application deployment on Kubernetes using Helm charts.

The chart‑group feature enables deploying all required services together.

All operations, including monitoring and log viewing, can be performed from the Devtron UI without manual kubectl commands.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Cloud Nativeci/cdKubernetesMulti-ClusterSpring BoothelmDevtron
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.