Skip to content
Snippets Groups Projects

Draft: New patcher documentation

Open Sören Henning requested to merge improve-patcher-documentation into main
1 file
+ 201
1
Compare changes
  • Side-by-side
  • Inline
@@ -7,7 +7,207 @@ nav_order: 2
# Patchers
Patchers can be seen as functions which take a value as input and modify a Kubernetes resource in a patcher-specific way.
Patchers can be seen as functions which take a Kubernetes resource and a value as input and produce a modified Kubernetes resource based on a patcher-specific method.
For example, there are patchers available that modify the number of replicas of a Deployment or change an environment variable.
In general, patchers are defined as follows:
```yaml
type: GenericResourcePatcher # The name of the patcher type
resource: kubernetes-resource.yaml # The resource file to be patched
properties: # Patcher type-specific properties
path: spec/to/field/to/change
type: integer
```
Currently, the following patcher types are available:
## ReplicaPatcher
Modifies the number of replicas for a Kubernetes Deployment or StatefulSet.
Supported Kubernetes resources: Deployment, StatefulSet.
## NumSensorsLoadGeneratorReplicaPatcher
Modifies the number of load generators, according to the following formula: *(value + loadGenMaxRecords - 1) / loadGenMaxRecords*
Supported Kubernetes resources: Deployment, StatefulSet.
| Property | Description | Default |
|:----|:----|:----|
| loadGenMaxRecords | | |
## NumNestedGroupsLoadGeneratorReplicaPatcher
***TODO Description***
Supported Kubernetes resources: Deployment, StatefulSet.
| Property | Description | Default |
|:----|:----|:----|
| loadGenMaxRecords | | |
| numSensors | | |
## DataVolumeLoadGeneratorReplicaPatcher
***TODO Description***
Supported Kubernetes resources: Deployment, StatefulSet.
| Property | Description | Default |
|:----|:----|:----|
| maxVolume | | |
| container | | |
| variableName | | |
## EnvVarPatcher
Modifies an environment variable.
Supported Kubernetes resources: Pod, Deployment, StatefulSet.
| Property | Description | Optional |
|:----|:----|:----|
| container | Name of the container for which to set the environment variable. | |
| variableName | Name of the environment variable to be patched. | |
| factor | An integer to multiply the value with. Ignored if not an integer. | yes |
| prefix | A string prefix for the value. | yes |
| suffix | A string suffix for the value. | yes |
## ConfigMapYamlPatcher
***TODO Description***
Supported Kubernetes resources: ConfigMap.
| Property | Description | Default |
|:----|:----|:----|
| fileName | | |
| variableName | | |
| factor | An integer to multiply the value with. Ignored if not an integer. | yes |
| prefix | A string prefix for the value. | yes |
| suffix | A string suffix for the value. | yes |
## ConfigMapPropertiesPatcher
***TODO Description***
Supported Kubernetes resources: ConfigMap.
| Property | Description | Default |
|:----|:----|:----|
| fileName | | |
| variableName | | |
| factor | An integer to multiply the value with. Ignored if not an integer. | yes |
| prefix | A string prefix for the value. | yes |
| suffix | A string suffix for the value. | yes |
## NodeSelectorPatcher
***TODO Description***
Supported Kubernetes resources: Pod, Deployment, StatefulSet.
| Property | Description | Default |
|:----|:----|:----|
| nodeLabelName | | |
## ResourceLimitPatcher
Modifies the resource limits (e.g., CPU or memory) of a container in a Pod or another resource having a Pod template.
Supported Kubernetes resources: Pod, Deployment, StatefulSet.
| Property | Description | Optional |
|:----|:----|:----|
| container | The name of the container to be patched. | |
| limitedResource | The resource to be limited (e.g., *cpu* or *memory*) | |
| format | Format added to the provided value (e.g., `GBi` or `m`, see Kubernetes documentation for valid values. | yes |
| factor | An integer to multiply the value with. Both *factor* and *format* are ignored if *factor* is not an integer. | yes |
## ResourceRequestPatcher
Modifies the resource requests (e.g., CPU or memory) of a container in a Pod or another resource having a Pod template.
Supported Kubernetes resources: Pod, Deployment, StatefulSet.
| Property | Description | Optional |
|:----|:----|:----|
| container | The name of the container to be patched. | |
| limitedResource | The resource to be limited (e.g., *cpu* or *memory*) | |
| format | Format added to the provided value (e.g., `GBi` or `m`, see Kubernetes documentation for valid values. | yes |
| factor | An integer to multiply the value with. Both *factor* and *format* are ignored if *factor* is not an integer. | yes |
## SchedulerNamePatcher
Modifies the scheduler of a Pod or another resource having a Pod template.
Supported Kubernetes resources: Pod, Deployment, StatefulSet.
## LabelPatcher
***TODO Description***
Supported Kubernetes resources: All.
| Property | Description | Default |
|:----|:----|:----|
| labelName | | |
## MatchLabelPatcher
***TODO Description***
Supported Kubernetes resources: Deployment, StatefulSet.
| Property | Description | Default |
|:----|:----|:----|
| labelName | | |
## TemplateLabelPatcher
***TODO Description***
Supported Kubernetes resources: Deployment, StatefulSet.
| Property | Description | Default |
|:----|:----|:----|
| labelName | | |
## ServiceSelectorPatcher
***TODO Description***
Supported Kubernetes resources: Service.
| Property | Description | Default |
|:----|:----|:----|
| labelName | | |
## ImagePatcher
Modifies the image (field `image`) of a container in a Pod or another resource having a Pod template.
Supported Kubernetes resources: Pod, Deployment, StatefulSet.
| Property | Description | Default |
|:----|:----|:----|
| container | Name of the container for which the image should be patched. | |
## NamePatcher
Modifies the name (`metadata.name`) of a Kubernetes resource.
Supported Kubernetes resources: All.
## Available Patchers
Loading