Skip to content

Commit

Permalink
Adding time scenarios (#43473)
Browse files Browse the repository at this point in the history
* Adding time scenarios

* Adding in workflow

* Fixing syntax mistake

* Removing DURATION var

* Fixing typing mistake
  • Loading branch information
shahsahil264 authored Sep 20, 2023
1 parent 9cfccc3 commit a4f1a4c
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
chain:
as: redhat-chaos-krkn-hub-tests
steps:
- ref: redhat-chaos-time-scenarios
- ref: openshift-qe-cluster-density-v2
- ref: redhat-chaos-pod-scenarios-prometheus-disruption
- ref: redhat-chaos-pod-scenarios-etcd-disruption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ workflow:
as: redhat-chaos-krkn-hub-tests
steps:
test:
- ref: redhat-chaos-time-scenarios
- ref: openshift-qe-cluster-density-v2
- ref: redhat-chaos-pod-scenarios-prometheus-disruption
- ref: redhat-chaos-pod-scenarios-etcd-disruption
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
set -x
cat /etc/os-release
oc config view
oc projects
python3 --version
pushd /tmp

ls -la /root/kraken
git clone https://github.com/redhat-chaos/krkn-hub.git
pushd krkn-hub/

echo "kubeconfig loc $$KUBECONFIG"
echo "Using the flattened version of kubeconfig"
oc config view --flatten > /tmp/config

export KUBECONFIG=/tmp/config
export ACTION=$ACTION
export OBJECT_TYPE=$OBJECT_TYPE
export NAMESPACE=$TARGET_NAMESPACE
export CONTAINER_NAME=$CONTAINER_NAME
export LABEL_SELECTOR=$LABEL_SELECTOR
export KRKN_KUBE_CONFIG=$KUBECONFIG
export ENABLE_ALERTS=False



./prow/time-scenarios/prow_run.sh
rc=$?
echo "Finished running time scenario"
echo "Return code: $rc"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"path": "redhat-chaos/time-scenarios/redhat-chaos-time-scenarios-ref.yaml",
"owners": {
"approvers": [
"chaitanyaenr",
"yogananth-subramanian",
"paigerube14",
"tsebastiani"
],
"reviewers": [
"mffiedler",
"paigerube14",
"chaitanyaenr",
"shahsahil264"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
ref:
as: redhat-chaos-time-scenarios
from_image:
namespace: chaos
name: krkn
tag: latest
commands: redhat-chaos-time-scenarios-commands.sh
env:
- name: ACTION
default: "skew_time"
- name: OBJECT_TYPE
default: "pod"
- name: TARGET_NAMESPACE
default: "openshift-etcd"
- name: CONTAINER_NAME
default: "etcd"
- name: LABEL_SELECTOR
default: "app=etcd"
- name: RETRY_WAIT
default: "60"
- name: ENABLE_ALERTS
default: "True"
- name: ALERTS_PATH
default: "/root/kraken/config/alerts"
- name: CHECK_CRITICAL_ALERTS
default: "True"
- name: WAIT_DURATION
default: "100"
- name: TELEMETRY_ENABLED
default: "True"
- name: TELEMETRY_API_URL
default: "https://ulnmf9xv7j.execute-api.us-west-2.amazonaws.com/production"
- name: TELEMETRY_USERNAME
default: "redhat-chaos"
- name: TELEMETRY_RUN_TAG
default: "prow-time-scenarios"
- name: TELEMETRY_PROMETHEUS_BACKUP
default: "True"
- name: TELEMETRY_FULL_PROMETHEUS_BACKUP
default: "True"
- name: TELEMTRY_BACKUP_THREADS
default: "5"
- name: TELEMETRY_ARCHIVE_PATH
default: "/tmp"
- name: TELEMETRY_MAX_RETRIES
default: "0"
- name: TELEMETRY_ARCHIVE_SIZE
default: "1000000"

resources:
requests:
cpu: 100m
memory: 100Mi
documentation: >-
This workflow runs the krkn-hub config workload in the deployed cluster and skews the date and time of the nodes and pods matching the label on a Kubernetes/OpenShift cluster.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"path": "redhat-chaos/time-scenarios/redhat-chaos-time-scenarios-workflow.yaml",
"owners": {
"approvers": [
"chaitanyaenr",
"yogananth-subramanian",
"paigerube14",
"tsebastiani"
],
"reviewers": [
"mffiedler",
"paigerube14",
"chaitanyaenr",
"shahsahil264"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
workflow:
as: redhat-chaos-time-scenarios
steps:
test:
- ref: redhat-chaos-time-scenarios
env:
ACTION: "skew_time"
OBJECT_TYPE: "pod"
TARGET_NAMESPACE: "openshift-etcd"
CONTAINER_NAME: "etcd"
LABEL_SELECTOR: "app=etcd"
RETRY_WAIT: "60"
ENABLE_ALERTS: "True"
ALERTS_PATH: "/root/kraken/config/alerts"
CHECK_CRITICAL_ALERTS: "True"
WAIT_DURATION: "100"
TELEMETRY_ENABLED: "True"
TELEMETRY_API_URL: "https://ulnmf9xv7j.execute-api.us-west-2.amazonaws.com/production"
TELEMETRY_USERNAME: "redhat-chaos"
TELEMETRY_RUN_TAG: "prow-time-scenarios"
TELEMETRY_PROMETHEUS_BACKUP: "True"
TELEMETRY_FULL_PROMETHEUS_BACKUP: "True"
TELEMTRY_BACKUP_THREADS: "5"
TELEMETRY_ARCHIVE_PATH: "/tmp"
TELEMETRY_MAX_RETRIES: "0"
TELEMETRY_ARCHIVE_SIZE: "1000000"

documentation: |-
This workflow runs the krkn-hub config workload in the deployed cluster and skews the date and time of the nodes and pods matching the label on a Kubernetes/OpenShift cluster.

0 comments on commit a4f1a4c

Please sign in to comment.