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
  • Adding Tag Policy
  • Editing a Tag
  • Editing in Bulk
  • Deleting a Tag
  • Results
  • Appearance of Mandatory Tags
  • Appearance of Suggested Tags
  • Impact on Deployment Pipelines
  • Impact on Application Group
  • Impact on Release

Was this helpful?

Export as PDF
  1. Global Configurations

Tags Policy

PreviousPull Image DigestNextFilter Condition

Last updated 1 month ago

Was this helpful?

Introduction

Managing resources in Kubernetes often requires categorizing and grouping resources for better visibility and analysis. A common use case is cost allocation. By analyzing Kubernetes labels, teams can identify which departments consume the most resources. However, this is only possible if the relevant tags are propagated as Kubernetes labels.

The Tags Policy feature in Devtron allows you to enforce a tag that must be provided before application creation or before deployment to an environment. For example, you can create a tag named team and if it is propagated as labels to Kubernetes resources, you can easily audit the team-wise usage and resource consumption by its tag. Additionally, you can enforce deployment-specific rules for your applications if required tags are missing.

Figure 1: How Tags Policy Works

Adding Tag Policy

Who Can Perform This Action?

Users need to have super-admin permission to create tag policy.

  1. Go to Global Configurations → Tags Policy.

  2. Click + Add Tag.

  3. Suggested tags/Mandatory tags - You can either suggest tags or make them mandatory when creating applications:

    • If you want the person creating an application to compulsarily provide a tag, use Mandatory tags. Mandatory tags have two consequences:

      • Blocks application creation if the required tag is not provided.

      • Blocks deployment if restriction is enforced.

  4. Select Project(s) - To mandate a tag, you must provide a project where this policy should apply. All applications in the project will require the mandatory tag to be entered. Whereas, suggested tags are shown as suggestions globally (i.e., for all apps).

  5. Tag Key - Enter the key from the key-value pair (tag), e.g., Business Unit, Team, Owner.

  6. Value Choices - Here, you can create a list of values for the key-value pair (tag). A tag value can be a free text or you can restrict it to a set of values for the user to choose from.

You may enable Allow Custom Input to give the user a choice to enter their own value if it is unavailable in the list. Or you may skip creating the list of choices altogether so that your user can enter their own value.

  1. Description - Write a brief description explaining the significance of the tag.

  2. Allow/Block Deployments - Mandatory tags additionally let you define what should happen if users do not configure them in the intended projects:

    • Allow deployments - Use this option if you want to allow the user to deploy an existing application where mandatory tags are not configured yet.

    • Block deployment stages of all environments - This will prevent the user from deploying an existing application to all environments if mandatory tags are not configured.

Changing Propagation in Suggested Tags vs. Mandatory Tags

In suggested tags: When you enable/disable tag propagation, users can still disable/enable it during app creation, ensuring its tags propagate to associated Kubernetes resources.

In mandatory tags: When you enable/disable tag propagation, users do not get the option to change the propagation setting.

  1. (Optional) Click the + option to create more suggested tags or more mandatory tags in one go.

  2. Click Save to create the tag(s).


Editing a Tag

Who Can Perform This Action?

Users need to have super-admin permission to edit tags.

You can edit an existing tag key to do the following:

  • Modify the tag key

  • Add/remove value choices

  • Tweak the description

  • Change deployment restrictions

  • Add or remove projects

  • Convert Tags from Suggested to Mandatory (or vice versa)

  • Enable/Disable the propagation of tags

Once done, click Update to apply the changes.

Editing in Bulk

You may use the checkboxes to add/remove projects from multiple tags at once as shown below.


Deleting a Tag

Who Can Perform This Action?

Users need to have super-admin permission to delete tags.

If you delete a 'Suggested Tag', it will no longer show up as a suggestion to your users while adding tags. If it's a 'Mandatory Tag', the deployment rules (if any, associated with that tag) will no longer be enforced.

However, this action will not delete the applied tag from existing applications.

If you wish to delete multiple tags, you may use the checkboxes to select the tags and delete them from the floating widget as shown below.


Results

Appearance of Mandatory Tags

  • The mandatory tag is available for users to configure after they select the project in the app creation page. It is marked by a red asterisk.

  • For an existing application, users can configure it from the Overview page of the application.

  • In a project where mandatory tags are enabled, if the user does not provide values for the mandatory tags, the user cannot create an app in that project.

Appearance of Suggested Tags

Users can see a dropdown list of your suggested tags while creating a new app or on the Overview page of an existing application.

Impact on Deployment Pipelines

The same is true for auto-triggering deployment pipelines. A new image available after the build stage will not auto-trigger the deployment pipeline due to the missing mandatory tags.

Impact on Application Group

Impact on Release

Figure 2: Tags Policy
Figure 3: 'Add Tag' Button

If you just want to offer tag suggestions, use Suggested tags. These will appear as when adding tags to applications globally, and users can optionally use them if needed.

Figure 4: Creating Suggested or Mandatory Tag
Figure 5: Selecting One or More Projects
Figure 6: Entering Tag Key
Figure 7: Creating List of Choices
Figure 8: Adding Description for the Tag

Block deployment stages of prod environments - Use this option if you want to prevent the user from deploying an existing application to , if mandatory tags are not configured.

Block deployment stages of non-prod enviroments - Use this option if you want to prevent the user from deploying an existing application to , if mandatory tags are not configured.

Figure 9: Deciding Deployment Restrictions

Propagate Tag - By default, tags assigned to applications in Devtron are not automatically propagated to Kubernetes resources as labels. For more information on how labels function in Kubernetes, refer to the .

Figure 10a: Propagating Tags
Figure 10b: Enabling/Disabling Propagation
Figure 10c: How Tag Propagation Works
Figure 11: Adding More Tag
Figure 12: Editing a Tag
Figure 13: Adding/Removing projects in Bulk
Figure 14: Deleting a Tag
Figure 15: Deleting Multiple Tags
Figure 16: Mandatory Tag - App Creation Page
Figure 17: Mandatory Tag - Overview Page
Figure 18: App creation not allowed
Figure 19: Suggested Tags in Dropdown

If an existing application belongs to a project where mandatory tags are enabled along with deployment restrictions, if the user does not provide values for the mandatory tags, they cannot deploy that app to the intended environment (check step 9 of ).

Figure 20: Deployment Restriction

Similarly, if deployment restrictions apply due to missing mandatory tags, users cannot deploy apps to the intended environment from the .

Figure 21: Deployment Restriction in Application Group

If a user attempts to that contains applications with missing mandatory tags, the deployment will be blocked if restrictions apply.

Figure 22: Deployment Restriction in Release (SDH)
production environments
non-production environments
Kubernetes Labels Documentation
Application Group
dropdown suggestions
adding tags
deploy a release