feat(nginx): 缓存优化
这个提交包含在:
@@ -36,6 +36,16 @@ spec:
|
|||||||
enabled: false
|
enabled: false
|
||||||
image:
|
image:
|
||||||
tag: 1.22.0
|
tag: 1.22.0
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
className: nginx
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/proxy-body-size: "50m"
|
||||||
|
hosts:
|
||||||
|
- host: git.dev.cm
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
gitea:
|
gitea:
|
||||||
config:
|
config:
|
||||||
APP_NAME: Git.dev.cm
|
APP_NAME: Git.dev.cm
|
||||||
|
|||||||
@@ -1,28 +1,7 @@
|
|||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: gitea-http
|
name: gitea-static
|
||||||
namespace: infra-devops
|
|
||||||
annotations:
|
|
||||||
nginx.ingress.kubernetes.io/proxy-body-size: "50m"
|
|
||||||
spec:
|
|
||||||
ingressClassName: nginx
|
|
||||||
rules:
|
|
||||||
- host: git.dev.cm
|
|
||||||
http:
|
|
||||||
paths:
|
|
||||||
- pathType: Prefix
|
|
||||||
path: "/"
|
|
||||||
backend:
|
|
||||||
service:
|
|
||||||
name: gitea-http
|
|
||||||
port:
|
|
||||||
number: 3000
|
|
||||||
---
|
|
||||||
apiVersion: networking.k8s.io/v1
|
|
||||||
kind: Ingress
|
|
||||||
metadata:
|
|
||||||
name: gitea-http-static
|
|
||||||
namespace: infra-devops
|
namespace: infra-devops
|
||||||
annotations:
|
annotations:
|
||||||
nginx.ingress.kubernetes.io/use-regex: "true"
|
nginx.ingress.kubernetes.io/use-regex: "true"
|
||||||
@@ -48,4 +27,4 @@ spec:
|
|||||||
service:
|
service:
|
||||||
name: gitea-http
|
name: gitea-http
|
||||||
port:
|
port:
|
||||||
number: 3000
|
number: 3000
|
||||||
@@ -25,6 +25,8 @@ spec:
|
|||||||
agent:
|
agent:
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
svccontroller.k3s.cattle.io/enablelb: "true"
|
svccontroller.k3s.cattle.io/enablelb: "true"
|
||||||
|
# 由于使用了loki搜集日志 此处不再需要 所以使用此标签 禁用所有的agent
|
||||||
|
crowdsec/enabled: "true"
|
||||||
acquisition:
|
acquisition:
|
||||||
- namespace: infra-net
|
- namespace: infra-net
|
||||||
podName: ingress-nginx-controller-*
|
podName: ingress-nginx-controller-*
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ spec:
|
|||||||
podMonitorSelectorNilUsesHelmValues: false
|
podMonitorSelectorNilUsesHelmValues: false
|
||||||
ruleSelectorNilUsesHelmValues: false
|
ruleSelectorNilUsesHelmValues: false
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: false
|
||||||
ingressClassName: nginx
|
ingressClassName: nginx
|
||||||
hosts:
|
hosts:
|
||||||
- monitor.dev.cm
|
- monitor.dev.cm
|
||||||
@@ -97,9 +97,9 @@ spec:
|
|||||||
storage: 10Gi
|
storage: 10Gi
|
||||||
routePrefix: /alertmanager
|
routePrefix: /alertmanager
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: false
|
||||||
ingressClassName: nginx
|
ingressClassName: nginx
|
||||||
hosts:
|
hosts:
|
||||||
- monitor.dev.cm
|
- monitor.dev.cm
|
||||||
paths:
|
paths:
|
||||||
- /alertmanager
|
- /alertmanager
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: grafana-static
|
||||||
|
namespace: infra-monitor
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/use-regex: "true"
|
||||||
|
nginx.ingress.kubernetes.io/proxy-buffering: "on"
|
||||||
|
nginx.ingress.kubernetes.io/configuration-snippet: |
|
||||||
|
proxy_cache cache;
|
||||||
|
proxy_cache_valid 200 302 1d;
|
||||||
|
proxy_cache_valid 404 10m;
|
||||||
|
proxy_cache_valid any 1h;
|
||||||
|
proxy_cache_use_stale error timeout updating http_404 http_500 http_502 http_503 http_504;
|
||||||
|
proxy_cache_bypass $http_x_purge;
|
||||||
|
proxy_ignore_headers Cache-Control;
|
||||||
|
add_header X-Cache-Status $upstream_cache_status;
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: monitor.dev.cm
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /(public|avatar)/.*
|
||||||
|
pathType: ImplementationSpecific
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: prometheus-grafana
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
在新议题中引用
屏蔽一个用户