feat(cdn): cdn功能提交
这个提交包含在:
@@ -23,6 +23,12 @@ spec:
|
||||
hostNetwork: true
|
||||
hostPort:
|
||||
enabled: true
|
||||
# 添加 DNS 配置
|
||||
dnsPolicy: "None"
|
||||
dnsConfig:
|
||||
nameservers:
|
||||
- "169.254.20.10"
|
||||
- "10.43.0.10"
|
||||
service:
|
||||
enabled: false
|
||||
publishService:
|
||||
@@ -52,6 +58,12 @@ spec:
|
||||
server-snippet: |
|
||||
# dns配置 配置在http块下会出现重复配置 所以配置在server块下
|
||||
resolver 169.254.20.10 10.43.0.10 ipv6=off;
|
||||
# 代理全局静态资源 可提供serviceWorker的支持
|
||||
location ^~ /__static/ {
|
||||
proxy_pass http://ingress-nginx-defaultbackend.infra-net.svc.cluster.local/static/;
|
||||
proxy_set_header Host $host;
|
||||
add_header Service-Worker-Allowed "/";
|
||||
}
|
||||
# 启用geoip2模块
|
||||
use-geoip: "false"
|
||||
use-geoip2: "true"
|
||||
@@ -107,7 +119,7 @@ spec:
|
||||
plugins: "crowdsec"
|
||||
lua-shared-dicts: "crowdsec_cache: 50m"
|
||||
# 启用geoip2模块
|
||||
maxmindLicenseKey: "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"
|
||||
maxmindLicenseKey: "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"
|
||||
extraArgs:
|
||||
default-ssl-certificate: "infra-net/dev-cm-crt"
|
||||
# crowdsec插件配置
|
||||
@@ -137,7 +149,7 @@ spec:
|
||||
- name: SECRET_KEY
|
||||
value: "0x4AAAAAAAxJ2dwFOaNg5ae3c6wYTmWH0bU"
|
||||
- name: CAPTCHA_TEMPLATE_PATH
|
||||
value: /etc/nginx/lua/plugins/crowdsec/templates/captcha.html
|
||||
value: /etc/nginx/static/captcha.html
|
||||
command: ['sh', '-c', "bash /docker_start.sh; mkdir -p /lua_plugins/crowdsec/; cp -R /crowdsec/* /lua_plugins/crowdsec/"]
|
||||
volumeMounts:
|
||||
- name: crowdsec-bouncer-plugin
|
||||
@@ -145,26 +157,33 @@ spec:
|
||||
extraVolumes:
|
||||
- name: crowdsec-bouncer-plugin
|
||||
emptyDir: {}
|
||||
- name: custom-html
|
||||
- name: static
|
||||
configMap:
|
||||
name: custom-html
|
||||
name: static
|
||||
extraVolumeMounts:
|
||||
- name: crowdsec-bouncer-plugin
|
||||
mountPath: /etc/nginx/lua/plugins/crowdsec
|
||||
subPath: crowdsec
|
||||
- name: custom-html
|
||||
mountPath: /etc/nginx/lua/plugins/crowdsec/templates
|
||||
- name: static
|
||||
mountPath: /etc/nginx/static
|
||||
defaultBackend:
|
||||
enabled: true
|
||||
image:
|
||||
registry: docker.io
|
||||
image: devcm/default-backend
|
||||
tag: v0.1.0
|
||||
tag: v0.2.0
|
||||
autoscaling:
|
||||
enabled: true
|
||||
minReplicas: 1
|
||||
maxReplicas: 3
|
||||
targetCPUUtilizationPercentage: 80
|
||||
extraVolumes:
|
||||
- name: static
|
||||
configMap:
|
||||
name: static
|
||||
extraVolumeMounts:
|
||||
- name: static
|
||||
mountPath: /app/static
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
|
||||
在新议题中引用
屏蔽一个用户