From 0e80270d64b20a745599e1cf07d029f98a20396b Mon Sep 17 00:00:00 2001 From: Aldo Lacuku Date: Mon, 11 Jul 2022 16:10:28 +0200 Subject: [PATCH] update(event-generator): remove values table from README.md The values table lives in a separate file and is referenced in the README.md file through a hypelink. Further more the helm documentation is generated using docker instead of downloading the binary for helm-docs. Signed-off-by: Aldo Lacuku --- event-generator/Chart.yaml | 2 +- event-generator/Makefile | 38 ++++++------------------ event-generator/README.gotmpl | 5 +++- event-generator/README.md | 24 +-------------- event-generator/generated/helm-values.md | 14 ++++++--- 5 files changed, 25 insertions(+), 58 deletions(-) diff --git a/event-generator/Chart.yaml b/event-generator/Chart.yaml index 4fbff554b..bab6aa616 100644 --- a/event-generator/Chart.yaml +++ b/event-generator/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: event-generator -description: A Helm chart for Kubernetes +description: A Helm chart used to deploy the event-generator in Kubernetes cluster. # A chart can be either an 'application' or a 'library' chart. # diff --git a/event-generator/Makefile b/event-generator/Makefile index d7369443f..34a7c5ec5 100644 --- a/event-generator/Makefile +++ b/event-generator/Makefile @@ -1,31 +1,11 @@ -# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) -ifeq (,$(shell go env GOBIN)) -GOBIN=$(shell go env GOPATH)/bin -else -GOBIN=$(shell go env GOBIN) -endif - #generate helm documentation -docs: helm-docs - $(HELM_DOCS) -t README.gotmpl -o ./generated/helm-values.md - cat ./generated/helm-values.md >> README.md +DOCS_IMAGE_VERSION="v1.11.0" -helm-docs: -ifeq (, $(shell which helm-docs)) - @{ \ - set -e ;\ - HELM_DOCS_TMP_DIR=$$(mktemp -d) ;\ - cd $$HELM_DOCS_TMP_DIR ;\ - version=1.5.0 ;\ - arch=x86_64 ;\ - echo $$HELM_DOCS_PATH ;\ - echo https://github.com/norwoodj/helm-docs/releases/download/v$${version}/helm-docs_$${version}_linux_$${arch}.tar.gz ;\ - curl -LO https://github.com/norwoodj/helm-docs/releases/download/v$${version}/helm-docs_$${version}_linux_$${arch}.tar.gz ;\ - tar -zxvf helm-docs_$${version}_linux_$${arch}.tar.gz ;\ - mv helm-docs $(GOBIN)/helm-docs ;\ - rm -rf $$HELM_DOCS_TMP_DIR ;\ - } -HELM_DOCS=$(GOBIN)/helm-docs -else -HELM_DOCS=$(shell which helm-docs) -endif +docs: + docker run \ + --rm \ + --workdir=/helm-docs \ + --volume "$$(pwd):/helm-docs" \ + -u $$(id -u) \ + jnorwood/helm-docs:$(DOCS_IMAGE_VERSION) \ + helm-docs -t ./README.gotmpl -o ./generated/helm-values.md diff --git a/event-generator/README.gotmpl b/event-generator/README.gotmpl index ef8d1f14d..bbd25ac39 100644 --- a/event-generator/README.gotmpl +++ b/event-generator/README.gotmpl @@ -1 +1,4 @@ -{{ template "chart.valuesTable" . | }} +{{ template "chart.header" . }} +{{ template "chart.description" . }} +{{ template "chart.valuesSection" . }} + diff --git a/event-generator/README.md b/event-generator/README.md index c871bd05b..3d20e819f 100644 --- a/event-generator/README.md +++ b/event-generator/README.md @@ -118,26 +118,4 @@ The command removes all the Kubernetes components associated with the chart and ## Configuration -The following table lists the configurable parameters of the event-generator chart and their default values. - -| Key | Type | Default | Description | -|-----|------|---------|-------------| -| affinity | object | `{}` | Affinity, like the nodeSelector but with more expressive syntax. | -| config.actions | string | `"^syscall"` | Regular expression used to select the actions to be run. | -| config.command | string | `"test"` | The event-generator accepts two commands (run, test): run: runs actions. test: runs and tests actions. For more info see: https://github.com/falcosecurity/event-generator | -| config.grpc.bindAddress | string | `"unix:///var/run/falco/falco.sock"` | Path to the Falco grpc socket. | -| config.grpc.enabled | bool | `true` | Set it to true if you are deploying in "test" mode. | -| config.loop | bool | `false` | Runs in a loop the actions. If set to "true" the event-generator is deployed using a k8s deployment otherwise a k8s job. | -| config.sleep | string | `""` | The length of time to wait before running an action. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means no sleep. (default 100ms) | -| fullnameOverride | string | `""` | Used to override the chart full name. | -| image.pullPolicy | string | `"IfNotPresent"` | Pull policy for the event-generator image | -| image.repository | string | `"falcosecurity/event-generator"` | Repository from where the image is pulled. | -| image.tag | string | `"latest"` | Images' tag to select a development/custom version of event-generator instead of a release. Overrides the image tag whose default is the chart appVersion. | -| imagePullSecrets | list | `[]` | Secrets used to pull the image from a private repository. | -| nameOverride | string | `""` | Used to override the chart name. | -| nodeSelector | object | `{}` | Selectors to choose a given node where to run the pods. | -| podAnnotations | object | `{}` | Annotations to be added to the pod. | -| podSecurityContext | object | `{}` | Security context for the pod. | -| replicasCount | int | `1` | Number of replicas of the event-generator (meaningful when installed as a deployment). | -| securityContext | object | `{}` | Security context for the containers. | -| tolerations | list | `[]` | Tolerations to allow the pods to be scheduled on nodes whose taints the pod tolerates. | \ No newline at end of file +All the configurable parameters of the event-generator chart and their default values can be found [here](./generated/helm-values.md). diff --git a/event-generator/generated/helm-values.md b/event-generator/generated/helm-values.md index ef75b049c..539809874 100644 --- a/event-generator/generated/helm-values.md +++ b/event-generator/generated/helm-values.md @@ -1,12 +1,17 @@ +# event-generator + +A Helm chart used to deploy the event-generator in Kubernetes cluster. +## Values + | Key | Type | Default | Description | |-----|------|---------|-------------| | affinity | object | `{}` | Affinity, like the nodeSelector but with more expressive syntax. | -| config.actions | string | `"^syscall"` | Regular expression used to select the actions to be run. | -| config.command | string | `"test"` | The event-generator accepts two commands (run, test): run: runs actions. test: runs and tests actions. For more info see: https://github.com/falcosecurity/event-generator | +| config.actions | string | `"^k8saudit"` | Regular expression used to select the actions to be run. | +| config.command | string | `"test"` | The event-generator accepts two commands (run, test): run: runs actions. test: runs and tests actions. For more info see: https://github.com/falcosecurity/event-generator. | | config.grpc.bindAddress | string | `"unix:///var/run/falco/falco.sock"` | Path to the Falco grpc socket. | | config.grpc.enabled | bool | `true` | Set it to true if you are deploying in "test" mode. | | config.loop | bool | `false` | Runs in a loop the actions. If set to "true" the event-generator is deployed using a k8s deployment otherwise a k8s job. | -| config.sleep | string | `""` | The length of time to wait before running an action. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means no sleep. (default 100ms) | +| config.sleep | string | `""` | The length of time to wait before running an action. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means no sleep. (default 100ms) | | fullnameOverride | string | `""` | Used to override the chart full name. | | image.pullPolicy | string | `"IfNotPresent"` | Pull policy for the event-generator image | | image.repository | string | `"falcosecurity/event-generator"` | Repository from where the image is pulled. | @@ -18,4 +23,5 @@ | podSecurityContext | object | `{}` | Security context for the pod. | | replicasCount | int | `1` | Number of replicas of the event-generator (meaningful when installed as a deployment). | | securityContext | object | `{}` | Security context for the containers. | -| tolerations | list | `[]` | Tolerations to allow the pods to be scheduled on nodes whose taints the pod tolerates. | \ No newline at end of file +| tolerations | list | `[]` | Tolerations to allow the pods to be scheduled on nodes whose taints the pod tolerates. | +