The Swiss Knife for Deckhouse Module Development
Features β’ Installation β’ Quick Start β’ Documentation β’ Contributing
DMT (Deckhouse Module Tool) is a comprehensive command-line tool designed to streamline the development, testing, and maintenance of Deckhouse Kubernetes Platform modules. It provides powerful linting capabilities, project bootstrapping, and validation tools to ensure your modules meet quality standards.
- β Quality Assurance: Comprehensive linting with 9 specialized linters
- π Fast Development: Bootstrap new modules in seconds
- π§ Configurable: Fine-tune linting rules per project
- π― CI/CD Ready: Perfect for automated pipelines
DMT includes 9 specialized linters to validate different aspects of your Deckhouse modules:
Linter | Purpose | Key Checks |
---|---|---|
Container | Container configuration validation | Duplicate names, env vars, security contexts, probes, resource limits |
Documentation | Documentation quality | README presence, bilingual support, no cyrillic in English docs |
Hooks | Hook validation | Hook syntax, ingress configurations |
Images | Image build instructions | Dockerfile best practices, werf configuration |
Module | Module structure | module.yaml format, OpenAPI conversions, oss.yaml, license files |
NoCyrillic | Character encoding | Cyrillic characters in code/config files |
OpenAPI | OpenAPI schemas | Schema validation, CRD definitions, naming conventions |
RBAC | Security policies | Role bindings, service accounts, wildcards |
Templates | Kubernetes templates | VPA/PDB settings, Prometheus rules, Grafana dashboards, service ports |
Quickly scaffold new Deckhouse modules with best practices:
- GitHub/GitLab CI/CD integration
- Pre-configured project structure
- Template customization
- Automated setup for common patterns
- Per-module config: Override rules for specific needs
- Impact levels: Control severity (error/warn)
- Exclusion rules: Skip checks for specific resources
Quick one-line installation for Linux and macOS:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/deckhouse/dmt/main/tools/install.sh)"
Alternative installation commands
Using wget:
sh -c "$(wget -qO- https://raw.githubusercontent.com/deckhouse/dmt/main/tools/install.sh)"
Install specific version:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/deckhouse/dmt/main/tools/install.sh)" "" --version v1.0.0
Install to custom directory:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/deckhouse/dmt/main/tools/install.sh)" "" --install-dir ~/bin
See installation guide for more options.
Download the latest release for your platform from the releases page.
Supported Platforms:
- Linux (amd64, arm64)
- macOS (amd64, arm64)
- Windows (amd64)
If you have Go installed (requires Go 1.24+):
go install github.com/deckhouse/dmt@latest
Note: Ensure
~/go/bin
is in your PATH after installation.
trdl is a tool release delivery system that provides automatic updates and channel management:
# Install from stable channel
trdl use dmt stable
# Or install from alpha channel for latest features
trdl use dmt alpha
Benefits:
- Automatic updates
- Channel-based releases (stable, alpha)
- Cross-platform support
- Version management
Note: Requires trdl to be installed first.
dmt --version
Lint a single module:
dmt lint /path/to/your-module
Lint multiple modules:
dmt lint /path/to/modules/
Lint specific directories:
dmt lint ./module-1 ./module-2 ./module-3
Example directory structure:
/path/to/modules/
βββ 001-module-one/
βββ 002-module-two/
βββ 003-module-three/
Create a new module with GitHub CI/CD:
dmt bootstrap my-awesome-module
Create with GitLab CI/CD:
dmt bootstrap my-module --pipeline gitlab
Specify target directory:
dmt bootstrap my-module --directory ./modules/my-module
Use custom template:
dmt bootstrap my-module --repository-url https://github.com/myorg/template/archive/main.zip
Note: Module names must be in kebab-case (e.g.,
my-module-name
)
DMT can be configured using a .dmtlint.yaml
file in your project root.
linters-settings:
container:
impact: error
exclude-rules:
# Exclude specific resources from checks
security-context:
- kind: Deployment
name: legacy-app
container: main
resources:
- kind: DaemonSet
name: node-exporter
images:
impact: warn
exclude-rules:
skip-image-file-path-prefix:
- images/special-case/
documentation:
impact: error
templates:
impact: error
exclude-rules:
vpa-absent:
- kind: Deployment
name: one-off-job
dmt lint [directories...] [flags]
Flags:
--values-file, -v
: Specify custom values file--linter
: Run specific linter only--hide-warnings
: Hide warning-level issues--abs-path
: Show absolute paths in output--show-ignored
: Display ignored issues--log-level
: Set logging verbosity (debug, info, warn, error)
Examples:
# Run only container linter
dmt lint ./my-module --linter container
# Hide warnings
dmt lint ./my-module --hide-warnings
# Use custom values
dmt lint ./my-module --values-file custom-values.yaml
# Debug mode
dmt lint ./my-module --log-level debug
dmt bootstrap <module-name> [flags]
Flags:
--pipeline, -p
: CI/CD platform (github
orgitlab
, default:github
)--directory, -d
: Target directory (default: current directory)--repository-url, -r
: Custom template repository URL
Examples:
# GitHub project
dmt bootstrap awesome-module --pipeline github
# GitLab project in specific directory
dmt bootstrap my-module -p gitlab -d ./modules/my-module
# Custom template
dmt bootstrap my-module -r https://example.com/template.zip
We welcome contributions! Here's how you can help:
- Report Bugs: Open an issue describing the problem
- Suggest Features: Share your ideas for improvements
- Submit PRs: Fix bugs or add features
- Improve Docs: Help make documentation better
- Follow Go best practices and idioms
- Add tests for new features
- Update documentation
- Run
make lint
before committing - Use conventional commit messages
- Website: deckhouse.io
- Issues: Report a bug or request a feature
- Releases: Download binaries
- Documentation: Deckhouse Documentation
If you find DMT helpful, please consider:
- β Starring the repository
- π Reporting bugs
- π‘ Suggesting features
- π Contributing to documentation
- π Submitting pull requests