feat(crowdses): crowdses配置提交
这个提交包含在:
+29
-2
@@ -10,7 +10,7 @@ spec:
|
|||||||
valuesContent: |-
|
valuesContent: |-
|
||||||
container_runtime: containerd
|
container_runtime: containerd
|
||||||
image:
|
image:
|
||||||
tag: v1.6.1
|
tag: v1.6.1-2
|
||||||
config:
|
config:
|
||||||
config.yaml.local: |
|
config.yaml.local: |
|
||||||
db_config:
|
db_config:
|
||||||
@@ -20,4 +20,31 @@ spec:
|
|||||||
db_name: crowdsec
|
db_name: crowdsec
|
||||||
host: postgresql-ha-pgpool.infra-data
|
host: postgresql-ha-pgpool.infra-data
|
||||||
port: 5432
|
port: 5432
|
||||||
|
agent:
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: svccontroller.k3s.cattle.io/enablelb
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- "true"
|
||||||
|
acquisition:
|
||||||
|
- namespace: infra-net
|
||||||
|
podName: ingress-nginx-controller-*
|
||||||
|
program: nginx
|
||||||
|
env:
|
||||||
|
- name: COLLECTIONS
|
||||||
|
value: "crowdsecurity/nginx"
|
||||||
|
lapi:
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- weight: 1
|
||||||
|
preference:
|
||||||
|
matchExpressions:
|
||||||
|
- key: kubernetes.io/hostname
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- alihka
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
### 调试
|
### 调试
|
||||||
```shell
|
```shell
|
||||||
kubectl run -i --tty --rm --restart=Never \
|
kubectl run -i --tty --rm --restart=Never \
|
||||||
--overrides='{"apiVersion": "v1", "spec": {"nodeSelector": {"kubernetes.io/hostname": "tcc"}}}' \
|
--overrides='{"apiVersion": "v1", "spec": {"nodeSelector": {"kubernetes.io/hostname": "homea"}}}' \
|
||||||
--image=busybox:1.28 \
|
--image=busybox:1.28 \
|
||||||
debug -- sh
|
debug -- sh
|
||||||
```
|
```
|
||||||
|
|||||||
+35
-4
@@ -25,7 +25,6 @@ spec:
|
|||||||
operator: "Exists"
|
operator: "Exists"
|
||||||
effect: "NoSchedule"
|
effect: "NoSchedule"
|
||||||
kind: DaemonSet
|
kind: DaemonSet
|
||||||
hostNetwork: true
|
|
||||||
dnsPolicy: None
|
dnsPolicy: None
|
||||||
dnsConfig:
|
dnsConfig:
|
||||||
nameservers:
|
nameservers:
|
||||||
@@ -38,8 +37,6 @@ spec:
|
|||||||
enabled: false
|
enabled: false
|
||||||
publishService:
|
publishService:
|
||||||
enabled: false
|
enabled: false
|
||||||
extraArgs:
|
|
||||||
default-ssl-certificate: "infra-net/dev-cm-crt"
|
|
||||||
config:
|
config:
|
||||||
use-forwarded-headers: "true"
|
use-forwarded-headers: "true"
|
||||||
allow-snippet-annotations: "true"
|
allow-snippet-annotations: "true"
|
||||||
@@ -47,4 +44,38 @@ spec:
|
|||||||
proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=cache:2m max_size=100m inactive=7d use_temp_path=off;
|
proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=cache:2m max_size=100m inactive=7d use_temp_path=off;
|
||||||
proxy_cache_key $scheme$proxy_host$request_uri;
|
proxy_cache_key $scheme$proxy_host$request_uri;
|
||||||
proxy_cache_lock on;
|
proxy_cache_lock on;
|
||||||
proxy_cache_use_stale updating;
|
proxy_cache_use_stale updating;
|
||||||
|
server-snippet : |
|
||||||
|
resolver 169.254.20.10 10.43.0.10 ipv6=off;
|
||||||
|
# crowdsec插件配置
|
||||||
|
plugins: "crowdsec"
|
||||||
|
lua-shared-dicts: "crowdsec_cache: 50m"
|
||||||
|
extraArgs:
|
||||||
|
default-ssl-certificate: "infra-net/dev-cm-crt"
|
||||||
|
# crowdsec插件配置
|
||||||
|
extraVolumes:
|
||||||
|
- name: crowdsec-bouncer-plugin
|
||||||
|
emptyDir: {}
|
||||||
|
extraInitContainers:
|
||||||
|
- name: init-clone-crowdsec-bouncer
|
||||||
|
image: devcm/lua-bouncer-plugin
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
env:
|
||||||
|
- name: API_URL
|
||||||
|
value: "http://crowdsec-service.infra-monitor.svc.cluster.local:8080"
|
||||||
|
- name: API_KEY
|
||||||
|
value: "OKMrkF5QolkRMx0LRW1xzgy6uu+iJK+qlfJhgNyHSVg"
|
||||||
|
- name: BOUNCER_CONFIG
|
||||||
|
value: "/crowdsec/crowdsec-bouncer.conf"
|
||||||
|
- name: MODE
|
||||||
|
value: "stream"
|
||||||
|
- name: UPDATE_FREQUENCY
|
||||||
|
value: "60"
|
||||||
|
command: ['sh', '-c', "bash /docker_start.sh; mkdir -p /lua_plugins/crowdsec/; cp -R /crowdsec/* /lua_plugins/crowdsec/"]
|
||||||
|
volumeMounts:
|
||||||
|
- name: crowdsec-bouncer-plugin
|
||||||
|
mountPath: /lua_plugins
|
||||||
|
extraVolumeMounts:
|
||||||
|
- name: crowdsec-bouncer-plugin
|
||||||
|
mountPath: /etc/nginx/lua/plugins/crowdsec
|
||||||
|
subPath: crowdsec
|
||||||
在新议题中引用
屏蔽一个用户