Refactor CI-Lib Implementation to Support Litmus 3.0 #250
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E-chaos-ci-lib | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [master] | |
| types: [opened, synchronize, reopened] | |
| paths-ignore: | |
| - '**.md' | |
| jobs: | |
| Container-Kill_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-container-kill" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Get the NodePort for the frontend service | |
| FRONTEND_PORT=$(kubectl get svc chaos-litmus-frontend-service -n litmus -o jsonpath='{.spec.ports[0].nodePort}') | |
| echo "Frontend NodePort: $FRONTEND_PORT" | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| # Verify ChaosCenter is accessible | |
| curl -f http://localhost:9091 || echo "Frontend not ready yet" | |
| curl -f http://localhost:9002/api/status || echo "Backend not ready yet" | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run container-kill experiment | |
| run: make container-kill | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Disk-Fill_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-disk-fill" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run disk-fill experiment | |
| run: make disk-fill | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Node_CPU_Hog_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-node-cpu-hog" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run node-cpu-hog experiment | |
| run: make node-cpu-hog | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Node_IO_Stress_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-node-io-stress" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run node-io-stress experiment | |
| run: make node-io-stress | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Node_Memory_Hog_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-node-memory-hog" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run node-memory-hog experiment | |
| run: make node-memory-hog | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Pod_Autoscaler_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-pod-autoscaler" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run pod-autoscaler experiment | |
| run: make pod-autoscaler | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Pod_CPU_Hog_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-pod-cpu-hog" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run pod-cpu-hog experiment | |
| run: make pod-cpu-hog | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Pod_Delete_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-pod-delete" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run pod-delete experiment | |
| run: make pod-delete | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Pod_Memory_Hog_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-pod-memory-hog" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run pod-memory-hog experiment | |
| run: make pod-memory-hog | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Pod_Network_Corruption_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-pod-network-corruption" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run pod-network-corruption experiment | |
| run: make pod-network-corruption | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Pod_Network_Duplication_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-pod-network-duplication" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run pod-network-corruption experiment | |
| run: make pod-network-corruption | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Pod_Network_Latency_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-pod-network-latency" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run pod-network-corruption experiment | |
| run: make pod-network-corruption | |
| - name: Uninstall litmus | |
| run: make uninstall | |
| Pod_Network_Loss_Test: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /home/runner/.kube/config | |
| LITMUS_ENDPOINT: "http://localhost:9091" | |
| LITMUS_USERNAME: "admin" | |
| LITMUS_PASSWORD: "litmus" | |
| LITMUS_PROJECT_ID: "admin-project" | |
| INSTALL_INFRA: "true" | |
| ACTIVATE_INFRA: "true" | |
| CREATE_ENV: "true" | |
| ENV_NAME: "ci-test-env" | |
| ENV_TYPE: "NON_PROD" | |
| INFRA_NAME: "ci-infra-pod-network-loss" | |
| INFRA_NAMESPACE: "litmus" | |
| INFRA_SCOPE: "namespace" | |
| INFRA_ACTIVATION_TIMEOUT: "5" | |
| LITMUS_CREATE_PROBE: "true" | |
| LITMUS_PROBE_NAME: "ci-http-probe" | |
| LITMUS_PROBE_TYPE: "httpProbe" | |
| LITMUS_PROBE_MODE: "SOT" | |
| LITMUS_PROBE_URL: "http://nginx-service.default.svc.cluster.local:80" | |
| LITMUS_PROBE_TIMEOUT: "30s" | |
| LITMUS_PROBE_INTERVAL: "10s" | |
| LITMUS_PROBE_ATTEMPTS: "1" | |
| LITMUS_PROBE_RESPONSE_CODE: "200" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| #Install and configure a kind cluster | |
| - name: Installing KinD cluster for the test | |
| run: kind create cluster | |
| - name: Configuring and testing the Installation | |
| run: | | |
| kubectl wait node --all --for condition=ready --timeout=120s | |
| kubectl get nodes | |
| - name: Install Litmus ChaosCenter locally | |
| run: | | |
| # Add Litmus Helm repository | |
| helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ | |
| helm repo update | |
| # Install Litmus ChaosCenter | |
| kubectl create namespace litmus | |
| helm install chaos litmuschaos/litmus \ | |
| --namespace litmus \ | |
| --set portal.frontend.service.type=NodePort \ | |
| --set portal.server.service.type=NodePort \ | |
| --set mongodb.service.type=NodePort \ | |
| --wait --timeout=600s | |
| # Wait for all pods to be ready | |
| kubectl wait --for=condition=ready pod --all -n litmus --timeout=600s | |
| # Set up port forwarding to access ChaosCenter locally | |
| kubectl port-forward -n litmus svc/chaos-litmus-frontend-service 9091:9091 & | |
| kubectl port-forward -n litmus svc/chaos-litmus-server-service 9002:9002 & | |
| # Wait for port forwarding to be established | |
| sleep 30 | |
| - name: Deploy a sample application for chaos injection | |
| run: | | |
| kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-ci-lib/master/app/nginx.yml | |
| kubectl wait --for=condition=Ready pods --all --namespace default --timeout=90s | |
| # Create a service for nginx to enable probe connectivity | |
| kubectl expose deployment nginx --port=80 --target-port=80 --name=nginx-service --type=ClusterIP | |
| kubectl wait --for=condition=Ready pods -l app=nginx --namespace default --timeout=30s | |
| - name: Run pod-network-corruption experiment | |
| run: make pod-network-corruption | |
| - name: Uninstall litmus | |
| run: make uninstall |