E622 Add ability to configure affinity and tolerations for scans and hooks by malexmave · Pull Request #804 · secureCodeBox/secureCodeBox · GitHub
[go: up one dir, main page]

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hooks/cascading-scans/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ zap-http zap-baseline-scan non-invasive medium
|-----|------|---------|-------------|
| hook.image.repository | string | `"docker.io/securecodebox/hook-cascading-scans"` | Hook image repository |
| hook.image.tag | string | defaults to the charts version | The image Tag defaults to the charts version if not defined. |
| hook.labels | object | `{}` | Add Kubernetes Labels to the hook definition |
| hook.priority | int | `0` | Hook priority. Higher priority Hooks are guaranteed to execute before low priority Hooks. |
| hook.ttlSecondsAfterFinished | string | `nil` | Seconds after which the kubernetes job for the hook will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ |

Expand Down
1 change: 1 addition & 0 deletions 6880 hooks/finding-post-processing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ The `override` field specifies the desired fields and values that need to be upd
|-----|------|---------|-------------|
| hook.image.repository | string | `"docker.io/securecodebox/hook-finding-post-processing"` | Hook image repository |
| hook.image.tag | string | defaults to the charts version | The image Tag defaults to the charts version if not defined. |
| hook.labels | object | `{}` | Add Kubernetes Labels to the hook definition |
| hook.priority | int | `0` | Hook priority. Higher priority Hooks are guaranteed to execute before low priority Hooks. |
| hook.ttlSecondsAfterFinished | string | `nil` | Seconds after which the kubernetes job for the hook will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ |
| rules | list | `[]` | |
Expand Down
1 change: 1 addition & 0 deletions hooks/generic-webhook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Kubernetes: `>=v1.11.0-0`
|-----|------|---------|-------------|
| hook.image.repository | string | `"docker.io/securecodebox/hook-generic-webhook"` | Hook image repository |
| hook.image.tag | string | defaults to the charts version | The image Tag defaults to the charts version if not defined. |
| hook.labels | object | `{}` | Add Kubernetes Labels to the hook definition |
| hook.priority | int | `0` | Hook priority. Higher priority Hooks are guaranteed to execute before low priority Hooks. |
| hook.ttlSecondsAfterFinished | string | `nil` | Seconds after which the kubernetes job for the hook will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ |
| webhookUrl | string | `"http://example.com"` | The URL of your WebHook endpoint |
Expand Down
1 change: 1 addition & 0 deletions hooks/notification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ To fill your template with data we provide the following objects.
| hook.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images |
| hook.image.repository | string | `"docker.io/securecodebox/hook-notification"` | Hook image repository |
| hook.image.tag | string | defaults to the charts version | Image tag |
| hook.labels | object | `{}` | Add Kubernetes Labels to the hook definition |
| hook.priority | int | `0` | Hook priority. Higher priority Hooks are guaranteed to execute before low priority Hooks. |
| hook.ttlSecondsAfterFinished | string | `nil` | seconds after which the kubernetes job for the hook will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ |
| notificationChannels[0].endPoint | string | `"SOME_ENV_KEY"` | |
Expand Down
3 changes: 2 additions & 1 deletion hooks/persistence-defectdojo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ spec:
| defectdojo.url | string | `"http://defectdojo-django.default.svc"` | Url to the DefectDojo Instance |
| hook.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images |
| hook.image.repository | string | `"docker.io/securecodebox/hook-persistence-defectdojo"` | Hook image repository |
| hook.image.tag | string | defaults to the charts version | Container image tag |
| hook.image.tag | string | `nil` | Container image tag |
| hook.labels | object | `{}` | Add Kubernetes Labels to the hook definition |
| hook.priority | int | `0` | Hook priority. Higher priority Hooks are guaranteed to execute before low priority Hooks. |

## License
Expand Down
1 change: 1 addition & 0 deletions hooks/persistence-elastic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ the [Luxon documentation](https://moment.github.io/luxon/docs/manual/formatting.
| fullnameOverride | string | `""` | |
| hook.image.repository | string | `"docker.io/securecodebox/hook-persistence-elastic"` | Hook image repository |
| hook.image.tag | string | defaults to the charts version | The image Tag defaults to the charts version if not defined. |
| hook.labels | object | `{}` | Add Kubernetes Labels to the hook definition |
| hook.priority | int | `0` | Hook priority. Higher priority Hooks are guaranteed to execute before low priority Hooks. |
| hook.ttlSecondsAfterFinished | string | `nil` | Seconds after which the kubernetes job for the hook will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ |
| imagePullSecrets | list | `[]` | |
Expand Down
1 change: 1 addition & 0 deletions hooks/update-field/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ helm upgrade --install ufh secureCodeBox/update-field-hook --set attribute.name=
| attribute.value | string | `"my-own-category"` | The value of the attribute you want to add to each finding result |
| hook.image.repository | string | `"docker.io/securecodebox/hook-update-field"` | Hook image repository |
| hook.image.tag | string | defaults to the charts version | The image Tag defaults to the charts version if not defined. |
| hook.labels | object | `{}` | Add Kubernetes Labels to the hook definition |
| hook.priority | int | `0` | Hook priority. Higher priority Hooks are guaranteed to execute before low priority Hooks. |
| hook.ttlSecondsAfterFinished | string | `nil` | Seconds after which the kubernetes job for the hook will be deleted. Requires the Kubernetes TTLAfterFinished controller: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/ |

Expand Down
4 changes: 4 additions & 0 deletions operator/apis/execution/v1/scan_types.go
D82A
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ type ScanSpec struct {
VolumeMounts []corev1.VolumeMount `json:"volumeMount 17A6 s,omitempty"`
// InitContainers allows to specify init containers for the scan container, to pre-load data into them.
InitContainers []corev1.Container `json:"initContainers,omitempty"`
// Affinity allows to specify a node affinity, to control on which nodes you want a scan to run. See: https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/
Affinity corev1.Affinity `json:"affinity,omitempty"`
// Tolerations are a different way to control on which nodes your scan is executed. See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

Cascades *CascadeSpec `json:"cascades,omitempty"`
}
Expand Down
4 changes: 4 additions & 0 deletions operator/apis/execution/v1/scancompletionhook_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ type ScanCompletionHookSpec struct {
Volumes []corev1.Volume `json:"volumes,omitempty"`
// VolumeMounts allows to specify volume mounts for the hooks container.
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
// Affinity allows to specify a node affinity, to control on which nodes you want a scan to run. See: https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/
Affinity corev1.Affinity `json:"affinity,omitempty"`
// Tolerations are a different way to control on which nodes your scan is executed. See https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// ServiceAccountName Name of the serviceAccount Name used. Should only be used if your hook needs specifc RBAC Access. Otherwise the hook is run using a "scan-completion-hook" service account. The service account should have at least "get" rights on scans.execution.securecodebox.io, and "get" & "patch" scans.execution.securecodebox.io/status
ServiceAccountName *string `json:"serviceAccountName,omitempty"`
Expand Down
16 changes: 16 additions & 0 deletions operator/apis/execution/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
0