Skip to content

Commit 2d357ef

Browse files
committed
improved docs
1 parent 9522a1c commit 2d357ef

File tree

1 file changed

+48
-5
lines changed

1 file changed

+48
-5
lines changed

crowdsec-docs/unversioned/getting_started/installation/kubernetes.mdx

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ import CodeBlock from '@theme/CodeBlock';
1212

1313
# Kubernetes Deployment
1414

15-
Before getting started, it is advised to read the [introduction](/unversioned/getting_started/introduction.mdx) page to understand the prerequisites and concepts for running CrowdSec.
15+
Before getting started, it is advised to read the
16+
[introduction](/unversioned/getting_started/introduction.mdx) page to understand
17+
the prerequisites and concepts for running CrowdSec.
1618

1719
## Requirements
1820

1921
- [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
2022
- [Helm](https://helm.sh/docs/intro/install/)
2123

22-
Even if an installation could be possible without Helm, it's not supported for now.
24+
Even if an installation could be possible without Helm, it's not documented for now.
2325

2426
## Helm Repository Installation
2527

@@ -60,7 +62,32 @@ lapi:
6062
value: "k8s linux test"
6163
```
6264
63-
If you want more information about the configuration, you can check the default [values.yaml](https://artifacthub.io/packages/helm/crowdsec/crowdsec#values)
65+
Acquisition is done by reading logs directly from pods. You select which pods to
66+
watch thanks to `namespace` and `podName`, and you have to tag the logs with a
67+
program so CrowdSec knows which parser should handle them. For example, if you
68+
set program: nginx, the nginx parser will pick them up. CrowdSec will
69+
automatically attach to the right pods and feed the logs into the right parsers.
70+
71+
<detail>
72+
<summary>Why `program` and not `type` ?</summary>
73+
In standard standalone setups documentation states that the labels should be
74+
name `type` with the type being the parsed log program (eg nginx, traefik). A
75+
transformation from `type` to `program` is done by the first stage parser
76+
`crowdsecurity/syslog-logs` which is not relevant in a Kubernetes context.
77+
</details>
78+
79+
<detail>
80+
<summary>How collection fit in kubernetes environment?</summary>
81+
82+
Collections are "recipes" for understanding logs; they don’t find pods on their
83+
own. You choose which pods to read, and you tag those logs with a program (like
84+
nginx or traefik). When the tag matches what a collection expects, its rules
85+
run; if it doesn’t, they stay idle. One log stream can match several collections
86+
if the tags fit.
87+
</details>
88+
89+
If you want more information about the configuration, you can check the default
90+
[values.yaml](https://artifacthub.io/packages/helm/crowdsec/crowdsec#values)
6491

6592
Then, you can install the Security Engine with the following command:
6693

@@ -82,6 +109,18 @@ crowdsec-agent-kf9fr 1/1 Running 0 34s
82109
crowdsec-lapi-777c469947-jbk9q 1/1 Running 0 34s
83110
```
84111

112+
### A word About Source IPs
113+
114+
For CrowdSec to do its job in Kubernetes, it needs to see the real client IP. If
115+
not, every request will just look like it’s coming from your ingress controller
116+
or load balancer, and CrowdSec won’t know who the actual attacker is. To fix
117+
this, you need to make sure the original IP gets passed through. Depending on
118+
your setup, that could mean turning on the proxy-protocol in your ingress,
119+
setting externalTrafficPolicy: Local on Services, or tweaking things like
120+
real_ip_header and set_real_ip_from if you’re using NGINX. The exact steps
121+
depend on your stack, but the main idea is simple: CrowdSec needs the real IP,
122+
not the proxy’s.
123+
85124
### A Word About Remediation Component
86125

87126
Installing the CrowdSec Engine as a local API and log processors is very useful
@@ -91,8 +130,12 @@ remediation can only happen at ingress level.
91130

92131
For now, we support:
93132

94-
* [Ingress Nginx](u/bouncers/ingress-nginx/)
95-
* [Traefik Kubernetes Ingress (Third party development)](https://plugins.traefik.io/plugins/6335346ca4caa9ddeffda116/crowdsec-bouncer-traefik-plugin)
133+
* [Ingress Nginx](/u/bouncers/ingress-nginx/)
134+
* [Traefik Ingress](/u/bouncers/traefik/)
135+
136+
Please note that the [Traefik Kubernetes Ingress (Third party
137+
development)](https://plugins.traefik.io/plugins/6335346ca4caa9ddeffda116/crowdsec-bouncer-traefik-plugin))
138+
is maintained outside CrowdSec
96139

97140
Before installing the remediation component, you need to generate API key to communicate with the LAPI.
98141

0 commit comments

Comments
 (0)