Skip to content

Commit

Permalink
common scripts + container scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Jun 10, 2024
1 parent 3244029 commit 5c30207
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
4 changes: 2 additions & 2 deletions common_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ check_cluster_version() {
set_kubernetes_platform() {
if ! kubectl get clusterversion;
then
yq -i '.kraken.distribution="kubernetes"' /root/kraken/config/config.yaml.template
yq -i '.kraken.distribution="kubernetes"' /home/krkn/kraken/config/config.yaml.template
fi
}

Expand All @@ -57,7 +57,7 @@ checks() {

# Config substitutions
config_setup(){
envsubst < /root/kraken/config/kube_burner.yaml.template > /root/kraken/config/kube_burner.yaml
envsubst < /home/krkn/kraken/config/kube_burner.yaml.template > /home/krkn/kraken/config/kube_burner.yaml
}

setup_arcaflow_env(){
Expand Down
23 changes: 12 additions & 11 deletions container-scenarios/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# Dockerfile for kraken

FROM quay.io/krkn-chaos/krkn:latest
FROM quay.io/rh_ee_tsebasti/test-krkn

ENV KUBECONFIG /root/.kube/config
ENV KUBECONFIG /home/krkn/.kube/config

# Install dependencies
USER root
RUN yum install -y which

# Copy configurations
COPY config.yaml.template /root/kraken/config/config.yaml.template
COPY metrics_config.yaml.template /root/kraken/config/kube_burner.yaml.template
COPY container-scenarios/env.sh /root/env.sh
COPY env.sh /root/main_env.sh
COPY container-scenarios/run.sh /root/run.sh
COPY container-scenarios/container_scenario.yaml.template /root/kraken/scenarios/container_scenario.yaml.template
COPY common_run.sh /root/common_run.sh

ENTRYPOINT /root/run.sh
COPY config.yaml.template /home/krkn/kraken/config/config.yaml.template
COPY metrics_config.yaml.template /home/krkn/kraken/config/kube_burner.yaml.template
COPY container-scenarios/env.sh /home/krkn/env.sh
COPY env.sh /home/krkn/main_env.sh
COPY container-scenarios/run.sh /home/krkn/run.sh
COPY container-scenarios/container_scenario.yaml.template /home/krkn/kraken/scenarios/container_scenario.yaml.template
COPY common_run.sh /home/krkn/common_run.sh
USER krkn
ENTRYPOINT /home/krkn/run.sh
12 changes: 6 additions & 6 deletions container-scenarios/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
set -ex

# Source env.sh to read all the vars
source /root/main_env.sh
source /root/env.sh
source /home/krkn/main_env.sh
source /home/krkn/env.sh

source /root/common_run.sh
source /home/krkn/common_run.sh
checks
config_setup

# Substitute config with environment vars defined
envsubst < /root/kraken/scenarios/container_scenario.yaml.template > /root/kraken/scenarios/container_scenario.yaml
envsubst < /root/kraken/config/config.yaml.template > /root/kraken/config/container_scenario_config.yaml
envsubst < /home/krkn/kraken/scenarios/container_scenario.yaml.template > /home/krkn/kraken/scenarios/container_scenario.yaml
envsubst < /home/krkn/kraken/config/config.yaml.template > /home/krkn/kraken/config/container_scenario_config.yaml

# Run Kraken
cd /root/kraken
cd /home/krkn/kraken

cat config/container_scenario_config.yaml

Expand Down
2 changes: 1 addition & 1 deletion env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export CERBERUS_ENABLED=${CERBERUS_ENABLED:=False}
export CERBERUS_URL=${CERBERUS_URL:=http://0.0.0.0:8080}
export DISTRIBUTION=${DISTRIBUTION:=openshift}
export KRKN_KUBE_CONFIG=${KRKN_KUBE_CONFIG:=/root/.kube/config}
export KRKN_KUBE_CONFIG=${KRKN_KUBE_CONFIG:=/home/krkn/.kube/config}
export WAIT_DURATION=${WAIT_DURATION:=60}
export ITERATIONS=${ITERATIONS:=1}
export DAEMON_MODE=${DAEMON_MODE:=False}
Expand Down

0 comments on commit 5c30207

Please sign in to comment.