Try Devtron Enterprise!
Start Free Trial
LogoLogo
WebsiteDevtron demoGithub RepoJoin Discord
v0.7
v0.7
  • Introduction
  • Getting Started
  • Install Devtron
    • Install Devtron with CI/CD
    • Install Devtron with CI/CD and GitOps (Argo CD)
    • Install Devtron without Integrations
    • Install Devtron on Minikube, Microk8s, K3s, Kind, Cloud VMs
    • Install Devtron on Airgapped Environment
    • Demo on Popular Cloud Providers
    • Backup for Disaster Recovery
    • Uninstall Devtron
    • FAQs
  • Install Devtron Enterprise Trial
  • Devtron Kubernetes Client
  • Configurations
    • Installation Configurations
    • Override Configurations
    • Ingress Setup
  • Global Configurations
    • Host URL
    • GitOps
    • Projects
    • Clusters & Environments
    • Git Accounts
    • Container/OCI Registry
    • Chart Repositories
    • Deployment Charts
    • Authorization
      • SSO Login Services
        • Google
        • GitHub
        • GitLab
        • Microsoft
        • LDAP
        • OIDC
          • Keycloak
          • Okta
        • OpenShift
      • User Permissions
      • Permission Groups
      • API Tokens
    • Notifications
    • Deployment Window
    • Approval Policy
    • External Links
    • Catalog Framework
    • Scoped Variables
    • Plugin Policy
    • Pull Image Digest
    • Tags Policy
    • Filter Condition
    • Lock Deployment Configuration
    • Image Promotion Policy
    • Build Infra
  • Devtron Upgrade
    • Update Devtron from Devtron UI
    • Upgrade to 1.5.0
    • 0.6.x-0.7.x
    • 0.5.x-0.6.x
    • 0.4.x-0.5.x
    • 0.4.x-0.4.x
    • 0.3.x-0.4.x
    • 0.3.x-0.3.x
    • 0.2.x-0.3.x
  • Usage
    • Applications
      • Create a New Application
      • Clone an Existing Application
      • Deploy a Sample Application
      • App Configuration
        • Git Repository
        • Build Configuration
        • Base Deployment Template
          • Deployment
          • Rollout Deployment
          • Job and Cronjob
          • StatefulSets
        • GitOps Configuration
        • Workflow Editor
          • CI Pipeline
            • Pre-Build/Post-Build Stages
            • Override Build Configuration
          • CD Pipeline
        • ConfigMaps
        • Secrets
          • External Secret Operator (ESO)
            • AWS Secrets Manager
            • Google Secrets Manager
            • HashiCorp Vault
        • Environment Overrides
        • Deleting Application
      • Build and Deploy
        • Triggering CI
        • Triggering CD
        • Rollback Deployment
        • Applying Labels to Images
      • App Details
        • Debugging Deployment And Monitoring
        • Using Ephemeral Containers
        • Application Metrics
      • Application Overview
    • Jobs
      • Create a new job
      • Configurations
      • Workflow Editor
      • Trigger Job
      • Overview
    • Application Groups
    • Software Distribution Hub
      • Tenants
      • Release Hub
    • Resource Browser
    • Resource Watcher
    • Charts
      • Charts Overview
      • Deploy & Observe
      • Examples
        • Deploying Mysql Helm Chart
        • Deploying MongoDB Helm Chart
      • Chart Group
    • Security
      • Security Scans
      • Security Policies
    • Bulk Edit
    • Integrations
      • Build and Deploy (CI/CD)
      • GitOps (Argo CD)
      • Vulnerability Scanning (Clair)
      • Notifications
      • Monitoring (Grafana)
    • Pipeline Plugins
      • Create Your Plugin
      • Our Plugins
        • Ansible Runner
        • Bitbucket Runner Trigger
        • Codacy
        • Code-Scan
        • Copacetic
        • Container Image Exporter
        • Copy Container Image
        • Cosign
        • CraneCopy
        • Dependency track - Maven & Gradle
        • Dependency track - NodeJS
        • Dependency track - Python
        • Devtron CD Trigger
        • Devtron CI Trigger
        • Devtron Job Trigger
        • DockerSlim
        • EKS Create Cluster
        • GCS Create Bucket
        • GitHub Pull Request Updater
        • GKE Provisioner
        • GoLang-migrate
        • Jenkins
        • Jira Issue Validator
        • Jira Issue Updater
        • K6 Load Testing
        • Pull images from container repository
        • Semgrep
        • SonarQube
        • SonarQube v1.1.0
        • Terraform CLI
        • Vulnerability Scanning
  • Resources
    • Glossary
    • Troubleshooting
    • Use Cases
      • Devtron Generic Helm Chart To Run CronJob Or One Time Job
      • Connect SpringBoot with Mysql Database
      • Connect Expressjs With Mongodb Database
      • Connect Django With Mysql Database
      • Pull Helm Charts from OCI Registry
    • Telemetry Overview
    • Devtron on Graviton
    • Release Notes
