A friendly Slack bot for managing Kubernetes clusters with a clean, well-structured codebase.
spoticus/
├── cmd/spoticus/ # Application entry point
│ └── main.go # Main application
├── internal/ # Internal packages
│ ├── app/ # Application management
│ │ ├── app.go # Main app initialization
│ │ └── schema_registry.go # Kubernetes schema registration
│ ├── k8s/ # Kubernetes client
│ │ └── client.go # K8s client wrapper
│ ├── logger/ # Logging system
│ │ └── logger.go # Centralized logging
│ └── slack/ # Slack integration
│ ├── bot.go # Slack bot management
│ ├── commands/ # Command system
│ │ ├── interface.go # Command interface
│ │ ├── registry.go # Command registry
│ │ └── launch/ # Launch command
│ │ ├── command.go # Main command logic
│ │ ├── cluster.go # Cluster operations
│ │ ├── messages.go # Slack messaging
│ │ ├── types.go # Data types
│ │ └── utils.go # Utilities
│ ├── events/ # Event handling
│ │ └── events.go # Event processing
│ └── handlers/ # Message handlers
│ └── handlers.go # Message routing
├── go.mod # Go modules
├── go.sum # Dependencies
├── Makefile # Build automation
└── README.md # This file
- Clean Architecture: Well-organized, modular code structure
- Friendly Interface: User-friendly Slack commands and messages
- Kubernetes Integration: Direct K8s cluster management
- Structured Logging: Centralized logging with Zap
- Error Handling: Robust error handling and user feedback
- Type Safety: Strong typing throughout the codebase
launch <cluster_type> <size>
Examples:
launch kubernetes large
launch openshift medium
Supported Sizes:
medium
- 8 CPUs, 32 GB RAMlarge
- 16 CPUs, 64 GB RAMxlarge
- 32 CPUs, 128 GB RAM
-
Set Environment Variables:
export SLACK_BOT_TOKEN="your-bot-token" export SLACK_APP_TOKEN="your-app-token" export DEBUG="true" # Optional: enable debug logging
-
Build and Run:
make build ./bin/spoticus
- App Package: Centralized application management
- K8s Client: Clean Kubernetes operations wrapper
- Slack Bot: Modular bot with event handling
- Command System: Extensible command registry
- Logger: Structured logging with context
- Separation of Concerns: Each package has a clear responsibility
- Dependency Injection: Clean dependency management
- Error Handling: Comprehensive error handling and user feedback
- Logging: Structured logging with context and levels
- Type Safety: Strong typing throughout
make build
make test
make run
- Clean Names: Friendly, descriptive function and variable names
- Modular Design: Small, focused functions and packages
- Clear Comments: Helpful comments for complex logic
- Consistent Formatting: Go fmt compliance
- Error Handling: Proper error propagation and user feedback
- Follow the existing code structure
- Use friendly, descriptive names
- Add appropriate logging
- Handle errors gracefully
- Keep functions small and focused
This project is licensed under the MIT License.