From 6d85e92da8fd6fc2dfc2c2af57fca88898be8193 Mon Sep 17 00:00:00 2001 From: Achref Ben Saadd Date: Sun, 1 May 2022 20:11:20 -0400 Subject: [PATCH] add annotation controller docs Signed-off-by: Achref Ben Saadd --- contribution/development_guide.md | 18 ++++++++++++++++++ contribution/testing_guide.md | 15 +++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/contribution/development_guide.md b/contribution/development_guide.md index 21d86a6294..a8d6cd285e 100644 --- a/contribution/development_guide.md +++ b/contribution/development_guide.md @@ -236,6 +236,23 @@ $ cd KubeArmor/KubeArmor ~/KubeArmor/KubeArmor$ make run ``` + * Annotation controller + + Starting from KubeArmor v0.5 annotations are applied via an annotation controller, the controller code can be found under `pkg/KubeArmorAnnotation`. + + To install the controller from KubeArmor docker repository run + ```text + $ cd KubeArmor/pkg/KubeArmorAnnotation + ~/KubeArmor/pkg/KubeArmorAnnotation$ make deploy + ``` + + To install the controller (local version) to your cluster run + ```text + $ cd KubeArmor/pkg/KubeArmorAnnotation + ~/KubeArmor/pkg/KubeArmorAnnotation$ make docker-build deploy + ``` + + if you need to setup a local registry to push you image, use `docker-registry.sh` script under `~/KubeArmor/contribution/local-registry` directory ## Code Directories @@ -264,6 +281,7 @@ Here, we briefly give you an overview of KubeArmor's directories. ```text pkg/KubeArmorPolicy/ - KubeArmorPolicy CRD generated by Kube-Builder pkg/KubeArmorHostPolicy/ - KubeArmorHostPolicy CRD generated by Kube-Builder + pkg/KubeArmorAnnotation/ - KubeArmorAnnotation Annotation controller/webhook generated by Kube-Builder ``` * Files for testing diff --git a/contribution/testing_guide.md b/contribution/testing_guide.md index 8a6f730bce..c709a423ed 100644 --- a/contribution/testing_guide.md +++ b/contribution/testing_guide.md @@ -2,6 +2,21 @@ There are two ways to check the functionalities of KubeArmor: 1) testing KubeArmor manually and 2) using the testing framework. +# 0. Make sure that the annotation controller is installed on the cluster (Applicable for Steps 1 and 2) + +- To install the controller from KubeArmor docker repository to your cluster run + +```text +$ cd KubeArmor/pkg/KubeArmorAnnotation +~/KubeArmor/pkg/KubeArmorAnnotation$ make deploy +``` +- To install the controller (local version) to your cluster run + +```text +$ cd KubeArmor/pkg/KubeArmorAnnotation +~/KubeArmor/pkg/KubeArmorAnnotation$ make docker-build deploy +``` + # 1. Test KubeArmor manually ## 1.1. Run 'kubectl proxy' in background