profile
viewpoint
Udit Gaurav uditgaurav @litmuschaos @mayadata-io bengaluru udit@chaosnative.com Maintainer of LitmusChaos project. A Certified Kubernetes Administrator (CKA)

cncf/cnf-testsuite 78

📞📱☎️📡🌐 CNF Test Suite is a tool to check for and provide feedback on the use of K8s + cloud native best practices in networking applications and platforms.

litmuschaos/github-chaos-actions 27

Github actions to trigger chaos on your review apps

litmuschaos/chaos-runner 14

The bridge between chaos operator and chaos experiment! Lifecycle manager for chaos experiments

litmuschaos/litmus-e2e 14

Test the Chaos!!! An e2e (end-to-end) validation pipeline for the LitmusChaos infrastructure

litmuschaos/litmus-demo 2

GKE cluster running sock-shop & Litmus Chaos Engine

jithinjosejacob/regiontests 0

Microsoft Website Region Tests using Kuberenetes

litmuschaos/m-agent 0

LitmusChaos Machine Agent

uditgaurav/bootcamps 0

bootcamps in chaos carinival

PR opened litmuschaos/test-tools

Chore(openshift): Fix the directory permission of experiment image for openshift cluster

Signed-off-by: uditgaurav udit@chaosnative.com

<!-- Thanks for sending a pull request! Here are some tips for you -->

What this PR does / why we need it:

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

+3 -0

0 comment

1 changed file

pr created time in an hour

create barnchuditgaurav/test-tools

branch : openshift_fix

created branch time in an hour

push eventuditgaurav/test-tools

Vedant Shrotria

commit sha 63d3a574e18569e286350f375dd65aa5f8b1861f

