This repository is a playground for developing and testing Talos Linux extensions. It provides a complete workflow for building, testing, and deploying custom extensions to your Talos cluster.
The repository includes a not ful functional multipath-tools extension as a reference implementation. This extension provides multipath storage device management functionality and has been tested with remote multipath targets, with multipath commands executed in the mount namespace of the ext-multipathd Talos extension service.
This project is designed to help you:
- Learn how to create custom Talos extensions from scratch
- Rapidly iterate and test extension configurations
- Understand the complete extension build and deployment workflow
- Experiment with different extension architectures and configurations
- Use as a template for your own custom extensions
talos-extension-playground/
├── multipath-tools/ # Example extension
│ ├── pkg.yaml # Extension build configuration
│ ├── vars.yaml # Version and checksum variables
│ ├── multipathd.yaml # Extension service configuration
│ ├── patches/ # Source code patches
│ └── README.md # This file
├── upgrade.sh # Build and deployment script
└── Makefile # Build automation
Use the provided upgrade.sh script to build and deploy the extension to your cluster:
# Build and push the extension (no deployment)
./upgrade.sh
# Build and deploy to specific nodes
./upgrade.sh -n 10.21.7.2,10.21.7.3
# Custom image and version
./upgrade.sh --ext-image myrepo/multipath-tools:0.1.0 -v v1.12.0
# See all options
./upgrade.sh -hThis script will replace ALL existing extensions on your cluster. When you upgrade a Talos node with a custom installer image containing this extension, any other extensions previously installed will be removed. This is because the script creates a new installer image with only the multipath-tools extension.
If you need to preserve other extensions:
- Modify the script to include all required extensions in the installer image
- Or use Talos machine config to specify multiple extensions
This is a development/testing project. Before using in production:
- Thoroughly test in a non-production environment
- Review and understand all configuration files
- Ensure your storage infrastructure supports multipath
- Have a rollback plan ready
- ✅ Extension builds successfully
- ✅ Rapid upgrade workflow implemented
- 🚧 Runtime testing in progress
- 🚧 Configuration optimization ongoing
- ❌ Automated tests not yet implemented
To create a new extension based on this template:
-
Copy the example structure:
cp -r multipath-tools/ my-extension/
-
Update the configuration files:
pkg.yaml: Define your build steps, dependencies, and installationvars.yaml: Set version numbers and checksums*-service.yaml: Configure your extension's runtime service
-
Modify the Makefile:
- Add a new target for your extension
- Update the
TARGET_ARGSto use your image name
-
Test and iterate:
./upgrade.sh --ext-image myrepo/my-extension:0.1.0 -n <test-node>
Defines how your extension is built:
- variant: Base image type (
scratch,alpine, etc.) - dependencies: Required system packages and libraries
- steps: Build, install, and test phases
- finalize: What gets included in the final extension
Contains version-specific variables:
- Software version to build
- SHA256/SHA512 checksums for source verification
- Extension version tag
Defines the runtime behavior:
- Container security settings
- Entrypoint and arguments
- Environment variables
- Mount points and dependencies
- Add automated tests to verify multipath-tools functionality
- Create troubleshooting guide
- Add more example extensions (e.g., monitoring agents, storage drivers)
- Create a template generator script
This is a learning project. Feel free to:
- Experiment and break things
- Share your custom extensions
- Improve the documentation
- Report issues and suggest improvements
Remember: This is a playground - mistakes are learning opportunities! 🚀y