-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [CHAOS-7808]: Add pod api modify response custom fault (#9643)
* chore: [CHAOS-7808]: Add pod api modify response custom fault Signed-off-by: Shubham Chaudhary <[email protected]> * chore: [CHAOS-7808]: update the hyperlink Signed-off-by: Shubham Chaudhary <[email protected]> * review Add image and review docs --------- Signed-off-by: Shubham Chaudhary <[email protected]> Co-authored-by: SmritiSatya <[email protected]>
- Loading branch information
1 parent
ee3a198
commit 1b40688
Showing
12 changed files
with
849 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
571 changes: 571 additions & 0 deletions
571
...ng/use-harness-ce/chaos-faults/kubernetes/pod/pod-api-modify-response-custom.md
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+300 KB
...ce/chaos-faults/kubernetes/pod/static/images/pod-api-modify-response-custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions
38
...bernetes/pod/static/manifests/pod-api-modify-response-custom/advanced-fault-tunables.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# it injects the api modify header fault | ||
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-api-modify-response-custom | ||
spec: | ||
components: | ||
env: | ||
# provide the proxy port | ||
- name: PROXY_PORT | ||
value: '20000' | ||
# provide the connection type | ||
- name: SERVICE_DIRECTION | ||
value: 'ingress' | ||
# provide the payload type | ||
- name: DATA_DIRECTION | ||
value: 'both' | ||
# provide the network interface | ||
- name: NETWORK_INTERFACE | ||
value: 'eth0' | ||
# provide the api path filter | ||
- name: PATH_FILTER | ||
value: '/status' | ||
# provide the port of the targeted service | ||
- name: TARGET_SERVICE_PORT | ||
value: "80" | ||
- name: HEADERS_MAP | ||
value: '{"X-Litmus-Test-Header": "X-Litmus-Test-Value"}' |
41 changes: 41 additions & 0 deletions
41
...ults/kubernetes/pod/static/manifests/pod-api-modify-response-custom/advanced-filters.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# it injects the api modify header fault | ||
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-api-modify-response-custom | ||
spec: | ||
components: | ||
env: | ||
# provide the headers filters | ||
- name: HEADERS_FILTERS | ||
value: 'key1:value1,key2:value2' | ||
# provide the methods filters | ||
- name: METHODS | ||
value: 'GET,POST' | ||
# provide the query params filters | ||
- name: QUERY_PARAMS | ||
value: 'param1:value1,param2:value2' | ||
# provide the source hosts filters | ||
- name: SOURCE_HOSTS | ||
value: 'host1,host2' | ||
# provide the source ips filters | ||
- name: SOURCE_IPS | ||
value: 'ip1,ip2' | ||
# provide the connection type | ||
- name: SERVICE_DIRECTION | ||
value: 'ingress' | ||
# provide the port of the targeted service | ||
- name: TARGET_SERVICE_PORT | ||
value: "80" | ||
- name: HEADERS_MAP | ||
value: '{"X-Litmus-Test-Header": "X-Litmus-Test-Value"}' |
33 changes: 33 additions & 0 deletions
33
...od/static/manifests/pod-api-modify-response-custom/container-runtime-and-socket-path.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## provide the container runtime and socket file path | ||
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-api-modify-response-custom | ||
spec: | ||
components: | ||
env: | ||
# runtime for the container | ||
# supports docker, containerd, crio | ||
- name: CONTAINER_RUNTIME | ||
value: "containerd" | ||
# path of the socket file | ||
- name: SOCKET_PATH | ||
value: "/run/containerd/containerd.sock" | ||
# provide the port of the targeted service | ||
- name: TARGET_SERVICE_PORT | ||
value: "80" | ||
# provide the api path filter | ||
- name: PATH_FILTER | ||
value: '/status' | ||
- name: HEADERS_MAP | ||
value: '{"X-Litmus-Test-Header": "X-Litmus-Test-Value"}' |
29 changes: 29 additions & 0 deletions
29
...lts/kubernetes/pod/static/manifests/pod-api-modify-response-custom/destination-ports.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## provide destination ports | ||
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-api-modify-response-custom | ||
spec: | ||
components: | ||
env: | ||
# provide destination ports | ||
- name: DESTINATION_PORTS | ||
value: '80,443' | ||
# provide the api path filter | ||
- name: PATH_FILTER | ||
value: '/status' | ||
- name: HEADERS_MAP | ||
value: '{"X-Litmus-Test-Header": "X-Litmus-Test-Value"}' | ||
# provide the port of the targeted service | ||
- name: TARGET_SERVICE_PORT | ||
value: "80" |
31 changes: 31 additions & 0 deletions
31
...-faults/kubernetes/pod/static/manifests/pod-api-modify-response-custom/https-enabled.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## enable https support | ||
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-api-modify-response-custom | ||
spec: | ||
components: | ||
env: | ||
# enable https support | ||
- name: HTTPS_ENABLED | ||
value: 'true' | ||
- name: SERVER_CERTIFICATES | ||
value: 'Y3VzdG9tIGNlcnRpZmljYXRlcwo=' | ||
# provide the api path filter | ||
- name: PATH_FILTER | ||
value: '/status' | ||
- name: HEADERS_MAP | ||
value: '{"X-Litmus-Test-Header": "X-Litmus-Test-Value"}' | ||
# provide the port of the targeted service | ||
- name: TARGET_SERVICE_PORT | ||
value: "80" |
33 changes: 33 additions & 0 deletions
33
...aults/kubernetes/pod/static/manifests/pod-api-modify-response-custom/modify-response.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## provide the headers as a map | ||
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-api-modify-header | ||
spec: | ||
components: | ||
env: | ||
# map of headers to modify/add; Eg: {"X-Litmus-Test-Header": "X-Litmus-Test-Value"} | ||
# to remove a header, just set the value to ""; Eg: {"X-Litmus-Test-Header": ""} | ||
- name: HEADERS_MAP | ||
value: '{"X-Litmus-Test-Header": "X-Litmus-Test-Value"}' | ||
# provide the http status code | ||
- name: STATUS_CODE | ||
value: "500" | ||
# provide the response body | ||
- name: RESPONSE_BODY | ||
value: "/.+/internal_server_error" | ||
# provide the port of the targeted service | ||
- name: TARGET_SERVICE_PORT | ||
value: "80" | ||
- name: PATH_FILTER | ||
value: '/status' |
26 changes: 26 additions & 0 deletions
26
...os-faults/kubernetes/pod/static/manifests/pod-api-modify-response-custom/path-filter.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## provide api path filter | ||
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-api-modify-response-custom | ||
spec: | ||
components: | ||
env: | ||
# provide the api path filter | ||
- name: PATH_FILTER | ||
value: '/status' | ||
- name: HEADERS_MAP | ||
value: '{"X-Litmus-Test-Header": "X-Litmus-Test-Value"}' | ||
# provide the port of the targeted service | ||
- name: TARGET_SERVICE_PORT | ||
value: "80" |
25 changes: 25 additions & 0 deletions
25
...s/kubernetes/pod/static/manifests/pod-api-modify-response-custom/target-service-port.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## provide the port of the targeted service | ||
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-api-modify-response-custom | ||
spec: | ||
components: | ||
env: | ||
# provide the port of the targeted service | ||
- name: TARGET_SERVICE_PORT | ||
value: "80" | ||
- name: HEADERS_MAP | ||
value: '{"X-Litmus-Test-Header": "X-Litmus-Test-Value"}' | ||
- name: PATH_FILTER | ||
value: '/status' |