Add port blacklisting in the pod-network faults (#4222)
Signed-off-by: Shubham Chaudhary <shubham.chaudhary@harness.io>
This commit is contained in:
parent
d1b19a3435
commit
02a5900995
|
@ -330,6 +330,45 @@ spec:
|
|||
value: '60'
|
||||
```
|
||||
|
||||
### Blacklist Source and Destination Ports
|
||||
|
||||
By default, the network experiments disrupt traffic for all the source and destination ports. The specific ports can be blacklisted via `SOURCE_PORTS` and `DESTINATION_PORTS` ENV.
|
||||
|
||||
- `SOURCE_PORTS`: Provide the comma separated source ports preceded by `!`, that you'd like to blacklist from the chaos.
|
||||
- `DESTINATION_PORTS`: Provide the comma separated destination ports preceded by `!` , that you'd like to blacklist from the chaos.
|
||||
|
||||
Use the following example to tune this:
|
||||
|
||||
[embedmd]:# (pod-network-corruption/blacklist-source-and-destination-ports.yaml yaml)
|
||||
```yaml
|
||||
# blacklist the source and 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: pod-network-corruption-sa
|
||||
experiments:
|
||||
- name: pod-network-corruption
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
# it will blacklist 80 and 8080 source ports
|
||||
- name: SOURCE_PORTS
|
||||
value: '!80,8080'
|
||||
# it will blacklist 8080 and 9000 destination ports
|
||||
- name: DESTINATION_PORTS
|
||||
value: '!8080,9000'
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60'
|
||||
```
|
||||
|
||||
### Network Interface
|
||||
|
||||
The defined name of the ethernet interface, which is considered for shaping traffic. It can be tuned via `NETWORK_INTERFACE` ENV. Its default value is `eth0`.
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
# blacklist the source and 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: pod-network-corruption-sa
|
||||
experiments:
|
||||
- name: pod-network-corruption
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
# it will blacklist 80 and 8080 source ports
|
||||
- name: SOURCE_PORTS
|
||||
value: '!80,8080'
|
||||
# it will blacklist 8080 and 9000 destination ports
|
||||
- name: DESTINATION_PORTS
|
||||
value: '!8080,9000'
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60'
|
|
@ -331,6 +331,45 @@ spec:
|
|||
value: '60'
|
||||
```
|
||||
|
||||
### Blacklist Source and Destination Ports
|
||||
|
||||
By default, the network experiments disrupt traffic for all the source and destination ports. The specific ports can be blacklisted via `SOURCE_PORTS` and `DESTINATION_PORTS` ENV.
|
||||
|
||||
- `SOURCE_PORTS`: Provide the comma separated source ports preceded by `!`, that you'd like to blacklist from the chaos.
|
||||
- `DESTINATION_PORTS`: Provide the comma separated destination ports preceded by `!` , that you'd like to blacklist from the chaos.
|
||||
|
||||
Use the following example to tune this:
|
||||
|
||||
[embedmd]:# (pod-network-duplication/blacklist-source-and-destination-ports.yaml yaml)
|
||||
```yaml
|
||||
# blacklist the source and 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: pod-network-duplication-sa
|
||||
experiments:
|
||||
- name: pod-network-duplication
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
# it will blacklist 80 and 8080 source ports
|
||||
- name: SOURCE_PORTS
|
||||
value: '!80,8080'
|
||||
# it will blacklist 8080 and 9000 destination ports
|
||||
- name: DESTINATION_PORTS
|
||||
value: '!8080,9000'
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60'
|
||||
```
|
||||
|
||||
### Network Interface
|
||||
|
||||
The defined name of the ethernet interface, which is considered for shaping traffic. It can be tuned via `NETWORK_INTERFACE` ENV. Its default value is `eth0`.
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
# blacklist the source and 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: pod-network-duplication-sa
|
||||
experiments:
|
||||
- name: pod-network-duplication
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
# it will blacklist 80 and 8080 source ports
|
||||
- name: SOURCE_PORTS
|
||||
value: '!80,8080'
|
||||
# it will blacklist 8080 and 9000 destination ports
|
||||
- name: DESTINATION_PORTS
|
||||
value: '!8080,9000'
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60'
|
|
@ -340,6 +340,45 @@ spec:
|
|||
value: '60'
|
||||
```
|
||||
|
||||
### Blacklist Source and Destination Ports
|
||||
|
||||
By default, the network experiments disrupt traffic for all the source and destination ports. The specific ports can be blacklisted via `SOURCE_PORTS` and `DESTINATION_PORTS` ENV.
|
||||
|
||||
- `SOURCE_PORTS`: Provide the comma separated source ports preceded by `!`, that you'd like to blacklist from the chaos.
|
||||
- `DESTINATION_PORTS`: Provide the comma separated destination ports preceded by `!` , that you'd like to blacklist from the chaos.
|
||||
|
||||
Use the following example to tune this:
|
||||
|
||||
[embedmd]:# (pod-network-latency/blacklist-source-and-destination-ports.yaml yaml)
|
||||
```yaml
|
||||
# blacklist the source and 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: pod-network-latency-sa
|
||||
experiments:
|
||||
- name: pod-network-latency
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
# it will blacklist 80 and 8080 source ports
|
||||
- name: SOURCE_PORTS
|
||||
value: '!80,8080'
|
||||
# it will blacklist 8080 and 9000 destination ports
|
||||
- name: DESTINATION_PORTS
|
||||
value: '!8080,9000'
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60'
|
||||
```
|
||||
|
||||
### Network Interface
|
||||
|
||||
The defined name of the ethernet interface, which is considered for shaping traffic. It can be tuned via `NETWORK_INTERFACE` ENV. Its default value is `eth0`.
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
# blacklist the source and 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: pod-network-latency-sa
|
||||
experiments:
|
||||
- name: pod-network-latency
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
# it will blacklist 80 and 8080 source ports
|
||||
- name: SOURCE_PORTS
|
||||
value: '!80,8080'
|
||||
# it will blacklist 8080 and 9000 destination ports
|
||||
- name: DESTINATION_PORTS
|
||||
value: '!8080,9000'
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60'
|
|
@ -331,6 +331,45 @@ spec:
|
|||
value: '60'
|
||||
```
|
||||
|
||||
### Blacklist Source and Destination Ports
|
||||
|
||||
By default, the network experiments disrupt traffic for all the source and destination ports. The specific ports can be blacklisted via `SOURCE_PORTS` and `DESTINATION_PORTS` ENV.
|
||||
|
||||
- `SOURCE_PORTS`: Provide the comma separated source ports preceded by `!`, that you'd like to blacklist from the chaos.
|
||||
- `DESTINATION_PORTS`: Provide the comma separated destination ports preceded by `!` , that you'd like to blacklist from the chaos.
|
||||
|
||||
Use the following example to tune this:
|
||||
|
||||
[embedmd]:# (pod-network-loss/blacklist-source-and-destination-ports.yaml yaml)
|
||||
```yaml
|
||||
# blacklist the source and 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: pod-network-loss-sa
|
||||
experiments:
|
||||
- name: pod-network-loss
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
# it will blacklist 80 and 8080 source ports
|
||||
- name: SOURCE_PORTS
|
||||
value: '!80,8080'
|
||||
# it will blacklist 8080 and 9000 destination ports
|
||||
- name: DESTINATION_PORTS
|
||||
value: '!8080,9000'
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60'
|
||||
```
|
||||
|
||||
### Network Interface
|
||||
|
||||
The defined name of the ethernet interface, which is considered for shaping traffic. It can be tuned via `NETWORK_INTERFACE` ENV. Its default value is `eth0`.
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
# blacklist the source and 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: pod-network-loss-sa
|
||||
experiments:
|
||||
- name: pod-network-loss
|
||||
spec:
|
||||
components:
|
||||
env:
|
||||
# it will blacklist 80 and 8080 source ports
|
||||
- name: SOURCE_PORTS
|
||||
value: '!80,8080'
|
||||
# it will blacklist 8080 and 9000 destination ports
|
||||
- name: DESTINATION_PORTS
|
||||
value: '!8080,9000'
|
||||
- name: TOTAL_CHAOS_DURATION
|
||||
value: '60'
|
Loading…
Reference in New Issue