Fix issue with matching labels

This commit fixes the issue with application outages scenario where
the pod-selector is not being mapped properly.
This commit is contained in:
Naga Ravi Chaitanya Elluri
2021-10-29 10:45:46 -04:00
parent 43b1e5b727
commit f3bbc85dd5
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ Scenario to block the traffic ( Ingress/Egress ) of an application matching the
application_outage: # Scenario to create an outage of an application by blocking traffic
duration: 600 # Duration in seconds after which the routes will be accessible
namespace: <namespace-with-application> # Namespace to target - all application routes will go inaccessible if pod selector is empty
pod_selector: {app=foo} # Pods to target
pod_selector: {app: foo} # Pods to target
block: [Ingress, Egress] # It can be Ingress or Egress or Ingress, Egress
```
+2 -1
View File
@@ -28,7 +28,8 @@ kind: NetworkPolicy
metadata:
name: kraken-deny
spec:
podSelector: {{ pod_selector }}
podSelector:
matchLabels: {{ pod_selector }}
policyTypes: {{ traffic_type }}
"""
t = Template(network_policy_template)
+1 -1
View File
@@ -1,5 +1,5 @@
application_outage: # Scenario to create an outage of an application by blocking traffic
duration: 600 # Duration in seconds after which the routes will be accessible
namespace: <namespace-with-application> # Namespace to target - all application routes will go inaccessible if pod selector is empty
pod_selector: {app=foo} # Pods to target
pod_selector: {app: foo} # Pods to target
block: [Ingress, Egress] # It can be Ingress or Egress or Ingress, Egress