Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: [CHAOS-7252]: Add transaction percentage support in dns #8942

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ permissions:
<td> Determines whether the DNS query exactly matches one of the targets or uses any of the targets as a substring. It can be <code>exact</code> or <code>substring</code>. </td>
<td> If this is not provided, it is set to <code>exact</code>. For more information, go to <a href="#match-scheme">match scheme</a></td>
</tr>
<tr>
<td> TRANSACTION_PERCENTAGE </td>
<td> Percentage of the dns queries to be affected. </td>
<td> It supports values in range (0,100]. It targets all requests if not provided. For more information, go to <a href="#trasaction-percentage">transaction percentage </a>.</td>
</tr>
<tr>
<td> PODS_AFFECTED_PERC </td>
<td> Percentage of total pods to target. Provide numeric values. </td>
Expand Down Expand Up @@ -226,6 +231,40 @@ spec:
value: '60'
```

### Transaction Percentage

The percentage of dns queries to be affected, with supported values in the range (0, 100]. If not specified, it targets all queries. Tune it by using the `TRANSACTION_PERCENTAGE` environment variable.

The following YAML snippet illustrates the use of this environment variable:

[embedmd]:# (./static/manifests/pod-dns-error/transaction-percentage.yaml yaml)
```yaml
# contains transaction percentage for the dns error
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: litmus-admin
experiments:
- name: pod-dns-error
spec:
components:
env:
# provide the transaction percentage within (0,100] range
# for example, it will affect 50% of the total dns queries
- name: TRANSACTION_PERCENTAGE
value: '50'
- name: TOTAL_CHAOS_DURATION
value: '60'
```

### Container runtime and socket path

The `CONTAINER_RUNTIME` and `SOCKET_PATH` environment variables to set the container runtime and socket file path, respectively.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ permissions:
<td> Map of the target host names. For example, '&#123;"abc.com":"spoofabc.com"&#125;' where key is the host name to be spoofed and value is the host name to which the key is spoofed or redirected to.</td>
<td> If not provided, no host names or domains are spoofed. </td>
</tr>
<tr>
<td> TRANSACTION_PERCENTAGE </td>
<td> Percentage of the dns queries to be affected. </td>
<td> It supports values in range (0,100]. It targets all requests if not provided. For more information, go to <a href="#trasaction-percentage">transaction percentage </a>.</td>
</tr>
<tr>
<td> PODS_AFFECTED_PERC </td>
<td> Percentage of total pods to target. Provide numeric values. </td>
Expand Down Expand Up @@ -154,6 +159,40 @@ spec:
value: "60"
```

### Transaction Percentage

The percentage of dns queries to be affected, with supported values in the range (0, 100]. If not specified, it targets all queries. Tune it by using the `TRANSACTION_PERCENTAGE` environment variable.

The following YAML snippet illustrates the use of this environment variable:

[embedmd]:# (./static/manifests/pod-dns-spoof/transaction-percentage.yaml yaml)
```yaml
# contains transaction percentage for the dns spoofing
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: litmus-admin
experiments:
- name: pod-dns-spoof
spec:
components:
env:
# provide the transaction percentage within (0,100] range
# for example, it will affect 50% of the total dns queries
- name: TRANSACTION_PERCENTAGE
value: '50'
- name: TOTAL_CHAOS_DURATION
value: '60'
```

### Container runtime and socket path

The `CONTAINER_RUNTIME` and `SOCKET_PATH` environment variables to set the container runtime and socket file path, respectively.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# contains transaction percentage for the dns error
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: litmus-admin
experiments:
- name: pod-dns-error
spec:
components:
env:
# provide the transaction percentage within (0,100] range
# for example, it will affect 50% of the total dns queries
- name: TRANSACTION_PERCENTAGE
value: '50'
- name: TOTAL_CHAOS_DURATION
value: '60'
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# contains transaction percentage for the dns spoofing
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: litmus-admin
experiments:
- name: pod-dns-spoof
spec:
components:
env:
# provide the transaction percentage within (0,100] range
# for example, it will affect 50% of the total dns queries
- name: TRANSACTION_PERCENTAGE
value: '50'
- name: TOTAL_CHAOS_DURATION
value: '60'
Loading