Skip to content

litmuschaos/chaos-ci-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chaos CI Lib

Slack Channel GitHub Workflow Docker Pulls GitHub issues Twitter Follow CII Best Practices Go Report Card YouTube Channel

Chaos CI Lib is a central repository which contains different GO bdd tests implemented using the popular Ginkgo, Gomega test framework for running a number of litmuschaos experiments in different CI platforms that can be further used at remote places. The bdd can be used inside the job templates that can be used by the members who are using litmus experiments as part of their CI pipelines.

Supported CI Platforms

Litmus supports CI plugin for the following CI platforms:

CI Platform Chaos Template
GitHub Actions Click Here
GitLab Remote Templates Click Here
Spinnaker Plugin Click Here

Environment Variables

Chaos CI Lib uses standardized environment variables to configure environments, infrastructure, and probes. Below is the comprehensive list of supported environment variables.

Litmus SDK & Authentication

Variable Description Default Example
LITMUS_ENDPOINT Litmus server endpoint URL "" https://chaos.example.com
LITMUS_USERNAME Username for Litmus authentication "" admin
LITMUS_PASSWORD Password for Litmus authentication "" litmus
LITMUS_PROJECT_ID ID of the Litmus project to use "" project-123

Environment Management Variables

Variable Description Default Example
CREATE_ENV Whether to create a new environment true false
USE_EXISTING_ENV Whether to use an existing environment false true
EXISTING_ENV_ID ID of existing environment (required if USE_EXISTING_ENV=true) "" env-123456
ENV_NAME Name for the new environment chaos-ci-env my-k8s-env
ENV_TYPE Type of environment to create NON_PROD PROD
ENV_DESCRIPTION Description of the environment CI Test Environment Production Test Environment

Infrastructure Management Variables

Variable Description Default Example
INSTALL_INFRA Whether to install infrastructure true false
USE_EXISTING_INFRA Whether to use existing infrastructure false true
EXISTING_INFRA_ID ID of existing infrastructure (required if USE_EXISTING_INFRA=true) "" infra-123456
ACTIVATE_INFRA Whether to activate infrastructure by deploying manifests true false
INFRA_ACTIVATION_TIMEOUT Timeout in minutes for infrastructure activation 5 10
INFRA_NAME Name for the infrastructure ci-infra-{expName} my-k8s-infra
INFRA_NAMESPACE Kubernetes namespace for infrastructure litmus chaos-testing
INFRA_SCOPE Scope of infrastructure namespace cluster
INFRA_SERVICE_ACCOUNT Service account for infrastructure litmus chaos-runner
INFRA_DESCRIPTION Description of infrastructure CI Test Infrastructure Production Test Infra
INFRA_PLATFORM_NAME Platform name others gcp
INFRA_NS_EXISTS Whether namespace already exists false true
INFRA_SA_EXISTS Whether service account already exists false true
INFRA_SKIP_SSL Whether to skip SSL verification false true
INFRA_NODE_SELECTOR Node selector for infrastructure "" disk=ssd
INFRA_TOLERATIONS Tolerations for infrastructure "" key=value:NoSchedule

Probe Management Variables

Variable Description Default Example
LITMUS_CREATE_PROBE Whether to create a probe false true
LITMUS_PROBE_NAME Name of the probe http-probe http-status-check
LITMUS_PROBE_TYPE Type of probe httpProbe httpProbe
LITMUS_PROBE_MODE Mode of the probe SOT Continuous
LITMUS_PROBE_URL URL for HTTP probe http://localhost:8080/health http://app:8080/health
LITMUS_PROBE_TIMEOUT Timeout for probe 30s 5s
LITMUS_PROBE_INTERVAL Interval for probe 10s 5s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe 1 3
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code 200 200

Example Usage

To create a new environment and infrastructure:

# Authentication
export LITMUS_ENDPOINT="https://chaos.example.com"
export LITMUS_USERNAME="admin"
export LITMUS_PASSWORD="litmus"
export LITMUS_PROJECT_ID="project-123"

# Environment setup
export CREATE_ENV="true"
export ENV_NAME="test-environment"
export ENV_TYPE="NON_PROD"

# Infrastructure setup
export INSTALL_INFRA="true"
export INFRA_NAME="test-infra"
export INFRA_NAMESPACE="chaos-testing"
export INFRA_SCOPE="namespace"

# Optional probe setup
export LITMUS_CREATE_PROBE="true"
export LITMUS_PROBE_NAME="http-status-check"
export LITMUS_PROBE_TYPE="httpProbe"
export LITMUS_PROBE_URL="http://app:8080/health"
export LITMUS_PROBE_RESPONSE_CODE="200"

To use existing environment and infrastructure:

# Set environment variables for existing resources
export USE_EXISTING_ENV="true"
export EXISTING_ENV_ID="env-123456"
export USE_EXISTING_INFRA="true"
export EXISTING_INFRA_ID="infra-789012"

How to get started?

Refer the LitmusChaos Docs and Experiment Docs

How do I contribute?

You can contribute by raising issues, improving the documentation, contributing to the core framework and tooling, etc.

Head over to the Contribution guide

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •