proxy-pool/deploy/kubernetes/base/configmap.yaml

174 lines
4.5 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: proxy-pool-config
namespace: proxy-pool
data:
config.yaml: |
version: 1
security:
requireProtectionOnPublicListen: true
gateway:
enabled: true
listen: 0.0.0.0:8080
access:
allowCIDRs: [0.0.0.0/0]
trustedProxies: []
auth:
mode: usernamePassword
username: "${PROXY_POOL_GATEWAY_USERNAME}"
password: "${PROXY_POOL_GATEWAY_PASSWORD}"
limits:
maxConcurrentConnections: 100000
requestsPerMinutePerClient: 60000
retry:
maxAttempts: 2
retryMethods: [GET, HEAD]
destinationPolicy:
denyPrivateNetworks: true
denyLoopback: true
denyLinkLocal: true
denyCIDRs: [169.254.169.254/32]
distribution:
enabled: true
listen: 0.0.0.0:8081
access:
allowCIDRs: [10.0.0.0/8]
trustedProxies: [10.0.0.0/8]
auth:
mode: apiKey
header: X-API-Key
token: "${PROXY_POOL_EXTRACT_TOKEN}"
limits:
requestsPerMinute: 30000
requestsPerMinutePerClient: 3000
clientIdentification:
mode: sourceIP
extraction:
fulfillment: partial
maxCountPerRequest: 100
minRemainingTTL: 30s
maxHealthCheckAge: 30s
reserveForGateway: 5000
admin:
enabled: true
listen: 0.0.0.0:8082
access:
allowCIDRs: [10.0.0.0/8]
auth:
mode: apiKey
header: X-Admin-Key
token: "${PROXY_POOL_ADMIN_TOKEN}"
metrics:
enabled: true
listen: 0.0.0.0:9090
storage:
postgresURL: "${PROXY_POOL_POSTGRES_URL}"
redisURL: "${PROXY_POOL_REDIS_URL}"
routing:
- name: gateway-default
enabled: true
purpose: gateway
upstreams: [provider-a, provider-b]
strategy:
type: sequential
switchAfterEmptyFetch: 5
endBehavior: stayLast
onUnavailable:
action: reject
- name: extract-default
enabled: true
purpose: extract
upstreams: [provider-a, provider-b]
strategy:
type: sequential
switchAfterEmptyFetch: 5
endBehavior: stayLast
onUnavailable:
action: reject
upstreams:
provider-a:
enabled: true
exposure: [gateway, extract]
provider:
billingMode: fetch
protocols: [http]
api:
url: https://PROVIDER_A_HOST/api/proxies
method: GET
auth:
type: apiKey
location: header
name: Authorization
value: "${PROVIDER_A_TOKEN}"
template: '{{ . }}'
proxyAuth:
type: response
pool:
maxSize: 25000
shrinkDelay: 30s
capacity:
maxConcurrencyPerProxy: 20
lifecycle:
ttl: 5m
allocationSafetyMargin: 20s
fetch:
requestInterval: 1s
timeout: 3s
maxAttempts: 3
maxInFlight: 1
maxTotal: 1000000
maxResponseBytes: 4194304
templateTimeout: 100ms
retry: {initial: 500ms, max: 30s, jitter: 20}
check:
interval: 30s
jitter: 20
maxInFlight: 500
timeout: 3s
maxAttempts: 2
maxConsecutiveFailures: 3
urls: [https://example.com/]
provider-b:
enabled: true
exposure: [gateway, extract]
provider:
billingMode: fetch
protocols: [http]
api:
url: https://PROVIDER_B_HOST/api/proxies
method: GET
auth:
type: apiKey
location: header
name: Authorization
value: "${PROVIDER_B_TOKEN}"
template: '{{ . }}'
proxyAuth:
type: response
pool:
maxSize: 25000
shrinkDelay: 30s
capacity:
maxConcurrencyPerProxy: 20
lifecycle:
ttl: 5m
allocationSafetyMargin: 20s
fetch:
requestInterval: 1s
timeout: 3s
maxAttempts: 3
maxInFlight: 1
maxTotal: 1000000
maxResponseBytes: 4194304
templateTimeout: 100ms
retry: {initial: 500ms, max: 30s, jitter: 20}
check:
interval: 30s
jitter: 20
maxInFlight: 500
timeout: 3s
maxAttempts: 2
maxConsecutiveFailures: 3
urls: [https://example.com/]