Skip to content
Merged
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
1 change: 1 addition & 0 deletions application-outages/app_outages.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ application_outage: # Scenario to create an out
duration: $DURATION # Duration in seconds after which the routes will be accessible
namespace: $NAMESPACE # Namespace to target - all application routes will go inaccessible if pod selector is empty
pod_selector: $POD_SELECTOR # Pods to target
exclude_label: $EXCLUDE_LABEL
block:
$BLOCK_TRAFFIC_TYPE # It can be Ingress or Egress or Ingress, Egress
1 change: 1 addition & 0 deletions application-outages/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
export DURATION=${DURATION:=600}
export NAMESPACE=${NAMESPACE:=<namespace>}
export POD_SELECTOR=${POD_SELECTOR:="{}"}
export EXCLUDE_LABEL=${EXCLUDE_LABEL:""}
export BLOCK_TRAFFIC_TYPE=${BLOCK_TRAFFIC_TYPE:=- Ingress}
export SCENARIO_TYPE=${SCENARIO_TYPE:=application_outages_scenarios}
export SCENARIO_FILE=${SCENARIO_FILE:=scenarios/app_outage.yaml}
66 changes: 38 additions & 28 deletions application-outages/krknctl-input.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,50 @@
[
{
"name":"chaos-duration",
"short_description":"Chaos Duration",
"description":"Set chaos duration (in sec) as desired",
"variable":"DURATION",
"type":"number",
"default":"600",
"required":"false"
"name": "chaos-duration",
"short_description": "Chaos Duration",
"description": "Set chaos duration (in sec) as desired",
"variable": "DURATION",
"type": "number",
"default": "600",
"required": "false"
},
{
"name":"namespace",
"short_description":"Namespace",
"description":"Namespace to target - all application routes will go inaccessible if pod selector is empty ( Required )",
"variable":"NAMESPACE",
"type":"string",
"required":"true"
"name": "namespace",
"short_description": "Namespace",
"description": "Namespace to target - all application routes will go inaccessible if pod selector is empty ( Required )",
"variable": "NAMESPACE",
"type": "string",
"required": "true"
},
{
"name":"pod-selector",
"short_description":"Pod Selector",
"name": "pod-selector",
"short_description": "Pod Selector",
"description": "Pods to target. For example \"{app: foo}\"",
"type":"string",
"variable":"POD_SELECTOR",
"type": "string",
"variable": "POD_SELECTOR",
"validator": "\\{[a-zA-Z0-9-_]+\\: [a-zA-Z0-9-_]+\\}",
"validation_message": "Pod selector must be in the following format: \"{app: foo}\"",
"required": "true"
"required": "true"
},
{
"name":"block-traffic-type",
"short_description":"Block traffic direction",
"description": "It can be [Ingress] or [Egress] or [Ingress, Egress]",
"type":"string",
"variable":"BLOCK_TRAFFIC_TYPE",
"validator": "^\\[Ingress\\]$|^\\[Egress\\]$|^\\[Ingress, Egress\\]$",
"validation_message": "Block traffic direction can be [Ingress] or [Egress] or [Ingress, Egress]",
"default":"[Ingress, Egress]",
"required": "false"
}
"name": "exclude-selector",
"short_description": "Exclude Pod Selector",
"description": "Pods to exclude from targetting. For example \"{app: foo}\"",
"type": "string",
"variable": "EXCLUDE_LABEL",
"validator": "\\{[a-zA-Z0-9-_]+\\: [a-zA-Z0-9-_]+\\}",
"validation_message": "Exclude Pod selector must be in the following format: \"{app: foo}\"",
"required": "false"
},
{
"name": "block-traffic-type",
"short_description": "Block traffic direction",
"description": "It can be [Ingress] or [Egress] or [Ingress, Egress]",
"type": "string",
"variable": "BLOCK_TRAFFIC_TYPE",
"validator": "^\\[Ingress\\]$|^\\[Egress\\]$|^\\[Ingress, Egress\\]$",
"validation_message": "Block traffic direction can be [Ingress] or [Egress] or [Ingress, Egress]",
"default": "[Ingress, Egress]",
"required": "false"
}
]
1 change: 1 addition & 0 deletions container-scenarios/container_scenario.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ scenarios:
action: $ACTION
count: $DISRUPTION_COUNT
expected_recovery_time: $EXPECTED_RECOVERY_TIME
exclude_label: $EXCLUDE_LABEL
1 change: 1 addition & 0 deletions container-scenarios/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Vars and respective defaults
export NAMESPACE=${NAMESPACE:="openshift-etcd"}
export LABEL_SELECTOR=${LABEL_SELECTOR:="k8s-app=etcd"}
export EXCLUDE_LABEL=${EXCLUDE_LABEL:""}
export EXPECTED_RECOVERY_TIME=${EXPECTED_RECOVERY_TIME:=60}
export DISRUPTION_COUNT=${DISRUPTION_COUNT:=1}
export CONTAINER_NAME=${CONTAINER_NAME:=etcd}
Expand Down
121 changes: 64 additions & 57 deletions container-scenarios/krknctl-input.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,70 @@
[

{
"name":"namespace",
"short_description":"Namespace",
"description":"Targeted namespace in the cluster",
"variable":"NAMESPACE",
"type":"string",
"default":"openshift-etcd",
"required":"false"
},
{
"name":"label-selector",
"short_description":"Label Selector",
"description":"Label of the container(s) to target",
"variable":"LABEL_SELECTOR",
"type":"string",
"default":"k8s-app=etcd",
"validator":"^.+\\=.+$",
"validation_message": "Label selector must be in the format: key=value",
"required":"false"
},
{
"name":"disruption-count",
"short_description":"Disruption Count",
"description": "Number of container to disrupt",
"type":"number",
"variable":"DISRUPTION_COUNT",
"default":"1",
"required": "false"
},
{
"name":"container-name",
"short_description":"Container Name",
"description": "Name of the container to disrupt",
"type":"string",
"variable":"CONTAINER_NAME",
"default":"etcd",
"required": "false"
},
{
"name":"action",
"short_description":"Action",
"description":"kill signal to run. For example 1 ( hang up ) or 9",
"variable":"ACTION",
"type":"string",
"default":"1",
"validator":"^[1-9]$",
{
"name": "namespace",
"short_description": "Namespace",
"description": "Targeted namespace in the cluster",
"variable": "NAMESPACE",
"type": "string",
"default": "openshift-etcd",
"required": "false"
},
{
"name": "label-selector",
"short_description": "Label Selector",
"description": "Label of the container(s) to target",
"variable": "LABEL_SELECTOR",
"type": "string",
"default": "k8s-app=etcd",
"validator": "^.+\\=.+$",
"validation_message": "Label selector must be in the format: key=value",
"required": "false"
},
{
"name": "exclude-selector",
"short_description": "Exclude Pod Selector",
"description": "Pods to exclude from targetting. For example \"{app: foo}\"",
"type": "string",
"variable": "EXCLUDE_LABEL",
"validator": "^.+\\=.+$",
"validation_message": "Exclude Pod selector must be in the following format: \"{app: foo}\"",
"required": "false"
},
{
"name": "disruption-count",
"short_description": "Disruption Count",
"description": "Number of container to disrupt",
"type": "number",
"variable": "DISRUPTION_COUNT",
"default": "1",
"required": "false"
},
{
"name": "container-name",
"short_description": "Container Name",
"description": "Name of the container to disrupt",
"type": "string",
"variable": "CONTAINER_NAME",
"default": "etcd",
"required": "false"
},
{
"name": "action",
"short_description": "Action",
"description": "kill signal to run. For example 1 ( hang up ) or 9",
"variable": "ACTION",
"type": "string",
"default": "1",
"validator": "^[1-9]$",
"validation_message": "Kill signal must be a number between 1 and 9",
"required":"false"
"required": "false"
},
{
"name":"expected-recovery-time",
"short_description":"Expected Recovery Time",
"description":"Time to wait before checking if all containers that were affected recover properly",
"variable":"EXPECTED_RECOVERY_TIME",
"type":"number",
"default":"60",
"required":"false"
"name": "expected-recovery-time",
"short_description": "Expected Recovery Time",
"description": "Time to wait before checking if all containers that were affected recover properly",
"variable": "EXPECTED_RECOVERY_TIME",
"type": "number",
"default": "60",
"required": "false"
}


]