Powered by GitBook
On this page
  • Introduction
  • Add Kubernetes Cluster
  • Add Cluster Using Server URL & Bearer Token
  • Add Cluster Using Kubeconfig
  • Choose Method of Connection
  • Use Secure TLS Connection
  • Configure Prometheus (Enable Application Metrics)
  • Add Isolated Cluster
  • Add Environment to a Cluster
  • Edit Environment
  • Delete Environment
  • Extras
  • Get Cluster Credentials
  • Benefits of Self-hosted URL

Was this helpful?

Export as PDF
  1. Global Configurations

Clusters & Environments

PreviousProjectsNextGit Accounts

Last updated 1 month ago

Was this helpful?

Introduction

Devtron allows you to connect and manage your existing Kubernetes clusters by adding them to its platform. Once a cluster is added, you can create different environments within it, making it possible to deploy your applications.

Go to Global Configurations → Clusters & Environments → Add Cluster (button)

Figure 1: Adding a Cluster

You can add any of the following cluster types:


Add Kubernetes Cluster

Who Can Perform This Action?

Users need to have super-admin permission to add a Kubernetes cluster to Devtron.

On the Add Cluster screen, select Add Kubernetes Cluster.

You can choose to add your Kubernetes cluster using either of the following methods:

Add Cluster Using Server URL & Bearer Token

Note

  1. To add a Kubernetes cluster on Devtron using Server URL and Bearer Token, provide the following information:

Field
Description

Name

Enter the name of your cluster.

Server URL

Bearer Token

Paste the bearer token of your cluster

  1. complete the remaining steps (optional):

Tip

Add Cluster Using Kubeconfig

In case you prefer to add clusters using kubeconfig, follow these steps:

  1. Copy and paste your kubeconfig file into the editor. Alternatively, you may browse and select the file as well.

  1. Click the Get Cluster button. This action will display the cluster details alongside the kubeconfig.

  1. If your kubeconfig file lists multiple clusters, they will be displayed in the window. Use the checkboxes to select the desired cluster(s) and click Save.

  1. Click the saved cluster, and complete the remaining steps (optional):

Note

Ensure that the kubeconfig file has admin permissions. It is crucial for Devtron to have the necessary administrative privileges; otherwise, it may encounter failures or disruptions during deployments and other operations. Admin permission is essential to ensure the smooth functioning of Devtron and to prevent any potential issues that may arise due to insufficient privileges.

When adding a new cluster to Devtron, you must choose how Devtron will connect to it. There are three connection options available:

Direct Connection

Clusters with a directly accessible API server endpoint—either publicly or via private peering—can be added as Direct Connection clusters.

  • Devtron connects directly without an intermediary.

  • Recommended when the cluster is publicly accessible or has a direct network route from Devtron.

