dmt

module
v0.1.43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2025 License: Apache-2.0

README

dmt

Deckhouse Module Tool - the swiss knife for your Deckhouse modules

How to install

This is the simplest and fastest method to install the latest version. The command will download, compile, and install the binary in $GOPATH/bin (or ~/go/bin by default).

go install github.com/deckhouse/dmt@latest

After installation, add ~/go/bin to your PATH (if not already added).

Download latest release

You can directly download any release that is compatible with your system.

How to use

Lint

You can run linter checks for a module:

dmt lint /some/path/<your-module>

or some pack of modules

dmt lint /some/path/

where /some/path/ looks like this:

ls -l /some/path/
drwxrwxr-x 1 deckhouse deckhouse  4096 Nov 10 21:46 001-module-one
drwxrwxr-x 1 deckhouse deckhouse  4096 Nov 12 21:45 002-module-two
drwxrwxr-x 1 deckhouse deckhouse  4096 Nov 10 21:46 003-module-three

You can also run linter checks for multiple directories at once:

dmt lint /path/to/module1 /path/to/module2 /path/to/module3

Each directory is processed as a separate execution, and results are displayed for each directory individually.

Bootstrap

Bootstrap a new Deckhouse module from template:

dmt bootstrap my-module-name

This command will:

  • Download the official Deckhouse module template
  • Extract it to the current directory (or specified directory)
  • Replace template placeholders with your module name
  • Configure CI/CD files based on your chosen platform
Options
  • --pipeline, -p: Choose CI/CD platform (github or gitlab, default: github)
  • --directory, -d: Specify target directory (default: current directory)
  • --repository-url, -r: Use custom module template repository URL
Examples

Bootstrap a GitHub module:

dmt bootstrap my-awesome-module --pipeline github

Bootstrap a GitLab module in specific directory:

dmt bootstrap my-module --pipeline gitlab --directory ./modules/my-module

Use custom template repository:

dmt bootstrap my-module --repository-url https://github.com/myorg/custom-template/archive/main.zip

Linters list

Linter Description
container Check containers - duplicated names, env variables, ports, security context, liveness and readiness probes.
hooks Check hooks rules.
images Check images build instructions.
module Check module.yaml definition, openapi conversions, oss.yaml file.
no-cyrillic Check cyrillic letters.
openapi Check openapi settings, crds.
rbac Check rbac rules.
templates Check templates rules, VPA, PDB settings, prometheus, grafana rules, kube-rbac-proxy, service target port.
documentation Check documentation rules.

Development Setup

Pre-commit Hooks

To enable automatic linting before each commit, run:

make setup-hooks

This will install a pre-commit hook that:

  • Runs fast lint checks before each commit
  • Attempts to auto-fix issues when possible
  • Prevents commits with linting errors

The hook uses make lint-fast for quick checks and make lint-fix-fast for auto-fixing.

Available Make Targets
  • make setup-hooks - Install pre-commit hooks
  • make lint - Run full linting
  • make lint-fast - Run fast linting (used by pre-commit hook)
  • make lint-fix - Run full linting with auto-fix
  • make lint-fix-fast - Run fast linting with auto-fix

Configuration

You can exclude linters or setup them via the config file .dmtlint.yaml

Global settings
global:
  linters-settings:
    module:
      impact: warn | critical
    images:
      impact: warn | critical  

Directories

Path Synopsis
cmd
dmt command
internal
module/reggen
Package reggen generates text based on regex definitions based on the reggen library by Lucas Jones https://github.com/lucasjones/reggen/blob/master/reggen.go
Package reggen generates text based on regex definitions based on the reggen library by Lucas Jones https://github.com/lucasjones/reggen/blob/master/reggen.go
promremote
Package promremote is a package to write timeseries data to a Prometheus remote write endpoint.
Package promremote is a package to write timeseries data to a Prometheus remote write endpoint.
set
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL