๐ฏ A carefully crafted set of Kubectl automation tools that make K8s daily operations simple and efficient!
- ๐ Simplified Commands: Intuitive shortcuts for complex kubectl operations
- ๐ Smart Completion: Context-aware auto-completion for namespaces, pods, and services
- ๐ Enhanced Logging: Advanced log viewing and searching across pods
- ๐ ๏ธ Resource Management: Flexible resource viewing and interaction
- โก Quick Installation: Easy setup in new environments
Choose one of the following methods to install:
curl -fsSL https://raw.githubusercontent.com/perfumescent/Kubectl-Plus/main/install.sh | bash# Clone repository
git clone https://github.com/perfumescent/Kubectl-Plus.git
cd Kubectl-Plus
# Run installer
./install.shThe installer will:
- Check system requirements
- Install commands to your PATH
- Configure shell completion
- Set up your preferred namespace
- kubectl installed and configured
- bash or zsh shell
- Linux/macOS operating system
# Basic usage
kp p # View pods in default namespace (wide output)
kp p svc # View services
kp p deploy # View deployments
# Advanced options
kp p -n prod # Specify namespace
kp p -l app=nginx # Filter by label
kp p -o yaml # Output in YAML format
kp p -A # List across all namespaces
kp p -S name # Sort by name
# Combined usage
kp p -n prod -l tier=frontend -S status # View sorted pods with label in prod
kp p deploy -A -o wide # View all deployments in wide format# Basic usage
kp i nginx # Enter pod with default shell
kp i nginx -c side-car # Enter specific container
kp i nginx -- ls /etc # Execute command without entering
kp i nginx -s bash # Use bash as shell
# Advanced options
kp i nginx -n prod # Specify namespace
kp i nginx -u root # Run as root user
kp i nginx -c nginx -s bash # Enter nginx container with bash# Basic usage
kp l pod-name # View latest pod logs (last 500 lines)
kp l pod-name pattern # Search logs with pattern (with context)
# Advanced options
kp l pod-name -n namespace # Specify namespace
kp l pod-name -c container # Specify container
kp l pod-name -p /logs/*.log # View logs from custom path (supports wildcards)
kp l pod-name -s pattern # Display logs starting from first pattern match
kp l pod-name -t 1000 # Show last 1000 lines
kp l pod-name -f # Follow log output# Basic usage
kp f service-name pattern # Search pattern in all pods of the service
# (with colored output and context separator)
# Advanced options
kp f service-name -n namespace pattern # Specify namespace
kp f service-name -c container pattern # Specify container
kp f service-name -p /logs/*.log pattern # Search in custom log path
kp f service-name pattern -C 5 # Show 5 lines of context
kp f service-name pattern -t 100 # Show last 100 matching linesAll commands come with intelligent auto-completion support that makes your K8s operations smoother and faster!
# Complete main command
kp [Tab] # Shows all available subcommands (l, f, i, p)
# Complete subcommand options
kp l -[Tab] # Shows all options for log command
kp i --[Tab] # Shows all long options for pod access command# Complete namespace parameter
kp l --n[Tab] # Completes to: kp l --namespace
kp l -n[Tab] # Completes to: kp l -n
# Complete namespace after -n or --namespace
kp l -n pro[Tab] # Completes to: kp l -n production
kp i -n stag[Tab] # Completes to: kp i -n staging
kp f -n dev[Tab] # Completes to: kp f -n development
kp p -n [Tab] # Shows all available namespaces# Complete pod names (context-aware of namespace)
kp l ng[Tab] # Shows nginx pods in current namespace
kp i -n prod ng[Tab] # Shows nginx pods in prod namespace
# Complete service names
kp f ng[Tab] # Shows nginx services
kp f -n prod ng[Tab] # Shows nginx services in prod namespace
# Complete resource types for p command
kp p dep[Tab] # Completes to: kp p deploy
kp p [Tab] # Shows all resource types (pod/svc/deploy/rs/sts)# Complete command options
kp p -[Tab] # Shows all options (-n, -w, -l, -o, -A, -S)
kp i --[Tab] # Shows all long options (--namespace, --container, etc)
# Complete option values
kp p -o [Tab] # Shows output formats (json/yaml/wide/custom)
kp p -S [Tab] # Shows sort fields (name/status/age)
kp i -s [Tab] # Shows available shells (sh/bash/zsh)We warmly welcome all forms of contributions! Here are some areas we're focusing on:
-
Command Extensions
- Service restart automation
- Quick config file modification
- Resource usage monitoring
- Multi-cluster management
-
Feature Enhancements
- Advanced log analysis
- Resource usage statistics
- Common issue diagnostics
- Visualization interface
-
User Experience
- Enhanced error messages
- Command execution history
- More customization options
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
If you find this project helpful, please give it a star! Your support drives our continuous improvement!