Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:19:50 +08:00
commit b5f83de0d9
10 changed files with 391 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
{
"name": "load-balancer-configurator",
"description": "Configure load balancers (ALB, NLB, Nginx, HAProxy)",
"version": "1.0.0",
"author": {
"name": "Claude Code Plugins",
"email": "[email protected]"
},
"skills": [
"./skills"
],
"commands": [
"./commands"
]
}

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# load-balancer-configurator
Configure load balancers (ALB, NLB, Nginx, HAProxy)

25
commands/load-balance.md Normal file
View File

@@ -0,0 +1,25 @@
---
description: $(echo "$description" | cut -d' ' -f1-5)
---
# $(echo "$name" | sed 's/-/ /g' | sed 's/\b\(.\)/\u\1/g')
$(echo "$description")
## Key Features
- Production-ready configurations
- Best practices implementation
- Security-first approach
- Scalable architecture
- Comprehensive documentation
- Multi-platform support
## Example Usage
This plugin generates complete configurations for your DevOps needs.
Specify your requirements and get production-ready code instantly.
## When Invoked
Generate configurations and setup code based on your specific requirements and infrastructure needs.

69
plugin.lock.json Normal file
View File

@@ -0,0 +1,69 @@
{
"$schema": "internal://schemas/plugin.lock.v1.json",
"pluginId": "gh:jeremylongshore/claude-code-plugins-plus:plugins/devops/load-balancer-configurator",
"normalized": {
"repo": null,
"ref": "refs/tags/v20251128.0",
"commit": "711b929f38f3bcfa63863df010a6d4e23b03ce00",
"treeHash": "0a74d39b40bc53e89911cd16a0b9fceb48f3f6999825e56507cadd0cc4fb8db6",
"generatedAt": "2025-11-28T10:18:32.008345Z",
"toolVersion": "publish_plugins.py@0.2.0"
},
"origin": {
"remote": "git@github.com:zhongweili/42plugin-data.git",
"branch": "master",
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
},
"manifest": {
"name": "load-balancer-configurator",
"description": "Configure load balancers (ALB, NLB, Nginx, HAProxy)",
"version": "1.0.0"
},
"content": {
"files": [
{
"path": "README.md",
"sha256": "245b5824110b18edf6188df0d86f29814a115a6fda3fd93343aeff13997b269d"
},
{
"path": ".claude-plugin/plugin.json",
"sha256": "e61884819990947e71eb33652a663d9bbfe35eacdee9e41e6af71574b92cf793"
},
{
"path": "commands/load-balance.md",
"sha256": "353f80054a90cda1e6716da3628115ce829307fbbb83a15b64f1d37c96224a99"
},
{
"path": "skills/load-balancer-configurator/SKILL.md",
"sha256": "16d9a6cc4166bb1e1f329f97040d79771ada7212ae1c53038cfc6bc3750ae7cb"
},
{
"path": "skills/load-balancer-configurator/references/README.md",
"sha256": "bd78773c552a37c66710fa280824d0a665041557dbeb12f9d4487bf086a8bc9c"
},
{
"path": "skills/load-balancer-configurator/scripts/README.md",
"sha256": "b9e680c8df59ef84bbc160c9a74b2cf55218d0f903e34ff5b2ae0aac1e895d48"
},
{
"path": "skills/load-balancer-configurator/assets/haproxy_template.conf",
"sha256": "0028424d6b2b2bdc8e26e145d61c12f332cada46e17820e693d94f761680ea4f"
},
{
"path": "skills/load-balancer-configurator/assets/README.md",
"sha256": "8c23059a1ffae53d7a12183e3e27c185e5d460007caf913df1b24604244f3f80"
},
{
"path": "skills/load-balancer-configurator/assets/nginx_template.conf",
"sha256": "f3ff883d1d0f367b92b79f0197ddffc15dfd4ff551566588d8b257b03b1f8d7c"
}
],
"dirSha256": "0a74d39b40bc53e89911cd16a0b9fceb48f3f6999825e56507cadd0cc4fb8db6"
},
"security": {
"scannedAt": null,
"scannerVersion": null,
"flags": []
}
}

View File

@@ -0,0 +1,52 @@
---
name: configuring-load-balancers
description: |
This skill configures load balancers, including ALB, NLB, Nginx, and HAProxy. It generates production-ready configurations based on specified requirements and infrastructure. Use this skill when the user asks to "configure load balancer", "create load balancer config", "generate nginx config", "setup HAProxy", or mentions specific load balancer types like "ALB" or "NLB". It's ideal for DevOps tasks, infrastructure automation, and generating load balancer configurations for different environments.
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
version: 1.0.0
---
## Overview
This skill enables Claude to generate complete and production-ready configurations for various load balancers. It supports ALB, NLB, Nginx, and HAProxy, providing a streamlined approach to infrastructure automation and DevOps tasks.
## How It Works
1. **Receiving Requirements**: The skill receives user specifications for the load balancer configuration, including type, ports, protocols, and other relevant details.
2. **Generating Configuration**: Based on the user's requirements, the skill generates a complete configuration file tailored to the specified load balancer type.
3. **Presenting Configuration**: The generated configuration is presented to the user, ready for deployment.
## When to Use This Skill
This skill activates when you need to:
- Generate a load balancer configuration for a new application deployment.
- Modify an existing load balancer configuration to accommodate changes in traffic patterns or application requirements.
- Automate the creation of load balancer configurations as part of an infrastructure-as-code workflow.
## Examples
### Example 1: Setting up an Nginx Load Balancer
User request: "Configure an Nginx load balancer to distribute traffic between two backend servers on ports 8080 and 8081."
The skill will:
1. Generate an Nginx configuration file that includes upstream definitions for the two backend servers.
2. Present the complete Nginx configuration file to the user.
### Example 2: Creating an ALB Configuration
User request: "Create an ALB configuration for a web application running on port 80, with health checks on /health."
The skill will:
1. Generate an ALB configuration that includes listener rules, target groups, and health check settings.
2. Present the complete ALB configuration to the user, ready for deployment via AWS CloudFormation or Terraform.
## Best Practices
- **Security**: Always review generated configurations for security vulnerabilities before deploying them to production.
- **Testing**: Thoroughly test load balancer configurations in a staging environment before deploying them to production.
- **Documentation**: Document the purpose and configuration details of each load balancer for future reference.
## Integration
This skill can be integrated with other tools and plugins in the Claude Code ecosystem, such as infrastructure-as-code tools like Terraform and CloudFormation, to automate the deployment and management of load balancer configurations. It can also be used in conjunction with monitoring and logging tools to track the performance and health of load balancers.

View File

@@ -0,0 +1,8 @@
# Assets
Bundled resources for load-balancer-configurator skill
- [ ] nginx_template.conf: Template configuration file for Nginx load balancers.
- [ ] haproxy_template.conf: Template configuration file for HAProxy load balancers.
- [ ] alb_example.json: Example JSON configuration for AWS Application Load Balancers.
- [ ] nlb_example.json: Example JSON configuration for AWS Network Load Balancers.

View File

@@ -0,0 +1,93 @@
# HAProxy Configuration File
# This template is designed for production environments.
# Adjust the values below to match your specific needs.
#
# For detailed documentation, refer to: http://www.haproxy.org/download/1.8/doc/configuration.txt
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
ssl-default-bind-ciphers ECDH+AESGCM:!DH
ssl-default-bind-options no-sslv3
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
timeout http-request 10s
timeout http-keep-alive 15s
retries 3
option redispatch
option http-server-close
# Frontend: Incoming HTTP/HTTPS traffic
frontend http_frontend
bind *:80
mode http
# Add your ACLs and rules here for HTTP traffic
# Example:
# acl is_api path_beg /api
# use_backend api_backend if is_api
default_backend app_backend
frontend https_frontend
bind *:443 ssl crt /etc/haproxy/ssl/yourdomain.pem
mode http
# Add your ACLs and rules here for HTTPS traffic
# Example:
# acl is_api path_beg /api
# use_backend api_backend if is_api
http-request add-header X-Forwarded-Proto https
default_backend app_backend
# Backend: Application Servers
backend app_backend
balance roundrobin # Load balancing algorithm: roundrobin, leastconn, etc.
# Configure health checks
option httpchk GET /healthcheck # Replace with your application's health check endpoint
http-check expect status 200
# Add your application servers here
# Example:
server app1 <SERVER_IP_ADDRESS_1>:8080 check # Replace with your server IP and port
server app2 <SERVER_IP_ADDRESS_2>:8080 check # Replace with your server IP and port
server app3 <SERVER_IP_ADDRESS_3>:8080 check # Replace with your server IP and port
# Backend: API Servers (Example, if you have a separate API)
backend api_backend
balance leastconn
# Configure health checks
option httpchk GET /api/health # Replace with your API's health check endpoint
http-check expect status 200
# Add your API servers here
# Example:
server api1 <API_SERVER_IP_ADDRESS_1>:8081 check # Replace with your server IP and port
server api2 <API_SERVER_IP_ADDRESS_2>:8081 check # Replace with your server IP and port
# Statistics Page
listen stats
bind *:8080
mode http
stats enable
stats uri /haproxy_stats
stats realm Haproxy\ Statistics
stats auth <USERNAME>:<PASSWORD> # Replace with a strong username and password
stats admin if TRUE #Enable admin interface
# TCP Mode Backend (Example - for non-HTTP traffic)
# backend tcp_backend
# mode tcp
# balance roundrobin
# server tcp_server1 <TCP_SERVER_IP_ADDRESS_1>:3306 check
# server tcp_server2 <TCP_SERVER_IP_ADDRESS_2>:3306 check

View File

@@ -0,0 +1,109 @@
# Nginx Load Balancer Configuration Template
#
# This configuration is designed for use with the Load Balancer Configurator plugin.
# It provides a basic setup for load balancing across multiple upstream servers.
#
# To use this template:
# 1. Replace the placeholders with your actual server details.
# 2. Choose the appropriate load balancing method.
# 3. Test the configuration thoroughly before deploying to production.
# User under which nginx runs
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
# Upstream servers - Replace these with your actual server details
upstream backend {
# Load balancing method:
# - round-robin (default)
# - least_conn
# - ip_hash
# - url_hash (requires nginx plus)
# Example: least_conn;
server <SERVER_IP_1>:<SERVER_PORT_1> weight=5; # Replace with your server IP and port
server <SERVER_IP_2>:<SERVER_PORT_2> weight=5; # Replace with your server IP and port
server <SERVER_IP_3>:<SERVER_PORT_3> weight=3 backup; # Replace with your server IP and port, backup server
}
server {
listen 80; # Listen on port 80
server_name <DOMAIN_NAME>; # Replace with your domain name or IP address
# Enforce HTTPS redirection
# return 301 https://$host$request_uri;
# Optional: Configure HTTPS in a separate server block
location / {
proxy_pass http://backend; # Proxy requests to the upstream servers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Optional: Adjust timeouts for slow clients
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
}
# Optional: Add error page configuration
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# root /usr/share/nginx/html;
# }
}
# Optional: HTTPS Configuration (Requires SSL Certificates)
# server {
# listen 443 ssl http2;
# server_name <DOMAIN_NAME>; # Replace with your domain name
# ssl_certificate /etc/nginx/ssl/<DOMAIN_NAME>.crt; # Replace with your certificate path
# ssl_certificate_key /etc/nginx/ssl/<DOMAIN_NAME>.key; # Replace with your key path
# ssl_session_cache shared:SSL:10m;
# ssl_session_timeout 10m;
# ssl_protocols TLSv1.2 TLSv1.3;
# ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
# ssl_prefer_server_ciphers on;
# location / {
# proxy_pass http://backend;
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
# }
# }
# Load configuration files from the /etc/nginx/conf.d directory
include /etc/nginx/conf.d/*.conf;
}

View File

@@ -0,0 +1,10 @@
# References
Bundled resources for load-balancer-configurator skill
- [ ] alb_reference.md: Detailed documentation for configuring AWS Application Load Balancers.
- [ ] nlb_reference.md: Detailed documentation for configuring AWS Network Load Balancers.
- [ ] nginx_reference.md: Detailed documentation for configuring Nginx load balancers.
- [ ] haproxy_reference.md: Detailed documentation for configuring HAProxy load balancers.
- [ ] load_balancer_best_practices.md: Best practices for load balancer configuration and security.
- [ ] common_load_balancer_errors.md: A list of common errors and troubleshooting steps for load balancer configurations.

View File

@@ -0,0 +1,7 @@
# Scripts
Bundled resources for load-balancer-configurator skill
- [ ] generate_config.py: Generates load balancer configuration files based on specified parameters.
- [ ] validate_config.py: Validates the generated configuration files against best practices and common errors.
- [ ] deploy_config.sh: Deploys the generated configuration to the specified load balancer instance.