feat: 更新OCI Provider版本至7.20并集成Vault配置
refactor: 重构Terraform配置以使用Consul和Vault存储敏感信息 docs: 添加Vault实施文档和配置指南 chore: 清理不再使用的配置文件和脚本 feat: 添加Nomad集群领导者发现脚本和文档 feat: 实现MCP配置共享方案和同步脚本 style: 更新README中的网络访问注意事项 test: 添加Consul Provider集成测试脚本
This commit is contained in:
58
configs/dynamic/config.yml
Normal file
58
configs/dynamic/config.yml
Normal file
@@ -0,0 +1,58 @@
|
||||
# Traefik动态配置文件
|
||||
# 这里可以添加动态路由、中间件等配置
|
||||
|
||||
# HTTP路由示例
|
||||
http:
|
||||
routers:
|
||||
# 测试路由
|
||||
test-router:
|
||||
rule: "Host(`test.service.consul`)"
|
||||
service: "test-service"
|
||||
entryPoints:
|
||||
- "https"
|
||||
tls:
|
||||
certResolver: "default"
|
||||
|
||||
services:
|
||||
# 测试服务
|
||||
test-service:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: "http://127.0.0.1:8080"
|
||||
passHostHeader: true
|
||||
|
||||
middlewares:
|
||||
# 基本认证中间件
|
||||
basic-auth:
|
||||
basicAuth:
|
||||
users:
|
||||
- "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
|
||||
|
||||
# 安全头中间件
|
||||
security-headers:
|
||||
headers:
|
||||
sslRedirect: true
|
||||
stsSeconds: 31536000
|
||||
stsIncludeSubdomains: true
|
||||
stsPreload: true
|
||||
forceSTSHeader: true
|
||||
customFrameOptionsValue: "SAMEORIGIN"
|
||||
contentTypeNosniff: true
|
||||
browserXssFilter: true
|
||||
|
||||
# TCP路由示例
|
||||
tcp:
|
||||
routers:
|
||||
# TCP测试路由
|
||||
tcp-test-router:
|
||||
rule: "HostSNI(`*`)"
|
||||
service: "tcp-test-service"
|
||||
entryPoints:
|
||||
- "https"
|
||||
|
||||
services:
|
||||
# TCP测试服务
|
||||
tcp-test-service:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- address: "127.0.0.1:8080"
|
||||
38
configs/prometheus.yml
Normal file
38
configs/prometheus.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
evaluation_interval: 15s
|
||||
|
||||
rule_files:
|
||||
# - "first_rules.yml"
|
||||
# - "second_rules.yml"
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'prometheus'
|
||||
static_configs:
|
||||
- targets: ['localhost:9090']
|
||||
|
||||
- job_name: 'openfaas'
|
||||
static_configs:
|
||||
- targets: ['gateway:8080']
|
||||
metrics_path: /metrics
|
||||
scrape_interval: 15s
|
||||
scrape_timeout: 10s
|
||||
|
||||
- job_name: 'nats'
|
||||
static_configs:
|
||||
- targets: ['nats:8222']
|
||||
metrics_path: /metrics
|
||||
scrape_interval: 15s
|
||||
scrape_timeout: 10s
|
||||
|
||||
- job_name: 'node-exporter'
|
||||
static_configs:
|
||||
- targets: ['node-exporter:9100']
|
||||
scrape_interval: 15s
|
||||
scrape_timeout: 10s
|
||||
|
||||
- job_name: 'cadvisor'
|
||||
static_configs:
|
||||
- targets: ['cadvisor:8080']
|
||||
scrape_interval: 15s
|
||||
scrape_timeout: 10s
|
||||
63
configs/traefik.yml
Normal file
63
configs/traefik.yml
Normal file
@@ -0,0 +1,63 @@
|
||||
# Traefik静态配置文件
|
||||
global:
|
||||
sendAnonymousUsage: false
|
||||
|
||||
# API和仪表板配置
|
||||
api:
|
||||
dashboard: true
|
||||
insecure: true # 仅用于测试,生产环境应使用安全配置
|
||||
|
||||
# 入口点配置
|
||||
entryPoints:
|
||||
http:
|
||||
address: ":80"
|
||||
# 重定向HTTP到HTTPS
|
||||
http:
|
||||
redirections:
|
||||
entryPoint:
|
||||
to: https
|
||||
scheme: https
|
||||
https:
|
||||
address: ":443"
|
||||
api:
|
||||
address: ":8080"
|
||||
|
||||
# 提供者配置
|
||||
providers:
|
||||
# 启用Consul Catalog提供者
|
||||
consulCatalog:
|
||||
exposedByDefault: false
|
||||
prefix: "traefik"
|
||||
refreshInterval: 15s
|
||||
requireConsistent: true
|
||||
stale: false
|
||||
watch: true
|
||||
endpoint:
|
||||
address: "http://127.0.0.1:8500"
|
||||
scheme: "http"
|
||||
connectAware: true
|
||||
connectByDefault: false
|
||||
|
||||
# 启用Nomad提供者
|
||||
nomad:
|
||||
exposedByDefault: false
|
||||
prefix: "traefik"
|
||||
refreshInterval: 15s
|
||||
stale: false
|
||||
watch: true
|
||||
endpoint:
|
||||
address: "http://127.0.0.1:4646"
|
||||
scheme: "http"
|
||||
allowEmptyServices: true
|
||||
|
||||
# 日志配置
|
||||
log:
|
||||
level: "INFO"
|
||||
format: "json"
|
||||
|
||||
accessLog:
|
||||
format: "json"
|
||||
fields:
|
||||
defaultMode: "keep"
|
||||
headers:
|
||||
defaultMode: "keep"
|
||||
Reference in New Issue
Block a user