You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+63-25Lines changed: 63 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -231,7 +231,7 @@ All the tests are read from an YAML file or a directory (step **1**) and the res
231
231
232
232
## Development
233
233
234
-
- You will need Go version 1.20.x or higher. Download the latest version of [just](https://github.com/casey/just/releases). To build the project you can use `just build`. The resulting binary will be in `cmd/netassert/cli/netassert`. To run `unit` tests you can use `just test`. There is a separate [README.md](./e2e/README.md) that details `end-to-end` testing.
234
+
- You will need Go version 1.25.x or higher. Download the latest version of [just](https://github.com/casey/just/releases). To build the project you can use `just build`. The resulting binary will be in `cmd/netassert/cli/netassert`. To run `unit` tests you can use `just test`. There is a separate [README.md](./e2e/README.md) that details `end-to-end` testing.
235
235
236
236
## Quick testing
237
237
@@ -241,64 +241,102 @@ All the tests are read from an YAML file or a directory (step **1**) and the res
241
241
242
242
- If you want to quickly test `NetAssert`, you can make use of the sample test(s) and manifests provided
243
243
244
-
- You will also need a working kubernetes cluster with ephemeral/debug container support, you can spin one quickly using the `justfile` included in the repo
244
+
- You will also need a working kubernetes cluster with ephemeral/debug container support and a CNI that supports Network Policies, you can spin one quickly using the `justfile` included in the repo
245
245
246
246
```bash
247
247
❯ just kind-down ; just kind-up
248
+
❯ just calico-apply
248
249
```
249
250
250
-
- In order to use the sample tests, you need to create kubernetes resources:
251
+
- wait for all the nodes to become ready
252
+
```bash
253
+
❯ kubectl get nodes
254
+
```
255
+
256
+
- In order to use the sample tests, you need to create network policies and kubernetes resources:
251
257
252
258
```bash
253
259
❯ just k8s-apply
254
-
255
-
kubectl apply -f ./kubernetes/manifests
260
+
kubectl apply -f ./e2e/manifests/workload.yaml
256
261
namespace/fluentd created
257
262
daemonset.apps/fluentd created
258
263
namespace/echoserver created
259
264
namespace/busybox created
260
265
deployment.apps/echoserver created
261
266
deployment.apps/busybox created
267
+
namespace/pod1 created
268
+
namespace/pod2 created
269
+
pod/pod2 created
270
+
pod/pod1 created
262
271
namespace/web created
263
272
statefulset.apps/web created
264
273
```
265
274
275
+
```bash
276
+
❯ just netpol-apply
277
+
```
278
+
279
+
- Wait for the workload to become ready
280
+
```bash
281
+
❯ kubectl get pods -A
282
+
```
266
283
- Run the netassert binary pointing it to the test cases, one of the test cases will fail and this is by design:
267
284
268
285
```bash
269
-
## if you have Go installed, you can build the binary using the the following command
270
286
❯ just build ## from the root of the project
271
-
go build -ldflags="-X 'main.appName=NetAssert' -X 'main.version=2.0.0-dev'" -o bin/netassert cmd/netassert/cli/*.go
272
287
273
-
❯ bin/netassert run --input-file ./sample-tests/test-cases/test-cases.yaml
288
+
❯ bin/netassert run --input-file ./e2e/manifests/test-cases.yaml
NetAssert is architected for compatibility with Kubernetes versions that offer support for ephemeral containers. We have thoroughly tested NetAssert with Kubernetes versions 1.25 to 1.28, confirming compatibility and performance stability.
330
+
NetAssert is architected for compatibility with Kubernetes versions that offer support for ephemeral containers. We have thoroughly tested NetAssert with Kubernetes versions 1.25 to 1.35, confirming compatibility and performance stability.
293
331
294
332
For broader validation, our team has also executed comprehensive [end-to-end tests](./e2e/README.md) against various Kubernetes distributions and CNIs which is detailed below:
295
333
296
334
| Kubernetes Distribution | Supported Version | Container Network Interface (CNI) |
| Amazon EKS | 1.25 and higher | Calico (Version 3.25 or later) |
300
-
| Google GKE | 1.24 and higher | Google Cloud Platform VPC CNI |
301
-
| Google GKE | 1.24 and higher | Google Cloud Dataplane V2 |
336
+
| Amazon EKS | 1.34 and higher | AWS VPC CNI |
337
+
| Amazon EKS | 1.34 and higher | Calico (Version 3.26 or later) |
338
+
| Google GKE | 1.33 and higher | Google Cloud Platform VPC CNI |
339
+
| Google GKE | 1.33 and higher | Google Cloud Dataplane V2 |
302
340
303
341
## Checking for ephemeral container support
304
342
@@ -315,14 +353,14 @@ You can check for ephemeral container support using the following command:
315
353
You can increase the logging level to `debug` by passing `--log-level` argument:
316
354
317
355
```bash
318
-
❯ netassert run --input-file ./sample-tests/test-cases/test-cases.yaml --log-level=debug
356
+
❯ netassert run --input-file ./e2e/manifests/test-cases.yaml --log-level=debug
319
357
```
320
358
321
359
## RBAC Configuration
322
360
323
361
This tool can be run according to the Principle of Least Privilege (PoLP) by properly configuring the RBAC.
324
362
325
-
The list of required permissions can be found in the `netassert` ClusterRole `kubernetes/rbac/cluster-role.yaml`, which could be redefined as a Role for namespacing reasons if needed. This role can then be bound to a "principal" either through a RoleBinding or a ClusterRoleBinding, depending on whether the scope of the role is supposed to be namespaced or not. The ClusterRoleBinding `kubernetes/rbac/cluster-rolebinding.yaml` is an example where the user `netassert-user` is assigned the role `netassert` using a cluster-wide binding called `netassert`
363
+
The list of required permissions can be found in the `netassert` ClusterRole `rbac/cluster-role.yaml`, which could be redefined as a Role for namespacing reasons if needed. This role can then be bound to a "principal" either through a RoleBinding or a ClusterRoleBinding, depending on whether the scope of the role is supposed to be namespaced or not. The ClusterRoleBinding `rbac/cluster-rolebinding.yaml` is an example where the user `netassert-user` is assigned the role `netassert` using a cluster-wide binding called `netassert`
326
364
327
365
## Limitations
328
366
@@ -349,6 +387,6 @@ The list of required permissions can be found in the `netassert` ClusterRole `ku
0 commit comments