Adding version for images (#205) * Adding version for images Signed-off-by: Jonsy13 <vedant.shrotria@chaosnative.com> * Added images in release workflow Signed-off-by: Jonsy13 <vedant.shrotria@chaosnative.com> * Fixed paths for file & context Signed-off-by: Jonsy13 <vedant.shrotria@chaosnative.com>

view details

push time in 9 hours

PullRequestReviewEvent

push eventuditgaurav/notes

Udit Gaurav

commit sha 31ed33fef79979bb10ad4fd1b242e96bf3787192

Delete cle-cluster-scope.yaml

view details

push time in a day

push eventuditgaurav/notes

Udit Gaurav

commit sha fcab9b2bfa5ea5641b13409f13169db1083b2689

Create cle-cluster-scope.yaml

view details

push time in a day

PR opened litmuschaos/litmus

Docs(examples): Add some example docs for jitter and default app check tunable

Signed-off-by: uditgaurav udit@chaosnative.com

<!-- Thanks for sending a pull request! -->

Proposed changes

Summarize your changes here to communicate with the maintainers and make sure to put the link of that issue

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • [ ] I have read the CONTRIBUTING doc
  • [ ] I have signed the commit for DCO to be passed.
  • [ ] Lint and unit tests pass locally with my changes
  • [ ] I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • [ ] I have added necessary documentation (if appropriate)

Dependency

  • Please add the links to the dependent PR need to be merged before this (if any).

Special notes for your reviewer:

+102 -0

0 comment

4 changed files

pr created time in a day

push eventuditgaurav/litmus

uditgaurav

commit sha a80c41b6293e476fb4cce111547442c49245363d

Docs(examples): Add some example docs for jitter and default app check tunable Signed-off-by: uditgaurav <udit@chaosnative.com>

view details

push time in a day

push eventuditgaurav/litmus

uditgaurav

commit sha 113efb81a04d18e57102858ed0456c74c520339c

Docs(examples): Add some example docs for jitter and default app check tunable Signed-off-by: uditgaurav <udit@chaosnative.com>

view details

push time in a day

create barnchuditgaurav/litmus

branch : add_examples

created branch time in a day

PullRequestReviewEvent

push eventnlamirault/litmus-helm

Nicolas Lamirault

commit sha d27ed8a229098f57f80d7c167f91c639e45d3a40

New chart : kube-azure (#196) * Add: chart for Azure experiments Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com> * Add: kube-azure chart name into CircleCI configuration Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com> * Fix: condition for kube-azure chart Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com> Co-authored-by: Udit Gaurav <35391335+uditgaurav@users.noreply.github.com>

view details

Udit Gaurav

commit sha 31b91c0c816c8b6f4e610f1aaacd8093dfa21cb1

Merge branch 'master' into feat/gcp

view details

push time in 3 days

PR merged litmuschaos/m-agent

Chore(m-agent): Add initial version of litmus m-agent

Signed-off-by: neelanjan00 neelanjan@chaosnative.com

Tested on: Ubuntu, CentOS, RHEL and SUSE Linux Requirements: Linux OS, Systemd

+2550 -2

2 comments

37 changed files

neelanjan00

pr closed time in 3 days

push eventlitmuschaos/m-agent

Neelanjan Manna

commit sha 85743a4bc2235b058a7f10ba4dd69093bff484f8

Chore(m-agent): Add initial version of litmus m-agent (#1) * project init Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * updated README Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * updated send message function Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * added workflows Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * removed unused code from docs pipeline Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * reformated error messages and functions Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * reformated changes; logs, errors and function structure Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * reformated changes; logs, errors and function structure Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * reformated tokken logs Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * go mod tidy Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * refactored dir names Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * added loggers for experiment log generation Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * added log comments Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * refactored Token struct Signed-off-by: neelanjan00 <neelanjan@chaosnative.com> * updated readme Signed-off-by: neelanjan00 <neelanjan@chaosnative.com>

view details

push time in 3 days

issue openedlitmuschaos/m-agent

Enhancement: Containerize the build of m-agent

Enhancement: Containerize the build of m-agent

IMO we can also containerize the installation and uninstallation scripts - We can also do this in a separate PR. The user will have both options to run the shell script for the installation or just run a container with some args.

Originally posted by @uditgaurav in https://github.com/litmuschaos/m-agent/pull/1#issuecomment-1013952113

created time in 3 days

issue openedlitmuschaos/m-agent

Future improvements: For m-agent

Future improvements:

  1. M-agent maybe killed which will cause the experiment to block, need some timeout/liveliness check
  2. Give option for dynamic port selection for m-agent server
  3. Better to have a single endpoint for all experiments and then multiplex on it, makes things much simple and makes the connection re-usable for more complex chaos scenarios.
  4. Stdout and Stderr in cmdProbe ambiguity, we are currently only checking stdout for cmd probe but it might happen that the command executed logs info to stderr too
  5. Ambigous IP address resolution, document it!

Originally posted by @gdsoumya in https://github.com/litmuschaos/m-agent/pull/1#pullrequestreview-854578632

created time in 3 days

pull request commentlitmuschaos/litmus-helm

New chart : kube-azure

Should we also update this condition in ci. @nlamirault

nlamirault

comment created time in 3 days

pull request commentlitmuschaos/litmus-helm

New chart : kube-gcp

Should we also update this condition in ci. @nlamirault

nlamirault

comment created time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentlitmuschaos/m-agent

Chore(m-agent): Add initial version of litmus m-agent

IMO we can also containerize the installation and uninstallation scripts - We can also do this in a separate PR. The user will have both options to run the shell script for the installation or just run a container.

neelanjan00

comment created time in 3 days

pull request commentlitmuschaos/m-agent

Chore(m-agent): Add initial version of litmus m-agent

We can have GitHub Actions for Go Binary build and to check the go and shell linting ... please refer to other chore repos for the same. The same action can also run the unit tests as well.

neelanjan00

comment created time in 3 days

Pull request review commentlitmuschaos/m-agent

Chore(m-agent): Add initial version of litmus m-agent

+// Copyright 2022 LitmusChaos Authors.+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//     http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// See the License for the specific language governing permissions and+// limitations under the License.++package probes++import (+	"encoding/json"+	"strings"+	"testing"++	"github.com/stretchr/testify/assert"+)++//TestExecuteCmdProbeCommand executes the cmdProbe with an echo command+func TestExecuteCmdProbeCommand(t *testing.T) {++	command := `echo "This is echoed from the probe"`+	expectedOutput := "This is echoed from the probe"
	command := `echo "This is printed from the probe"`
	expectedOutput := "This is printed from the probe"
neelanjan00

comment created time in 3 days

Pull request review commentlitmuschaos/m-agent

Chore(m-agent): Add initial version of litmus m-agent

+#!/usr/bin/env bash++PACKAGE=$1+if [[ -z "$PACKAGE" ]]; then+  echo "usage: $0 <package-name>"+  exit 1+fi++TAG=$2++platforms=(+ "linux/386"+ "linux/amd64"+ "linux/arm"+ "linux/arm64"+)++rm -rf platforms-$TAG/*+for platform in "${platforms[@]}"+do+    platform_split=(${platform//\// })+    GOOS=${platform_split[0]}+    GOARCH=${platform_split[1]}+    echo 'Building' $GOOS-$GOARCH+    OUTPUT_NAME='m-agent-'$GOOS-$GOARCH++    env GOOS=$GOOS GOARCH=$GOARCH VERSION=$TAG go build -ldflags "-X main.Version=$TAG" -v -o platforms-$TAG/$OUTPUT_NAME $PACKAGE++    if [ $? -ne 0 ]; then+        echo 'An error has occurred! Aborting the script execution...'+        exit 1+    fi++    cd platforms-$TAG || exit+    mv $OUTPUT_NAME m-agent+    tar -czvf $OUTPUT_NAME-$TAG.tar.gz m-agent+    rm -rf m-agent+    cd ..

If we can do this without doing cd that would be great !!

neelanjan00

comment created time in 3 days

Pull request review commentlitmuschaos/m-agent

Chore(m-agent): Add initial version of litmus m-agent

+#!/usr/bin/env bash++PACKAGE=$1+if [[ -z "$PACKAGE" ]]; then+  echo "usage: $0 <package-name>"+  exit 1+fi++TAG=$2++platforms=(+ "linux/386"+ "linux/amd64"+ "linux/arm"+ "linux/arm64"+)++rm -rf platforms-$TAG/*+for platform in "${platforms[@]}"+do+    platform_split=(${platform//\// })+    GOOS=${platform_split[0]}+    GOARCH=${platform_split[1]}+    echo 'Building' $GOOS-$GOARCH+    OUTPUT_NAME='m-agent-'$GOOS-$GOARCH++    env GOOS=$GOOS GOARCH=$GOARCH VERSION=$TAG go build -ldflags "-X main.Version=$TAG" -v -o platforms-$TAG/$OUTPUT_NAME $PACKAGE

This will require to have Go installed, we can containerize it and get the binary as well.

neelanjan00

comment created time in 3 days

Pull request review commentlitmuschaos/m-agent

Chore(m-agent): Add initial version of litmus m-agent

+#!/usr/bin/env bash+

if we use set -e here in the beginning the script will terminate/stop whenever it will receive a non-zero exit code. We don't need to have it at every place by doing exit 1

neelanjan00

comment created time in 3 days

Pull request review commentlitmuschaos/m-agent

Chore(m-agent): Add initial version of litmus m-agent

+// Copyright 2022 LitmusChaos Authors.+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//     http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// See the License for the specific language governing permissions and+// limitations under the License.++package ip

Dir name can be ip. Please check this for all places.

neelanjan00

comment created time in 3 days

Pull request review commentlitmuschaos/m-agent

Chore(m-agent): Add initial version of litmus m-agent

+// Copyright 2022 LitmusChaos Authors.+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//     http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// See the License for the specific language governing permissions and+// limitations under the License.++package process++import (+	"encoding/json"+	"syscall"+)++// killProcess kills a given target process+func killProcess(processId, signal int) error {++	err := syscall.Kill(processId, syscall.Signal(signal))+	if err != nil {+		return err+	}++	return nil
	return syscall.Kill(processId, syscall.Signal(signal))
neelanjan00

comment created time in 3 days

Pull request review commentlitmuschaos/m-agent

Chore(m-agent): Add initial version of litmus m-agent

+#!/usr/bin/env bash++PACKAGE=$1+if [[ -z "$PACKAGE" ]]; then+  echo "usage: $0 <package-name>"+  exit 1+fi++TAG=$2++platforms=(+ "linux/386"+ "linux/amd64"+ "linux/arm"+ "linux/arm64"+)++rm -rf platforms-$TAG/*+for platform in "${platforms[@]}"+do+    platform_split=(${platform//\// })+    GOOS=${platform_split[0]}+    GOARCH=${platform_split[1]}+    echo 'Building' $GOOS-$GOARCH+    OUTPUT_NAME='m-agent-'$GOOS-$GOARCH++    env GOOS=$GOOS GOARCH=$GOARCH VERSION=$TAG go build -ldflags "-X main.Version=$TAG" -v -o platforms-$TAG/$OUTPUT_NAME $PACKAGE++    if [ $? -ne 0 ]; then+        echo 'An error has occurred! Aborting the script execution...'
        echo 'An error has occurred with exit code ${$?} ! Aborting the script execution...'
neelanjan00

comment created time in 3 days

Pull request review commentlitmuschaos/m-agent

Chore(m-agent): Add initial version of litmus m-agent

+// Copyright 2022 LitmusChaos Authors.+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//     http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// See the License for the specific language governing permissions and+// limitations under the License.++package tokens++import (+	"encoding/json"+	"errors"+	"fmt"+	"log"+	"strconv"+	"strings"+	"unicode"++	"github.com/fatih/color"+	"github.com/litmuschaos/m-agent/api/server/auth"+	errorcodes "github.com/litmuschaos/m-agent/internal/m-agent/error-codes"+	"github.com/litmuschaos/m-agent/internal/m-agent/ip-address"+	"github.com/manifoldco/promptui"+)++// HandleInteractiveTokenGeneration facilitates the generation of a JWT with an expiry time with an interactive CLI prompt+func HandleInteractiveTokenGeneration() {++	// set token error code and token error string+	log.SetPrefix(errorcodes.GetTokenErrorPrefix())++	var token string+	var err error++	tokenExpirationPrompts := []string{"30 Minutes", "1 Hour", "24 Hours", "30 Days"}++	list := promptui.Select{+		Label: "The token should expire after",+		Items: tokenExpirationPrompts,+	}++	idx, _, err := list.Run()+	if err != nil {+		log.Printf("Error during token expiry prompt selection, %v", err.Error())+		return+	}++	switch tokenExpirationPrompts[idx] {+	case "30 Minutes":+		token, err = auth.GenerateJWT('m', 30)+		if err != nil {+			log.Printf("Error during authentication token generation, %v", err.Error())+			return+		}+	case "1 Hour":+		token, err = auth.GenerateJWT('h', 1)+		if err != nil {+			log.Printf("Error during authentication token generation, %v", err.Error())+			return+		}+	case "24 Hours":+		token, err = auth.GenerateJWT('h', 24)+		if err != nil {+			log.Printf("Error during authentication token generation, %v", err.Error())+			return+		}+	case "30 Days":+		token, err = auth.GenerateJWT('d', 30)+		if err != nil {+			log.Printf("Error during authentication token generation, %v", err.Error())+			return+		}+	}++	endpoint := ip.GetPublicIP() + ":41365"++	boldWhite := color.New(color.FgWhite, color.Bold)++	boldWhite.Print("Agent Endpoint: ")+	fmt.Println(endpoint)++	boldWhite.Print("Authentication Token: ")+	fmt.Println(token)+}++// HandleNonInteractiveTokenGeneration facilitates the generation of a JWT with an expiry time in a non-interactive manner+func HandleNonInteractiveTokenGeneration(tokenExpiryDuration string) {++	// set token error code and token error string+	log.SetPrefix(errorcodes.GetTokenErrorPrefix())++	type Token struct {+		Token    string `json:"token"`+		Endpoint string `json:"endpoint"`+	}++	dayHourMinuteChar, dayHourMinuteValue, err := validateTokenExpiryDuration(tokenExpiryDuration)+	if err != nil {+		log.Println("Invalid token expiry duration")+		return+	}++	token, err := auth.GenerateJWT(dayHourMinuteChar, dayHourMinuteValue)+	if err != nil {+		log.Printf("Error during authentication token generation, %v", err.Error())+		return+	}++	endpoint := ip.GetPublicIP() + ":41365"++	jsonResult, err := json.MarshalIndent(Token{Token: token, Endpoint: endpoint}, "", "  ")+	if err != nil {+		log.Printf("Error during creation of JSON token output, %v", err.Error())+		return+	}++	jsonResultString := string(jsonResult)++	// json marshalling replaces '<' and '>' characters with their unicode value+	// hence the unicode values are replaced back with the original characters in the resultant string+	jsonResultString = strings.Replace(jsonResultString, "\\u003c", "<", -1)+	jsonResultString = strings.Replace(jsonResultString, "\\u003e", ">", -1)++	fmt.Println(jsonResultString)+}++// validateTokenExpiryDuration ensures that the token expiry duration input is correctly formatted+func validateTokenExpiryDuration(tokenExpiryDuration string) (rune, int, error) {++	// fetch the last character in the tokenExpiryDuration string+	dayHourMinuteChar := []rune(tokenExpiryDuration[len(tokenExpiryDuration)-1:])[0]++	if !unicode.IsLetter(dayHourMinuteChar) {+		return ' ', 0, errors.New("")+	}++	// slice-off the last character in the tokenExpiryDuration string+	dayHourMinuteValue, err := strconv.Atoi(tokenExpiryDuration[:len(tokenExpiryDuration)-1])+	if err != nil {+		return ' ', 0, err+	}++	switch unicode.ToLower(dayHourMinuteChar) {+	case 'd':+		if dayHourMinuteValue < 1 || dayHourMinuteValue > 30 {+			return ' ', 0, errors.New("")+		}++	case 'h':+		if dayHourMinuteValue < 1 || dayHourMinuteValue > 24 {+			return ' ', 0, errors.New("")+		}++	case 'm':+		if dayHourMinuteValue < 1 || dayHourMinuteValue > 60 {+			return ' ', 0, errors.New("")

should errors.New("") contain any msg? can we use errors.Errof() ?

neelanjan00

comment created time in 3 days

more