A command-line tool for managing Buildkite agent stacks in Kubernetes clusters.
- Interactive cluster selection - Browse and select from your Buildkite clusters
- Version management - Fetch and select agent-stack-k8s versions from GitHub releases
- Stack lifecycle management - Create, monitor, and delete agent stacks
- SSH key support - Generate and manage SSH keys for private repository access
- Multi-stack support - Handle multiple agent stacks in the same cluster
- Token management - Automatic cleanup of Buildkite agent tokens
- 🔐 Secure credential storage - API tokens stored in system keyring (Keychain/Secret Service/Credential Manager)
go install github.com/mcncl/kez@latestBinaries are available on the releases page.
- Go 1.21 or later
- Access to a Kubernetes cluster with
kubectlconfigured - Helm 3.x installed
- Buildkite API token (with
read_clustersandwrite_cluster_tokensscopes)
Configure your Buildkite API token:
kez configureThis will prompt you for your Buildkite API token and organization slug.
Create a new Buildkite agent stack:
kez stack createThis interactive command will:
- Fetch your available Buildkite clusters
- Prompt you to select a cluster
- Fetch available agent-stack-k8s versions from GitHub
- Prompt you to select a version
- Optionally generate SSH keys for private repositories
- Install the agent stack using Helm
You can specify options to skip interactive prompts:
# Use a specific version
kez stack create --version=0.28.1
# Suppress non-essential output
kez stack create --quiet
# Specify a custom stack name
kez stack create --name=my-custom-stackView the status of your agent stacks:
kez stack statusFor detailed information:
kez stack status --verboseRemove an agent stack:
kez stack deleteThe tool will automatically discover installed stacks and prompt you to select which one to delete. You can also specify:
# Delete a specific stack
kez stack delete --name=my-stack
# Delete all stacks
kez stack delete --all
# Skip confirmation prompts
kez stack delete --forceThe tool will interactively prompt you to configure SSH keys for accessing private repositories. It can:
- Use existing SSH keys from your ~/.ssh directory
- Generate a new SSH key pair if needed
- Store the private key as a Kubernetes secret
- Display the public key for you to add to your Git provider
You can run multiple agent stacks in the same cluster by giving them different names:
kez stack create --name=production-agents
kez stack create --name=development-agentsThe tool stores configuration in ~/.config/kez/config.json, including:
- Buildkite organization slug
- Recently used clusters
- Agent token metadata for cleanup
Security Note: Sensitive credentials (API tokens, agent tokens) are stored securely in your system's keyring, not in the config file.
--help- Show help information--version- Show version information
Set up Buildkite API credentials.
Create a new agent stack.
Options:
--version- Specify agent-stack-k8s version--name- Custom stack name (default: auto-generated)--quiet- Suppress non-essential output
Show status of installed agent stacks.
Options:
--verbose- Show detailed information--refresh- Force refresh of status information
Delete an agent stack.
Options:
--name- Specify stack name to delete--all- Delete all agent stacks--force- Skip confirmation prompts--timeout- Timeout for delete operations (default: 60s)--no-wait- Skip waiting for pod termination
# Build the binary
go build -o kez
# Run tests
go test ./...
# Format code
gofmt -w .cmd/- Command implementationsinternal/api/- Buildkite API clientinternal/config/- Configuration managementinternal/k8s/- Kubernetes utilitiesinternal/logger/- Logging utilities
MIT License - See LICENSE file for details