From 805fea20e9c3bac1245e1e689508174a37008ef9 Mon Sep 17 00:00:00 2001 From: Max Maass Date: Tue, 21 Dec 2021 15:53:27 +0100 Subject: [PATCH] Add affinity and tolerations in values.yaml Signed-off-by: Max Maass --- docs/contributing/integrating-a-hook/templates-dir.md | 4 ++++ docs/contributing/integrating-a-hook/values.yaml.md | 8 ++++++++ docs/contributing/integrating-a-scanner/values.yaml.md | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/docs/contributing/integrating-a-hook/templates-dir.md b/docs/contributing/integrating-a-hook/templates-dir.md index fd232d6f..39c3c896 100644 --- a/docs/contributing/integrating-a-hook/templates-dir.md +++ b/docs/contributing/integrating-a-hook/templates-dir.md @@ -26,5 +26,9 @@ spec: env: - name: WEBHOOK_URL value: {{ .Values.webhookUrl | quote }} + affinity: + {{- toYaml .Values.hook.affinity | nindent 4 }} + tolerations: + {{- toYaml .Values.hook.tolerations | nindent 4 }} ``` diff --git a/docs/contributing/integrating-a-hook/values.yaml.md b/docs/contributing/integrating-a-hook/values.yaml.md index bf7d9def..b4f097bf 100644 --- a/docs/contributing/integrating-a-hook/values.yaml.md +++ b/docs/contributing/integrating-a-hook/values.yaml.md @@ -49,6 +49,14 @@ Adds Kubernetes labels to the Hook definition. See the [Hooks HowTo](/docs/how-t You can specify the priority of the hook with `hook.priorty`. By default, this priority should be zero since they regard deployment-specific configurations which the secureCodeBox team does not manage. +### Affinity + +Optional affinity settings that control how the hook is scheduled (see: [Node Affinity | Kubernetes](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/)) + +### Tolerations + +Optional tolerations settings that control how the hook is scheduled (see: [Tolerations | Kubernetes](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) + ## Additional Values If your hook needs some additional information like an URL (`webhookUrl` in the example above), environment variables or volume mounts, you need to provide an option to specify them in your `values.yaml` and access them in the hook implementation (See [templates](/docs/contributing/integrating-a-hook/templates-dir) for information on how to access the provided values, and [ScanCompletionHook](/docs/api/crds/scan-completion-hook) for a list of possible keys you can set in the template). diff --git a/docs/contributing/integrating-a-scanner/values.yaml.md b/docs/contributing/integrating-a-scanner/values.yaml.md index 44884414..cc8a202c 100644 --- a/docs/contributing/integrating-a-scanner/values.yaml.md +++ b/docs/contributing/integrating-a-scanner/values.yaml.md @@ -147,3 +147,11 @@ Optional securityContext set on the container (see: [Configure a Security Contex ### scopeLimiterAliases Optional scopeLimiterAliases set on the parse definition (see [ScopeLimiterAliases](/docs/api/crds/parse-definition#scopelimiteraliases-optional)) + +### affinity + +Optional affinity settings that control how the job is scheduled (see: [Node Affinity | Kubernetes](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/)) + +### tolerations + +Optional tolerations settings that control how the job is scheduled (see: [Tolerations | Kubernetes](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) \ No newline at end of file