For security reasons, some Kubernetes clusters are deployed behind a proxy. In this setup, Devtron routes all communication through the specified proxy URL.

  • Use this option when network restrictions require traffic to go through a proxy server.

  • Requires specifying a Proxy URL (e.g., http://proxy.example.org:3128).

When a direct connection isn't possible, Devtron can connect to the Kubernetes cluster through an SSH tunnel, ensuring secure and encrypted communication.

  • Requires:

    • SSH Server URL (e.g., http://proxy.example.org).

    • Username for authentication.

    • Authentication Method:

      • Password

      • SSH Private Key

      • Both Password & SSH Private Key

Use Secure TLS Connection

For a secure cluster connection, you can opt for TLS connection, where you need to provide Certificate Authority Data, a TLS Key, and a TLS Certificate.

Field
Description

Certificate Authority (CA) Data

TLS Key

The private key associated with the client certificate for authentication.

TLS Certificate

The client certificate used to authenticate with the Kubernetes API server.

Configure Prometheus (Enable Application Metrics)

If you want to see application metrics against the applications deployed in the cluster, Prometheus must be deployed in the cluster. Prometheus is a powerful tool to provide graphical insight into your application behavior.

Provide the information in the following fields:

Field
Description

Prometheus endpoint

Provide the URL of your Prometheus

Authentication Type

Prometheus supports two authentication types:

  • Basic: If you select the Basic authentication type, then you must provide the Username and Password of Prometheus for authentication.

  • Anonymous: If you select the Anonymous authentication type, then you do not need to provide the Username and Password. Note: The fields Username and Password will not be available by default.

TLS Key & TLS Certificate

These fields are optional and can be used when you use a customized URL.

Click Save Cluster to save your cluster on Devtron.


Who Can Perform This Action?

Users need to have super-admin permission to add an isolated/airgapped cluster to Devtron.

For air-gapped Kubernetes clusters with restricted inbound and outbound traffic, Devtron enables seamless management using isolated clusters. While these are not actual clusters with API endpoints, they provide a convenient way to deploy applications in such environments.

  1. On the Add Cluster screen, select Add Kubernetes Cluster.

  1. Add a cluster name (e.g. banking-airgapped-cluster) and click Save Cluster.

You have successfully configured an isolated cluster.

Note

  • Download and install manually in a fully air-gapped setup.


Add Environment to a Cluster

Who Can Perform This Action?

Users need to have super-admin permission to add an environment to a cluster.

  1. Fill the following details within the Add Environment modal window.

Field
Description

Environment Name

Enter a name for your environment.

Enter Namespace

Enter a namespace corresponding to your environment. Note: If this namespace does not exist in your cluster, Devtron will create it. If it already exists, Devtron will map the environment to it.

Environment Type

Select your environment type:

  • Production

  • Non-production

Note: Devtron shows deployment metrics (DORA metrics) for environments tagged as Production only.

  1. Click Save. Your new environment will be visible in your cluster as shown below.


Edit Environment

Who Can Perform This Action?

Users need to have super-admin permission to edit an environment in a cluster.

You can also make edits to an existing environment if need be by clicking the edit icon.

Feature
Editable?

Production/Non-Production Option

✅ Yes

Description

✅ Yes

Labels for Namespace

✅ Yes

Environment Name

❌ No

Namespace Name

❌ No

Click Update to save your changes.


Delete Environment

Who Can Perform This Action?

Users need to have super-admin permission to delete an environment from a cluster.

If an environment is no longer needed, you can delete it by following these steps:

  1. Click the delete icon for the environment you wish to remove.

Important

  1. A confirmation dialog will appear. Click Confirm to permanently delete the environment.


Extras

Get Cluster Credentials

Prerequisite

Note

You can get the Server URL and Bearer Token by running the following command depending on the cluster provider:

If you are using EKS, AKS, GKE, Kops, Digital Ocean managed Kubernetes, run the following command to generate the server URL and bearer token:

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

If you are using a microk8s cluster, run the following command to generate the server URL and bearer token:

curl -O https://raw.githubusercontent.com/devtron-labs/utilities/main/kubeconfig-exporter/kubernetes_export_sa.sh && sed -i 's/kubectl/microk8s kubectl/g' \
kubernetes_export_sa.sh && bash kubernetes_export_sa.sh cd-user \
devtroncd

Benefits of Self-hosted URL

  • Disaster Recovery:

    • You cannot edit the server URL of a cloud-specific provider. If you're using an EKS URL (e.g. *****.eu-west-1.elb.amazonaws.com), it will be a tedious task to add a new cluster and migrate all the services one by one.

    • But in case of using a self-hosted URL (e.g. clear.example.com), you can just point to the new cluster's server URL in DNS manager and update the new cluster token and sync all the deployments.

  • Easy Cluster Migrations:

    • In case of managed Kubernetes clusters (like EKS, AKS, GKE etc) which is a cloud provider specific, migrating your cluster from one provider to another will result in waste of time and effort.

    • On the other hand, migration for a self-hosted URL is easy, as the URL belongs to a single hosted domain independent of the cloud provider.

- If you have access to the cluster, use this option.

- For airgapped-related use-cases, use this option.

Figure 2: Choosing Cluster Type
Figure 3: Selecting 'Add Kubernetes Cluster'

Figure 4: Choosing a Method

Refer to learn the process of getting Server URL and bearer token.

Enter the Server URL of your cluster (with https) Note: We recommend using a instead of cloud hosted URL.

Figure 5: Enter Cluster Credentials

If you have a kubeconfig file ready, you may skip the above process and refer instead.

Figure 6: Choosing Kubeconfig Option
Figure 7: Get Cluster List from Kubeconfig
Figure 8: Clicking Save

Choose Method of Connection

Figure 9: Choosing Direct Connection

Via Proxy

Limitation: Deployments via are not recommended for clusters connected via proxy.

Figure 10: Choosing 'Via Proxy'

Via SSH Tunnel

Limitation: Deployments via are not recommended for clusters connected via SSH Tunnel.

Figure 11: Choosing 'Via SSH Tunnel'

If your cluster is managed (e.g., , , ), you might need to download these certificates from your cloud provider’s dashboard or API.

The CA certificate (see: ) used to verify the Kubernetes API server’s identity.

Figure 12: Using Secure TLS Connection

Enable application metrics to configure Prometheus as shown below. In case it is not available, make sure to install the Monitoring (Grafana) integration from to configure Prometheus.

Figure 13: Enabling Application Metrics

Add Isolated Cluster

Figure 14: Selecting Isolated Cluster
Figure 15: Saving Isolated Cluster
Figure 16: New Isolated Cluster

When you deploy to an isolated environment, Devtron automatically packages application manifests and images into a . You can then either:

Push it to an (provided pushing of helm package is enabled), allowing manifests to be pulled manually or automatically via Devtron on air-gapped cluster (if pull access to the OCI registry is available).

Whether it is a or , a newly created cluster initially has no environments, so click Add Environment.

Figure 17: Adding an Environment
Figure 18: Saving an Environment

Add/Edit labels to namespace - You can attach labels to your specified namespace in the Kubernetes cluster. Using labels will help you filter and identify resources via CLI or other Kubernetes tools. to know more about labels.

Figure 19: Adding Labels to Namespace
Figure 20: Newly Created Environment in the Cluster
Figure 21: Editing Environment in the Cluster
Figure 22: Updating Environment in the Cluster
Figure 23: Deleting Environment

Environment deletion is not allowed if any application has a CD pipeline corresponding to the environment. In such a case, go to and delete the deployment pipeline first, and then return to delete the environment. This action is irreversible, so make sure no critical applications or resources depend on the environment before deleting.

Figure 24: Confirming Environment Deletion

must be installed on the bastion.

We recommend using a self-hosted URL instead of a cloud-hosted URL. Refer the benefits of a .

Figure 25: Generating Cluster Credentials
EKS
AKS
GKE
Devtron Stack Manager
OCI registry
Workflow Editor
kubectl
Kubernetes Cluster
Isolated Cluster
Server URL & Bearer Token
Kubeconfig
Get Cluster Credentials
Choose Connection Type
Use Secure TLS Connection
Configure Prometheus
Add Cluster Using Kubeconfig
Choose Connection Type
Use Secure TLS Connection
Configure Prometheus
Kubernetes Cluster
Isolated Cluster
self-hosted URL
example
self-hosted URL
Click here
GitOps (ArgoCD)
GitOps (ArgoCD)
Helm chart