Chore(docs): Add docs for NODE_LABEL feature in pod level experiments (#3553)

Signed-off-by: uditgaurav <udit@chaosnative.com>
This commit is contained in:
Udit Gaurav 2022-04-16 22:42:59 +05:30 committed by GitHub
parent 3377b68479
commit d90ffb2e74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 94 additions and 1 deletions

View File

@ -129,4 +129,77 @@ spec:
env:
- name: DEFAULT_APP_HEALTH_CHECK
value: 'false'
```
```
### Node Label Filter For Selecting The Target Pods
It defines the target application pod selection from a specific node. It is helpful for the scenarios where you want to select the pods scheduled on specific nodes as chaos candidates considering the pod affected percentage. It can be tuned via `NODE_LABEL` ENV.
<b>NOTE: This feature requires having node-level permission or clusterrole service account for filtering pods on a specific node.</b>
<table>
<tr>
<th>APP_LABEL</th>
<th>TARGET_PODS</th>
<th>NODE_LABEL</th>
<th>SELECTED PODS</th>
</tr>
<tr>
<td>Provided</td>
<td>Provided</td>
<td>Provided</td>
<td>The target pods that are filtered from applabel and resides on node containing the given node label and also provided in TARGET_PODS env is selected</td>
</tr>
<tr>
<td>Provided</td>
<td>Not Provided</td>
<td>Provided</td>
<td>The pods that are filtered from applabel and resides on node containing the given node label is selected </td>
</tr>
<tr>
<td>Not Provided</td>
<td>Provided</td>
<td>Provided</td>
<td>The target pods are selected that resides on node with given node label </td>
</tr>
</tr>
<tr>
<td>Not Provided</td>
<td>Not Provided</td>
<td>Provided</td>
<td>Invalid</td>
</tr>
<tr>
<td>Not Provided</td>
<td>Not Provided</td>
<td>Not Provided</td>
<td>Invalid</td>
</tr>
</table>
Use the following example to tune this:
[embedmd]:# (https://raw.githubusercontent.com/litmuschaos/litmus/master/mkdocs/docs/experiments/categories/pods/common/default-app-health-check.yaml yaml)
```yaml
## node label to filter target pods
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
spec:
components:
env:
- name: NODE_LABEL
value: 'kubernetes.io/hostname=worker-01'
```

View File

@ -0,0 +1,20 @@
## node label to filter target pods
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
spec:
components:
env:
- name: NODE_LABEL
value: 'kubernetes.io/hostname=worker-01'