From c571ca84be0e9f35ff55c89d9ba5e74214dd63a1 Mon Sep 17 00:00:00 2001 From: DongYoung Kim Date: Thu, 1 Aug 2024 01:50:49 +0900 Subject: [PATCH 1/7] Added docs for Chaoscenter developer guide Signed-off-by: DongYoung Kim --- .../chaoscenter-developer-guide.md | 219 ++++++++++++++++++ website/sidebars.js | 3 + 2 files changed, 222 insertions(+) create mode 100644 website/docs/developer-guide/chaoscenter-developer-guide.md diff --git a/website/docs/developer-guide/chaoscenter-developer-guide.md b/website/docs/developer-guide/chaoscenter-developer-guide.md new file mode 100644 index 00000000..0dd86f92 --- /dev/null +++ b/website/docs/developer-guide/chaoscenter-developer-guide.md @@ -0,0 +1,219 @@ +--- +id: chaoscenter-developer-guide +title: ChaosCenter Developer Guide +sidebar_label: ChaosCenter Developer Guide +--- + +--- + +## **Prerequisites** +:::note +This document is ietented to be implemented locally. Please do not use in dev or prod environmentss +::: + +- Kubernetes 1.17 or later +- Helm3 or Kubectl +- Node and npm +- Docker +- Golang +- Local Kubernetes Cluster (via minikube, k3s or kind) + +## **Control Plane** +Backend components consist of three microservices +1. GraphQL-Server +2. Authentication-Server +3. MongoDB + +Frontend component +1. React + +## **Steps to run the Control Plane** + +### 1. Run MongoDB + +Step-1: Pull and run the image + +```bash +docker pull mongo:4.2 + +docker network create mongo-cluster + +docker run -d --net mongo-cluster -p 27015:27015 --name m1 mongo:4.2 mongod --replSet rs0 --port 27015 +docker run -d --net mongo-cluster -p 27016:27016 --name m2 mongo:4.2 mongod --replSet rs0 --port 27016 +docker run -d --net mongo-cluster -p 27017:27017 --name m3 mongo:4.2 mongod --replSet rs0 --port 27017 +``` + +Step-2: Add hosts + +Windows +```bash +# add hosts in hosts +notepad C:\Windows\System32\drivers\etc\hosts + +# add the below line +127.0.0.1 m1 m2 m3 +``` + +Linux/Mac +```bash +# add hosts in hosts +sudo vim /etc/hosts + +# add the below line +127.0.0.1 m1 m2 m3 +``` + + +Step-3: Configure the mongoDB replica set + +```bash +docker exec -it m1 mongo -port 27015 + +config={"_id":"rs0","members":[{"_id":0,"host":"m1:27015"},{"_id":1,"host":"m2:27016"},{"_id":2,"host":"m3:27017"}]} + +rs.initiate(config) + +db.getSiblingDB("admin").createUser({user:"admin",pwd:"1234",roles:[{role:"root",db:"admin"}]}); +``` + +### 2. Run the Authentication Server + +:::note +Make sure to run backend services before the frontend. If you haven’t already cloned the litmus project do so from the `litmuschaos/litmus` repository +::: + +```bash +git clone https://github.com/litmuschaos/litmus.git litmus --depth 1 +``` + + +Step-1: Export the following environment variables + +```bash +export ADMIN_USERNAME=admin +export ADMIN_PASSWORD=litmus +export DB_SERVER="mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" +export DB_USER=admin +export DB_PASSWORD=1234 +export REST_PORT=3000 +export GRPC_PORT=3030 +``` + +Windows +Docker or Hyper-V is reserving that port range. You can use 3030 ports by running the command below + +```shell +netsh interface ipv4 show excludedportrange protocol=tcp +net stop winnat +netsh int ipv4 add excludedportrange protocol=tcp startport=3030 numberofports=1 +net start winnat +``` + +Step-2: Run the go application + +```bash +cd chaoscenter/authentication/api +go run main.go +``` + +### 3. Run the GraphQL Server + +Step-1: Export the following environment variables + +```bash +export DB_SERVER="mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" +export DB_USER=admin +export DB_PASSWORD=1234 +export JWT_SECRET=litmus-portal@123 +export PORTAL_ENDPOINT=http://localhost:8080 +export LITMUS_SVC_ENDPOINT="" +export SELF_AGENT=false +export INFRA_SCOPE=cluster +export INFRA_NAMESPACE=litmus +export LITMUS_PORTAL_NAMESPACE=litmus +export PORTAL_SCOPE=namespace +export SUBSCRIBER_IMAGE=litmuschaos/litmusportal-subscriber:ci +export EVENT_TRACKER_IMAGE=litmuschaos/litmusportal-event-tracker:ci +export CONTAINER_RUNTIME_EXECUTOR=k8sapi +export ARGO_WORKFLOW_CONTROLLER_IMAGE=argoproj/workflow-controller:v2.11.0 +export ARGO_WORKFLOW_EXECUTOR_IMAGE=argoproj/argoexec:v2.11.0 +export CHAOS_CENTER_SCOPE=cluster +export WORKFLOW_HELPER_IMAGE_VERSION=3.0.0 +export LITMUS_CHAOS_OPERATOR_IMAGE=litmuschaos/chaos-operator:3.0.0 +export LITMUS_CHAOS_RUNNER_IMAGE=litmuschaos/chaos-runner:3.0.0 +export LITMUS_CHAOS_EXPORTER_IMAGE=litmuschaos/chaos-exporter:3.0.0 +export ADMIN_USERNAME=admin +export ADMIN_PASSWORD=litmus +export VERSION=ci +export HUB_BRANCH_NAME=v2.0.x +export INFRA_DEPLOYMENTS="[\"app=chaos-exporter\", \"name=chaos-operator\", \"app=event-tracker\",\"app=workflow-controller\"]" +export INFRA_COMPATIBLE_VERSIONS='["0.2.0", "0.1.0","ci"]' +export DEFAULT_HUB_BRANCH_NAME=master +``` + +Step-2: Run the go application + +```bash +cd chaoscenter/graphql/server +go run server.go +``` + +### 4. Run Frontend + +:::note +Make sure to run backend services before the frontend. +::: + +Step-1: Install all the dependencies + +```bash +cd litmus/chaoscenter/web +yarn +``` + +Step-2: Generate the ssl certificate + +Linux/Mac +```bash +yarn generate-certificate +``` + +Windows +The command you run is in the script/generate-certificate.sh file, but it doesn't work in a Windows environment, so please run the script below instead +```bash +mkdir -p certificates + +openssl req -x509 -newkey rsa:4096 -keyout certificates/localhost-key.pem -out certificates/localhost.pem -days 365 -nodes -subj '//C=US' +``` + +Step-3: Run the frontend project + +```bash +yarn dev +``` + +> It’ll prompt you to start the development server at port `8185` or any other port than 3000 since it is already being used by the auth server. + +Once you are able to see the Login Screen of Litmus use the following default credentials + +``` +Username: admin +Password: litmus +``` + + + + +## **Steps to connect Chaos Infrastructure** +### Using Litmusctl +Use [litmusctl](https://github.com/litmuschaos/litmusctl) on the same box/local cluster and connect an ns infrastructure + +### Using Chaoscenter +Use Chaoscenter to connect an Infrastructure, download the manifest and apply it on k3d/minikube. Once the pods are up(except the subscriber), run the following command: + +```shell +cd subscriber + +INFRA_ID= ACCESS_KEY= INFRA_SCOPE=cluster SERVER_ADDR=http://localhost:8080/query INFRA_NAMESPACE=litmus IS_INFRA_CONFIRMED="false" COMPONENTS="DEPLOYMENTS: ["app=chaos-exporter", "name=chaos-operator", "app=workflow-controller"]" START_TIME=1631089756 VERSION="ci" AGENT_POD="subscriber-78f6bd4db5-ck5d9" SKIP_ +SSL_VERIFY="false" go run subscriber.go -kubeconfig ~/.kube/config +``` \ No newline at end of file diff --git a/website/sidebars.js b/website/sidebars.js index cb933732..6b5cdc39 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -106,6 +106,9 @@ module.exports = { 'user-guides/uninstall-litmus' ] }, + { + 'Developer Guide': ['developer-guide/chaoscenter-developer-guide'] + }, { Litmusctl: ['litmusctl/installation', 'litmusctl/litmusctl-usage'] }, From d8c8b1f34caa82f9a91462f165850f5527f88ee3 Mon Sep 17 00:00:00 2001 From: DongYoung Kim Date: Thu, 1 Aug 2024 02:03:14 +0900 Subject: [PATCH 2/7] Updated current version docs for developer guide Signed-off-by: DongYoung Kim --- .../chaoscenter-developer-guide.md | 2 +- .../chaoscenter-developer-guide.md | 219 ++++++++++++++++++ .../version-3.9.1-sidebars.json | 5 + 3 files changed, 225 insertions(+), 1 deletion(-) create mode 100644 website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md diff --git a/website/docs/developer-guide/chaoscenter-developer-guide.md b/website/docs/developer-guide/chaoscenter-developer-guide.md index 0dd86f92..71b341c7 100644 --- a/website/docs/developer-guide/chaoscenter-developer-guide.md +++ b/website/docs/developer-guide/chaoscenter-developer-guide.md @@ -34,7 +34,7 @@ Frontend component Step-1: Pull and run the image ```bash -docker pull mongo:4.2 +docker pull mongo:5 docker network create mongo-cluster diff --git a/website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md b/website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md new file mode 100644 index 00000000..71b341c7 --- /dev/null +++ b/website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md @@ -0,0 +1,219 @@ +--- +id: chaoscenter-developer-guide +title: ChaosCenter Developer Guide +sidebar_label: ChaosCenter Developer Guide +--- + +--- + +## **Prerequisites** +:::note +This document is ietented to be implemented locally. Please do not use in dev or prod environmentss +::: + +- Kubernetes 1.17 or later +- Helm3 or Kubectl +- Node and npm +- Docker +- Golang +- Local Kubernetes Cluster (via minikube, k3s or kind) + +## **Control Plane** +Backend components consist of three microservices +1. GraphQL-Server +2. Authentication-Server +3. MongoDB + +Frontend component +1. React + +## **Steps to run the Control Plane** + +### 1. Run MongoDB + +Step-1: Pull and run the image + +```bash +docker pull mongo:5 + +docker network create mongo-cluster + +docker run -d --net mongo-cluster -p 27015:27015 --name m1 mongo:4.2 mongod --replSet rs0 --port 27015 +docker run -d --net mongo-cluster -p 27016:27016 --name m2 mongo:4.2 mongod --replSet rs0 --port 27016 +docker run -d --net mongo-cluster -p 27017:27017 --name m3 mongo:4.2 mongod --replSet rs0 --port 27017 +``` + +Step-2: Add hosts + +Windows +```bash +# add hosts in hosts +notepad C:\Windows\System32\drivers\etc\hosts + +# add the below line +127.0.0.1 m1 m2 m3 +``` + +Linux/Mac +```bash +# add hosts in hosts +sudo vim /etc/hosts + +# add the below line +127.0.0.1 m1 m2 m3 +``` + + +Step-3: Configure the mongoDB replica set + +```bash +docker exec -it m1 mongo -port 27015 + +config={"_id":"rs0","members":[{"_id":0,"host":"m1:27015"},{"_id":1,"host":"m2:27016"},{"_id":2,"host":"m3:27017"}]} + +rs.initiate(config) + +db.getSiblingDB("admin").createUser({user:"admin",pwd:"1234",roles:[{role:"root",db:"admin"}]}); +``` + +### 2. Run the Authentication Server + +:::note +Make sure to run backend services before the frontend. If you haven’t already cloned the litmus project do so from the `litmuschaos/litmus` repository +::: + +```bash +git clone https://github.com/litmuschaos/litmus.git litmus --depth 1 +``` + + +Step-1: Export the following environment variables + +```bash +export ADMIN_USERNAME=admin +export ADMIN_PASSWORD=litmus +export DB_SERVER="mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" +export DB_USER=admin +export DB_PASSWORD=1234 +export REST_PORT=3000 +export GRPC_PORT=3030 +``` + +Windows +Docker or Hyper-V is reserving that port range. You can use 3030 ports by running the command below + +```shell +netsh interface ipv4 show excludedportrange protocol=tcp +net stop winnat +netsh int ipv4 add excludedportrange protocol=tcp startport=3030 numberofports=1 +net start winnat +``` + +Step-2: Run the go application + +```bash +cd chaoscenter/authentication/api +go run main.go +``` + +### 3. Run the GraphQL Server + +Step-1: Export the following environment variables + +```bash +export DB_SERVER="mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" +export DB_USER=admin +export DB_PASSWORD=1234 +export JWT_SECRET=litmus-portal@123 +export PORTAL_ENDPOINT=http://localhost:8080 +export LITMUS_SVC_ENDPOINT="" +export SELF_AGENT=false +export INFRA_SCOPE=cluster +export INFRA_NAMESPACE=litmus +export LITMUS_PORTAL_NAMESPACE=litmus +export PORTAL_SCOPE=namespace +export SUBSCRIBER_IMAGE=litmuschaos/litmusportal-subscriber:ci +export EVENT_TRACKER_IMAGE=litmuschaos/litmusportal-event-tracker:ci +export CONTAINER_RUNTIME_EXECUTOR=k8sapi +export ARGO_WORKFLOW_CONTROLLER_IMAGE=argoproj/workflow-controller:v2.11.0 +export ARGO_WORKFLOW_EXECUTOR_IMAGE=argoproj/argoexec:v2.11.0 +export CHAOS_CENTER_SCOPE=cluster +export WORKFLOW_HELPER_IMAGE_VERSION=3.0.0 +export LITMUS_CHAOS_OPERATOR_IMAGE=litmuschaos/chaos-operator:3.0.0 +export LITMUS_CHAOS_RUNNER_IMAGE=litmuschaos/chaos-runner:3.0.0 +export LITMUS_CHAOS_EXPORTER_IMAGE=litmuschaos/chaos-exporter:3.0.0 +export ADMIN_USERNAME=admin +export ADMIN_PASSWORD=litmus +export VERSION=ci +export HUB_BRANCH_NAME=v2.0.x +export INFRA_DEPLOYMENTS="[\"app=chaos-exporter\", \"name=chaos-operator\", \"app=event-tracker\",\"app=workflow-controller\"]" +export INFRA_COMPATIBLE_VERSIONS='["0.2.0", "0.1.0","ci"]' +export DEFAULT_HUB_BRANCH_NAME=master +``` + +Step-2: Run the go application + +```bash +cd chaoscenter/graphql/server +go run server.go +``` + +### 4. Run Frontend + +:::note +Make sure to run backend services before the frontend. +::: + +Step-1: Install all the dependencies + +```bash +cd litmus/chaoscenter/web +yarn +``` + +Step-2: Generate the ssl certificate + +Linux/Mac +```bash +yarn generate-certificate +``` + +Windows +The command you run is in the script/generate-certificate.sh file, but it doesn't work in a Windows environment, so please run the script below instead +```bash +mkdir -p certificates + +openssl req -x509 -newkey rsa:4096 -keyout certificates/localhost-key.pem -out certificates/localhost.pem -days 365 -nodes -subj '//C=US' +``` + +Step-3: Run the frontend project + +```bash +yarn dev +``` + +> It’ll prompt you to start the development server at port `8185` or any other port than 3000 since it is already being used by the auth server. + +Once you are able to see the Login Screen of Litmus use the following default credentials + +``` +Username: admin +Password: litmus +``` + + + + +## **Steps to connect Chaos Infrastructure** +### Using Litmusctl +Use [litmusctl](https://github.com/litmuschaos/litmusctl) on the same box/local cluster and connect an ns infrastructure + +### Using Chaoscenter +Use Chaoscenter to connect an Infrastructure, download the manifest and apply it on k3d/minikube. Once the pods are up(except the subscriber), run the following command: + +```shell +cd subscriber + +INFRA_ID= ACCESS_KEY= INFRA_SCOPE=cluster SERVER_ADDR=http://localhost:8080/query INFRA_NAMESPACE=litmus IS_INFRA_CONFIRMED="false" COMPONENTS="DEPLOYMENTS: ["app=chaos-exporter", "name=chaos-operator", "app=workflow-controller"]" START_TIME=1631089756 VERSION="ci" AGENT_POD="subscriber-78f6bd4db5-ck5d9" SKIP_ +SSL_VERIFY="false" go run subscriber.go -kubeconfig ~/.kube/config +``` \ No newline at end of file diff --git a/website/versioned_sidebars/version-3.9.1-sidebars.json b/website/versioned_sidebars/version-3.9.1-sidebars.json index 939a4d4d..9c12b115 100644 --- a/website/versioned_sidebars/version-3.9.1-sidebars.json +++ b/website/versioned_sidebars/version-3.9.1-sidebars.json @@ -115,6 +115,11 @@ "user-guides/uninstall-litmus" ] }, + { + "Developer Guide": [ + "developer-guide/chaoscenter-developer-guide" + ] + }, { "Litmusctl": [ "litmusctl/installation", From 3a26cf8e39004b5c38a31cf42eb185e364f6b74e Mon Sep 17 00:00:00 2001 From: kwx4957 Date: Fri, 9 Aug 2024 15:14:47 +0900 Subject: [PATCH 3/7] CI embedmd check Signed-off-by: kwx4957 --- website/docs/developer-guide/chaoscenter-developer-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/developer-guide/chaoscenter-developer-guide.md b/website/docs/developer-guide/chaoscenter-developer-guide.md index 71b341c7..82f3df16 100644 --- a/website/docs/developer-guide/chaoscenter-developer-guide.md +++ b/website/docs/developer-guide/chaoscenter-developer-guide.md @@ -216,4 +216,4 @@ cd subscriber INFRA_ID= ACCESS_KEY= INFRA_SCOPE=cluster SERVER_ADDR=http://localhost:8080/query INFRA_NAMESPACE=litmus IS_INFRA_CONFIRMED="false" COMPONENTS="DEPLOYMENTS: ["app=chaos-exporter", "name=chaos-operator", "app=workflow-controller"]" START_TIME=1631089756 VERSION="ci" AGENT_POD="subscriber-78f6bd4db5-ck5d9" SKIP_ SSL_VERIFY="false" go run subscriber.go -kubeconfig ~/.kube/config -``` \ No newline at end of file +``` From e42f8e7d12c5e5d945e7c0efaf5122c374dff0e5 Mon Sep 17 00:00:00 2001 From: DongYoung Kim Date: Sat, 10 Aug 2024 02:23:57 +0900 Subject: [PATCH 4/7] Update docs as per reviewer suggestion Signed-off-by: DongYoung Kim --- .../chaoscenter-developer-guide.md | 74 ++++++++++++++---- .../chaoscenter-developer-guide.md | 76 +++++++++++++++---- 2 files changed, 122 insertions(+), 28 deletions(-) diff --git a/website/docs/developer-guide/chaoscenter-developer-guide.md b/website/docs/developer-guide/chaoscenter-developer-guide.md index 82f3df16..bc46ff20 100644 --- a/website/docs/developer-guide/chaoscenter-developer-guide.md +++ b/website/docs/developer-guide/chaoscenter-developer-guide.md @@ -8,7 +8,7 @@ sidebar_label: ChaosCenter Developer Guide ## **Prerequisites** :::note -This document is ietented to be implemented locally. Please do not use in dev or prod environmentss +This document is intended to be implemented locally. Please do not use in dev or prod environments. ::: - Kubernetes 1.17 or later @@ -20,8 +20,8 @@ This document is ietented to be implemented locally. Please do not use in dev or ## **Control Plane** Backend components consist of three microservices -1. GraphQL-Server -2. Authentication-Server +1. Backend server +2. Authentication server 3. MongoDB Frontend component @@ -45,7 +45,12 @@ docker run -d --net mongo-cluster -p 27017:27017 --name m3 mongo:4.2 mongod --re Step-2: Add hosts -Windows +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + ```bash # add hosts in hosts notepad C:\Windows\System32\drivers\etc\hosts @@ -54,7 +59,9 @@ notepad C:\Windows\System32\drivers\etc\hosts 127.0.0.1 m1 m2 m3 ``` -Linux/Mac + + + ```bash # add hosts in hosts sudo vim /etc/hosts @@ -63,6 +70,9 @@ sudo vim /etc/hosts 127.0.0.1 m1 m2 m3 ``` + + + Step-3: Configure the mongoDB replica set @@ -95,20 +105,49 @@ export ADMIN_PASSWORD=litmus export DB_SERVER="mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" export DB_USER=admin export DB_PASSWORD=1234 +export JWT_SECRET=litmus-portal@123 +export PORTAL_ENDPOINT=http://localhost:8080 +export LITMUS_SVC_ENDPOINT="" +export SELF_AGENT=false +export INFRA_SCOPE=cluster +export INFRA_NAMESPACE=litmus +export LITMUS_PORTAL_NAMESPACE=litmus +export PORTAL_SCOPE=namespace +export SUBSCRIBER_IMAGE=litmuschaos/litmusportal-subscriber:ci +export EVENT_TRACKER_IMAGE=litmuschaos/litmusportal-event-tracker:ci +export CONTAINER_RUNTIME_EXECUTOR=k8sapi +export ARGO_WORKFLOW_CONTROLLER_IMAGE=argoproj/workflow-controller:v2.11.0 +export ARGO_WORKFLOW_EXECUTOR_IMAGE=argoproj/argoexec:v2.11.0 +export CHAOS_CENTER_SCOPE=cluster +export WORKFLOW_HELPER_IMAGE_VERSION=3.0.0 +export LITMUS_CHAOS_OPERATOR_IMAGE=litmuschaos/chaos-operator:3.0.0 +export LITMUS_CHAOS_RUNNER_IMAGE=litmuschaos/chaos-runner:3.0.0 +export LITMUS_CHAOS_EXPORTER_IMAGE=litmuschaos/chaos-exporter:3.0.0 +export VERSION=ci +export HUB_BRANCH_NAME=v2.0.x +export INFRA_DEPLOYMENTS="[\"app=chaos-exporter\", \"name=chaos-operator\", \"app=event-tracker\",\"app=workflow-controller\"]" +export INFRA_COMPATIBLE_VERSIONS='["0.2.0", "0.1.0","ci"]' +export DEFAULT_HUB_BRANCH_NAME=master +export ENABLE_INTERNAL_TLS=false export REST_PORT=3000 export GRPC_PORT=3030 ``` -Windows + + + Docker or Hyper-V is reserving that port range. You can use 3030 ports by running the command below -```shell +```bash netsh interface ipv4 show excludedportrange protocol=tcp net stop winnat netsh int ipv4 add excludedportrange protocol=tcp startport=3030 numberofports=1 net start winnat ``` + + + Step-2: Run the go application ```bash @@ -172,20 +211,27 @@ yarn ``` Step-2: Generate the ssl certificate + + -Linux/Mac -```bash -yarn generate-certificate -``` - -Windows The command you run is in the script/generate-certificate.sh file, but it doesn't work in a Windows environment, so please run the script below instead + ```bash mkdir -p certificates openssl req -x509 -newkey rsa:4096 -keyout certificates/localhost-key.pem -out certificates/localhost.pem -days 365 -nodes -subj '//C=US' ``` + + + +```bash +yarn generate-certificate +``` + + + + Step-3: Run the frontend project ```bash @@ -211,7 +257,7 @@ Use [litmusctl](https://github.com/litmuschaos/litmusctl) on the same box/loca ### Using Chaoscenter Use Chaoscenter to connect an Infrastructure, download the manifest and apply it on k3d/minikube. Once the pods are up(except the subscriber), run the following command: -```shell +```bash cd subscriber INFRA_ID= ACCESS_KEY= INFRA_SCOPE=cluster SERVER_ADDR=http://localhost:8080/query INFRA_NAMESPACE=litmus IS_INFRA_CONFIRMED="false" COMPONENTS="DEPLOYMENTS: ["app=chaos-exporter", "name=chaos-operator", "app=workflow-controller"]" START_TIME=1631089756 VERSION="ci" AGENT_POD="subscriber-78f6bd4db5-ck5d9" SKIP_ diff --git a/website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md b/website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md index 71b341c7..cbd285f6 100644 --- a/website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md +++ b/website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md @@ -8,7 +8,7 @@ sidebar_label: ChaosCenter Developer Guide ## **Prerequisites** :::note -This document is ietented to be implemented locally. Please do not use in dev or prod environmentss +This document is intended to be implemented locally. Please do not use in dev or prod environments. ::: - Kubernetes 1.17 or later @@ -20,8 +20,8 @@ This document is ietented to be implemented locally. Please do not use in dev or ## **Control Plane** Backend components consist of three microservices -1. GraphQL-Server -2. Authentication-Server +1. Backend server +2. Authentication server 3. MongoDB Frontend component @@ -45,7 +45,12 @@ docker run -d --net mongo-cluster -p 27017:27017 --name m3 mongo:4.2 mongod --re Step-2: Add hosts -Windows +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + ```bash # add hosts in hosts notepad C:\Windows\System32\drivers\etc\hosts @@ -54,7 +59,9 @@ notepad C:\Windows\System32\drivers\etc\hosts 127.0.0.1 m1 m2 m3 ``` -Linux/Mac + + + ```bash # add hosts in hosts sudo vim /etc/hosts @@ -63,6 +70,9 @@ sudo vim /etc/hosts 127.0.0.1 m1 m2 m3 ``` + + + Step-3: Configure the mongoDB replica set @@ -95,20 +105,51 @@ export ADMIN_PASSWORD=litmus export DB_SERVER="mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" export DB_USER=admin export DB_PASSWORD=1234 +export JWT_SECRET=litmus-portal@123 +export PORTAL_ENDPOINT=http://localhost:8080 +export LITMUS_SVC_ENDPOINT="" +export SELF_AGENT=false +export INFRA_SCOPE=cluster +export INFRA_NAMESPACE=litmus +export LITMUS_PORTAL_NAMESPACE=litmus +export PORTAL_SCOPE=namespace +export SUBSCRIBER_IMAGE=litmuschaos/litmusportal-subscriber:ci +export EVENT_TRACKER_IMAGE=litmuschaos/litmusportal-event-tracker:ci +export CONTAINER_RUNTIME_EXECUTOR=k8sapi +export ARGO_WORKFLOW_CONTROLLER_IMAGE=argoproj/workflow-controller:v2.11.0 +export ARGO_WORKFLOW_EXECUTOR_IMAGE=argoproj/argoexec:v2.11.0 +export CHAOS_CENTER_SCOPE=cluster +export WORKFLOW_HELPER_IMAGE_VERSION=3.0.0 +export LITMUS_CHAOS_OPERATOR_IMAGE=litmuschaos/chaos-operator:3.0.0 +export LITMUS_CHAOS_RUNNER_IMAGE=litmuschaos/chaos-runner:3.0.0 +export LITMUS_CHAOS_EXPORTER_IMAGE=litmuschaos/chaos-exporter:3.0.0 +export ADMIN_USERNAME=admin +export ADMIN_PASSWORD=litmus +export VERSION=ci +export HUB_BRANCH_NAME=v2.0.x +export INFRA_DEPLOYMENTS="[\"app=chaos-exporter\", \"name=chaos-operator\", \"app=event-tracker\",\"app=workflow-controller\"]" +export INFRA_COMPATIBLE_VERSIONS='["0.2.0", "0.1.0","ci"]' +export DEFAULT_HUB_BRANCH_NAME=master +export ENABLE_INTERNAL_TLS=false export REST_PORT=3000 export GRPC_PORT=3030 ``` -Windows + + + Docker or Hyper-V is reserving that port range. You can use 3030 ports by running the command below -```shell +```bash netsh interface ipv4 show excludedportrange protocol=tcp net stop winnat netsh int ipv4 add excludedportrange protocol=tcp startport=3030 numberofports=1 net start winnat ``` + + + Step-2: Run the go application ```bash @@ -172,20 +213,27 @@ yarn ``` Step-2: Generate the ssl certificate + + -Linux/Mac -```bash -yarn generate-certificate -``` - -Windows The command you run is in the script/generate-certificate.sh file, but it doesn't work in a Windows environment, so please run the script below instead + ```bash mkdir -p certificates openssl req -x509 -newkey rsa:4096 -keyout certificates/localhost-key.pem -out certificates/localhost.pem -days 365 -nodes -subj '//C=US' ``` + + + +```bash +yarn generate-certificate +``` + + + + Step-3: Run the frontend project ```bash @@ -211,7 +259,7 @@ Use [litmusctl](https://github.com/litmuschaos/litmusctl) on the same box/loca ### Using Chaoscenter Use Chaoscenter to connect an Infrastructure, download the manifest and apply it on k3d/minikube. Once the pods are up(except the subscriber), run the following command: -```shell +```bash cd subscriber INFRA_ID= ACCESS_KEY= INFRA_SCOPE=cluster SERVER_ADDR=http://localhost:8080/query INFRA_NAMESPACE=litmus IS_INFRA_CONFIRMED="false" COMPONENTS="DEPLOYMENTS: ["app=chaos-exporter", "name=chaos-operator", "app=workflow-controller"]" START_TIME=1631089756 VERSION="ci" AGENT_POD="subscriber-78f6bd4db5-ck5d9" SKIP_ From 463673e681932cf2c97224300770311b6b38c0f2 Mon Sep 17 00:00:00 2001 From: DongYoung Kim Date: Wed, 11 Sep 2024 14:15:51 +0900 Subject: [PATCH 5/7] Fix backend server name to GraphQL server Signed-off-by: DongYoung Kim --- website/docs/developer-guide/chaoscenter-developer-guide.md | 2 +- .../developer-guide/chaoscenter-developer-guide.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/developer-guide/chaoscenter-developer-guide.md b/website/docs/developer-guide/chaoscenter-developer-guide.md index bc46ff20..a4fd3d2d 100644 --- a/website/docs/developer-guide/chaoscenter-developer-guide.md +++ b/website/docs/developer-guide/chaoscenter-developer-guide.md @@ -20,7 +20,7 @@ This document is intended to be implemented locally. Please do not use in dev or ## **Control Plane** Backend components consist of three microservices -1. Backend server +1. GraphQL server 2. Authentication server 3. MongoDB diff --git a/website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md b/website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md index cbd285f6..021405ff 100644 --- a/website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md +++ b/website/versioned_docs/version-3.9.1/developer-guide/chaoscenter-developer-guide.md @@ -20,7 +20,7 @@ This document is intended to be implemented locally. Please do not use in dev or ## **Control Plane** Backend components consist of three microservices -1. Backend server +1. GraphQL server 2. Authentication server 3. MongoDB From a300dfb1237d890bf215e9045896d58bfa0efb42 Mon Sep 17 00:00:00 2001 From: DongYoung Kim Date: Wed, 11 Sep 2024 14:18:13 +0900 Subject: [PATCH 6/7] Add developer guide docs for 3.9.2 Signed-off-by: DongYoung Kim --- .../chaoscenter-developer-guide.md | 267 ++++++++++++++++++ .../version-3.9.2-sidebars.json | 4 + 2 files changed, 271 insertions(+) create mode 100644 website/versioned_docs/version-3.9.2/developer-guide/chaoscenter-developer-guide.md diff --git a/website/versioned_docs/version-3.9.2/developer-guide/chaoscenter-developer-guide.md b/website/versioned_docs/version-3.9.2/developer-guide/chaoscenter-developer-guide.md new file mode 100644 index 00000000..021405ff --- /dev/null +++ b/website/versioned_docs/version-3.9.2/developer-guide/chaoscenter-developer-guide.md @@ -0,0 +1,267 @@ +--- +id: chaoscenter-developer-guide +title: ChaosCenter Developer Guide +sidebar_label: ChaosCenter Developer Guide +--- + +--- + +## **Prerequisites** +:::note +This document is intended to be implemented locally. Please do not use in dev or prod environments. +::: + +- Kubernetes 1.17 or later +- Helm3 or Kubectl +- Node and npm +- Docker +- Golang +- Local Kubernetes Cluster (via minikube, k3s or kind) + +## **Control Plane** +Backend components consist of three microservices +1. GraphQL server +2. Authentication server +3. MongoDB + +Frontend component +1. React + +## **Steps to run the Control Plane** + +### 1. Run MongoDB + +Step-1: Pull and run the image + +```bash +docker pull mongo:5 + +docker network create mongo-cluster + +docker run -d --net mongo-cluster -p 27015:27015 --name m1 mongo:4.2 mongod --replSet rs0 --port 27015 +docker run -d --net mongo-cluster -p 27016:27016 --name m2 mongo:4.2 mongod --replSet rs0 --port 27016 +docker run -d --net mongo-cluster -p 27017:27017 --name m3 mongo:4.2 mongod --replSet rs0 --port 27017 +``` + +Step-2: Add hosts + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +```bash +# add hosts in hosts +notepad C:\Windows\System32\drivers\etc\hosts + +# add the below line +127.0.0.1 m1 m2 m3 +``` + + + + +```bash +# add hosts in hosts +sudo vim /etc/hosts + +# add the below line +127.0.0.1 m1 m2 m3 +``` + + + + + +Step-3: Configure the mongoDB replica set + +```bash +docker exec -it m1 mongo -port 27015 + +config={"_id":"rs0","members":[{"_id":0,"host":"m1:27015"},{"_id":1,"host":"m2:27016"},{"_id":2,"host":"m3:27017"}]} + +rs.initiate(config) + +db.getSiblingDB("admin").createUser({user:"admin",pwd:"1234",roles:[{role:"root",db:"admin"}]}); +``` + +### 2. Run the Authentication Server + +:::note +Make sure to run backend services before the frontend. If you haven’t already cloned the litmus project do so from the `litmuschaos/litmus` repository +::: + +```bash +git clone https://github.com/litmuschaos/litmus.git litmus --depth 1 +``` + + +Step-1: Export the following environment variables + +```bash +export ADMIN_USERNAME=admin +export ADMIN_PASSWORD=litmus +export DB_SERVER="mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" +export DB_USER=admin +export DB_PASSWORD=1234 +export JWT_SECRET=litmus-portal@123 +export PORTAL_ENDPOINT=http://localhost:8080 +export LITMUS_SVC_ENDPOINT="" +export SELF_AGENT=false +export INFRA_SCOPE=cluster +export INFRA_NAMESPACE=litmus +export LITMUS_PORTAL_NAMESPACE=litmus +export PORTAL_SCOPE=namespace +export SUBSCRIBER_IMAGE=litmuschaos/litmusportal-subscriber:ci +export EVENT_TRACKER_IMAGE=litmuschaos/litmusportal-event-tracker:ci +export CONTAINER_RUNTIME_EXECUTOR=k8sapi +export ARGO_WORKFLOW_CONTROLLER_IMAGE=argoproj/workflow-controller:v2.11.0 +export ARGO_WORKFLOW_EXECUTOR_IMAGE=argoproj/argoexec:v2.11.0 +export CHAOS_CENTER_SCOPE=cluster +export WORKFLOW_HELPER_IMAGE_VERSION=3.0.0 +export LITMUS_CHAOS_OPERATOR_IMAGE=litmuschaos/chaos-operator:3.0.0 +export LITMUS_CHAOS_RUNNER_IMAGE=litmuschaos/chaos-runner:3.0.0 +export LITMUS_CHAOS_EXPORTER_IMAGE=litmuschaos/chaos-exporter:3.0.0 +export ADMIN_USERNAME=admin +export ADMIN_PASSWORD=litmus +export VERSION=ci +export HUB_BRANCH_NAME=v2.0.x +export INFRA_DEPLOYMENTS="[\"app=chaos-exporter\", \"name=chaos-operator\", \"app=event-tracker\",\"app=workflow-controller\"]" +export INFRA_COMPATIBLE_VERSIONS='["0.2.0", "0.1.0","ci"]' +export DEFAULT_HUB_BRANCH_NAME=master +export ENABLE_INTERNAL_TLS=false +export REST_PORT=3000 +export GRPC_PORT=3030 +``` + + + + +Docker or Hyper-V is reserving that port range. You can use 3030 ports by running the command below + +```bash +netsh interface ipv4 show excludedportrange protocol=tcp +net stop winnat +netsh int ipv4 add excludedportrange protocol=tcp startport=3030 numberofports=1 +net start winnat +``` + + + + +Step-2: Run the go application + +```bash +cd chaoscenter/authentication/api +go run main.go +``` + +### 3. Run the GraphQL Server + +Step-1: Export the following environment variables + +```bash +export DB_SERVER="mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" +export DB_USER=admin +export DB_PASSWORD=1234 +export JWT_SECRET=litmus-portal@123 +export PORTAL_ENDPOINT=http://localhost:8080 +export LITMUS_SVC_ENDPOINT="" +export SELF_AGENT=false +export INFRA_SCOPE=cluster +export INFRA_NAMESPACE=litmus +export LITMUS_PORTAL_NAMESPACE=litmus +export PORTAL_SCOPE=namespace +export SUBSCRIBER_IMAGE=litmuschaos/litmusportal-subscriber:ci +export EVENT_TRACKER_IMAGE=litmuschaos/litmusportal-event-tracker:ci +export CONTAINER_RUNTIME_EXECUTOR=k8sapi +export ARGO_WORKFLOW_CONTROLLER_IMAGE=argoproj/workflow-controller:v2.11.0 +export ARGO_WORKFLOW_EXECUTOR_IMAGE=argoproj/argoexec:v2.11.0 +export CHAOS_CENTER_SCOPE=cluster +export WORKFLOW_HELPER_IMAGE_VERSION=3.0.0 +export LITMUS_CHAOS_OPERATOR_IMAGE=litmuschaos/chaos-operator:3.0.0 +export LITMUS_CHAOS_RUNNER_IMAGE=litmuschaos/chaos-runner:3.0.0 +export LITMUS_CHAOS_EXPORTER_IMAGE=litmuschaos/chaos-exporter:3.0.0 +export ADMIN_USERNAME=admin +export ADMIN_PASSWORD=litmus +export VERSION=ci +export HUB_BRANCH_NAME=v2.0.x +export INFRA_DEPLOYMENTS="[\"app=chaos-exporter\", \"name=chaos-operator\", \"app=event-tracker\",\"app=workflow-controller\"]" +export INFRA_COMPATIBLE_VERSIONS='["0.2.0", "0.1.0","ci"]' +export DEFAULT_HUB_BRANCH_NAME=master +``` + +Step-2: Run the go application + +```bash +cd chaoscenter/graphql/server +go run server.go +``` + +### 4. Run Frontend + +:::note +Make sure to run backend services before the frontend. +::: + +Step-1: Install all the dependencies + +```bash +cd litmus/chaoscenter/web +yarn +``` + +Step-2: Generate the ssl certificate + + + +The command you run is in the script/generate-certificate.sh file, but it doesn't work in a Windows environment, so please run the script below instead + +```bash +mkdir -p certificates + +openssl req -x509 -newkey rsa:4096 -keyout certificates/localhost-key.pem -out certificates/localhost.pem -days 365 -nodes -subj '//C=US' +``` + + + + +```bash +yarn generate-certificate +``` + + + + +Step-3: Run the frontend project + +```bash +yarn dev +``` + +> It’ll prompt you to start the development server at port `8185` or any other port than 3000 since it is already being used by the auth server. + +Once you are able to see the Login Screen of Litmus use the following default credentials + +``` +Username: admin +Password: litmus +``` + + + + +## **Steps to connect Chaos Infrastructure** +### Using Litmusctl +Use [litmusctl](https://github.com/litmuschaos/litmusctl) on the same box/local cluster and connect an ns infrastructure + +### Using Chaoscenter +Use Chaoscenter to connect an Infrastructure, download the manifest and apply it on k3d/minikube. Once the pods are up(except the subscriber), run the following command: + +```bash +cd subscriber + +INFRA_ID= ACCESS_KEY= INFRA_SCOPE=cluster SERVER_ADDR=http://localhost:8080/query INFRA_NAMESPACE=litmus IS_INFRA_CONFIRMED="false" COMPONENTS="DEPLOYMENTS: ["app=chaos-exporter", "name=chaos-operator", "app=workflow-controller"]" START_TIME=1631089756 VERSION="ci" AGENT_POD="subscriber-78f6bd4db5-ck5d9" SKIP_ +SSL_VERIFY="false" go run subscriber.go -kubeconfig ~/.kube/config +``` \ No newline at end of file diff --git a/website/versioned_sidebars/version-3.9.2-sidebars.json b/website/versioned_sidebars/version-3.9.2-sidebars.json index 939a4d4d..768f249b 100644 --- a/website/versioned_sidebars/version-3.9.2-sidebars.json +++ b/website/versioned_sidebars/version-3.9.2-sidebars.json @@ -114,6 +114,10 @@ "user-guides/image-registry", "user-guides/uninstall-litmus" ] + },{ + "Developer Guide": [ + "developer-guide/chaoscenter-developer-guide" + ] }, { "Litmusctl": [ From be32ed81bfb80a7ec07493d429629eed29726700 Mon Sep 17 00:00:00 2001 From: DongYoung Kim Date: Wed, 11 Sep 2024 14:18:23 +0900 Subject: [PATCH 7/7] Add developer guide docs for 3.10.0 Signed-off-by: DongYoung Kim --- .../chaoscenter-developer-guide.md | 267 ++++++++++++++++++ .../version-3.10.0-sidebars.json | 5 + 2 files changed, 272 insertions(+) create mode 100644 website/versioned_docs/version-3.10.0/developer-guide/chaoscenter-developer-guide.md diff --git a/website/versioned_docs/version-3.10.0/developer-guide/chaoscenter-developer-guide.md b/website/versioned_docs/version-3.10.0/developer-guide/chaoscenter-developer-guide.md new file mode 100644 index 00000000..021405ff --- /dev/null +++ b/website/versioned_docs/version-3.10.0/developer-guide/chaoscenter-developer-guide.md @@ -0,0 +1,267 @@ +--- +id: chaoscenter-developer-guide +title: ChaosCenter Developer Guide +sidebar_label: ChaosCenter Developer Guide +--- + +--- + +## **Prerequisites** +:::note +This document is intended to be implemented locally. Please do not use in dev or prod environments. +::: + +- Kubernetes 1.17 or later +- Helm3 or Kubectl +- Node and npm +- Docker +- Golang +- Local Kubernetes Cluster (via minikube, k3s or kind) + +## **Control Plane** +Backend components consist of three microservices +1. GraphQL server +2. Authentication server +3. MongoDB + +Frontend component +1. React + +## **Steps to run the Control Plane** + +### 1. Run MongoDB + +Step-1: Pull and run the image + +```bash +docker pull mongo:5 + +docker network create mongo-cluster + +docker run -d --net mongo-cluster -p 27015:27015 --name m1 mongo:4.2 mongod --replSet rs0 --port 27015 +docker run -d --net mongo-cluster -p 27016:27016 --name m2 mongo:4.2 mongod --replSet rs0 --port 27016 +docker run -d --net mongo-cluster -p 27017:27017 --name m3 mongo:4.2 mongod --replSet rs0 --port 27017 +``` + +Step-2: Add hosts + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +```bash +# add hosts in hosts +notepad C:\Windows\System32\drivers\etc\hosts + +# add the below line +127.0.0.1 m1 m2 m3 +``` + + + + +```bash +# add hosts in hosts +sudo vim /etc/hosts + +# add the below line +127.0.0.1 m1 m2 m3 +``` + + + + + +Step-3: Configure the mongoDB replica set + +```bash +docker exec -it m1 mongo -port 27015 + +config={"_id":"rs0","members":[{"_id":0,"host":"m1:27015"},{"_id":1,"host":"m2:27016"},{"_id":2,"host":"m3:27017"}]} + +rs.initiate(config) + +db.getSiblingDB("admin").createUser({user:"admin",pwd:"1234",roles:[{role:"root",db:"admin"}]}); +``` + +### 2. Run the Authentication Server + +:::note +Make sure to run backend services before the frontend. If you haven’t already cloned the litmus project do so from the `litmuschaos/litmus` repository +::: + +```bash +git clone https://github.com/litmuschaos/litmus.git litmus --depth 1 +``` + + +Step-1: Export the following environment variables + +```bash +export ADMIN_USERNAME=admin +export ADMIN_PASSWORD=litmus +export DB_SERVER="mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" +export DB_USER=admin +export DB_PASSWORD=1234 +export JWT_SECRET=litmus-portal@123 +export PORTAL_ENDPOINT=http://localhost:8080 +export LITMUS_SVC_ENDPOINT="" +export SELF_AGENT=false +export INFRA_SCOPE=cluster +export INFRA_NAMESPACE=litmus +export LITMUS_PORTAL_NAMESPACE=litmus +export PORTAL_SCOPE=namespace +export SUBSCRIBER_IMAGE=litmuschaos/litmusportal-subscriber:ci +export EVENT_TRACKER_IMAGE=litmuschaos/litmusportal-event-tracker:ci +export CONTAINER_RUNTIME_EXECUTOR=k8sapi +export ARGO_WORKFLOW_CONTROLLER_IMAGE=argoproj/workflow-controller:v2.11.0 +export ARGO_WORKFLOW_EXECUTOR_IMAGE=argoproj/argoexec:v2.11.0 +export CHAOS_CENTER_SCOPE=cluster +export WORKFLOW_HELPER_IMAGE_VERSION=3.0.0 +export LITMUS_CHAOS_OPERATOR_IMAGE=litmuschaos/chaos-operator:3.0.0 +export LITMUS_CHAOS_RUNNER_IMAGE=litmuschaos/chaos-runner:3.0.0 +export LITMUS_CHAOS_EXPORTER_IMAGE=litmuschaos/chaos-exporter:3.0.0 +export ADMIN_USERNAME=admin +export ADMIN_PASSWORD=litmus +export VERSION=ci +export HUB_BRANCH_NAME=v2.0.x +export INFRA_DEPLOYMENTS="[\"app=chaos-exporter\", \"name=chaos-operator\", \"app=event-tracker\",\"app=workflow-controller\"]" +export INFRA_COMPATIBLE_VERSIONS='["0.2.0", "0.1.0","ci"]' +export DEFAULT_HUB_BRANCH_NAME=master +export ENABLE_INTERNAL_TLS=false +export REST_PORT=3000 +export GRPC_PORT=3030 +``` + + + + +Docker or Hyper-V is reserving that port range. You can use 3030 ports by running the command below + +```bash +netsh interface ipv4 show excludedportrange protocol=tcp +net stop winnat +netsh int ipv4 add excludedportrange protocol=tcp startport=3030 numberofports=1 +net start winnat +``` + + + + +Step-2: Run the go application + +```bash +cd chaoscenter/authentication/api +go run main.go +``` + +### 3. Run the GraphQL Server + +Step-1: Export the following environment variables + +```bash +export DB_SERVER="mongodb://m1:27015,m2:27016,m3:27017/?replicaSet=rs0" +export DB_USER=admin +export DB_PASSWORD=1234 +export JWT_SECRET=litmus-portal@123 +export PORTAL_ENDPOINT=http://localhost:8080 +export LITMUS_SVC_ENDPOINT="" +export SELF_AGENT=false +export INFRA_SCOPE=cluster +export INFRA_NAMESPACE=litmus +export LITMUS_PORTAL_NAMESPACE=litmus +export PORTAL_SCOPE=namespace +export SUBSCRIBER_IMAGE=litmuschaos/litmusportal-subscriber:ci +export EVENT_TRACKER_IMAGE=litmuschaos/litmusportal-event-tracker:ci +export CONTAINER_RUNTIME_EXECUTOR=k8sapi +export ARGO_WORKFLOW_CONTROLLER_IMAGE=argoproj/workflow-controller:v2.11.0 +export ARGO_WORKFLOW_EXECUTOR_IMAGE=argoproj/argoexec:v2.11.0 +export CHAOS_CENTER_SCOPE=cluster +export WORKFLOW_HELPER_IMAGE_VERSION=3.0.0 +export LITMUS_CHAOS_OPERATOR_IMAGE=litmuschaos/chaos-operator:3.0.0 +export LITMUS_CHAOS_RUNNER_IMAGE=litmuschaos/chaos-runner:3.0.0 +export LITMUS_CHAOS_EXPORTER_IMAGE=litmuschaos/chaos-exporter:3.0.0 +export ADMIN_USERNAME=admin +export ADMIN_PASSWORD=litmus +export VERSION=ci +export HUB_BRANCH_NAME=v2.0.x +export INFRA_DEPLOYMENTS="[\"app=chaos-exporter\", \"name=chaos-operator\", \"app=event-tracker\",\"app=workflow-controller\"]" +export INFRA_COMPATIBLE_VERSIONS='["0.2.0", "0.1.0","ci"]' +export DEFAULT_HUB_BRANCH_NAME=master +``` + +Step-2: Run the go application + +```bash +cd chaoscenter/graphql/server +go run server.go +``` + +### 4. Run Frontend + +:::note +Make sure to run backend services before the frontend. +::: + +Step-1: Install all the dependencies + +```bash +cd litmus/chaoscenter/web +yarn +``` + +Step-2: Generate the ssl certificate + + + +The command you run is in the script/generate-certificate.sh file, but it doesn't work in a Windows environment, so please run the script below instead + +```bash +mkdir -p certificates + +openssl req -x509 -newkey rsa:4096 -keyout certificates/localhost-key.pem -out certificates/localhost.pem -days 365 -nodes -subj '//C=US' +``` + + + + +```bash +yarn generate-certificate +``` + + + + +Step-3: Run the frontend project + +```bash +yarn dev +``` + +> It’ll prompt you to start the development server at port `8185` or any other port than 3000 since it is already being used by the auth server. + +Once you are able to see the Login Screen of Litmus use the following default credentials + +``` +Username: admin +Password: litmus +``` + + + + +## **Steps to connect Chaos Infrastructure** +### Using Litmusctl +Use [litmusctl](https://github.com/litmuschaos/litmusctl) on the same box/local cluster and connect an ns infrastructure + +### Using Chaoscenter +Use Chaoscenter to connect an Infrastructure, download the manifest and apply it on k3d/minikube. Once the pods are up(except the subscriber), run the following command: + +```bash +cd subscriber + +INFRA_ID= ACCESS_KEY= INFRA_SCOPE=cluster SERVER_ADDR=http://localhost:8080/query INFRA_NAMESPACE=litmus IS_INFRA_CONFIRMED="false" COMPONENTS="DEPLOYMENTS: ["app=chaos-exporter", "name=chaos-operator", "app=workflow-controller"]" START_TIME=1631089756 VERSION="ci" AGENT_POD="subscriber-78f6bd4db5-ck5d9" SKIP_ +SSL_VERIFY="false" go run subscriber.go -kubeconfig ~/.kube/config +``` \ No newline at end of file diff --git a/website/versioned_sidebars/version-3.10.0-sidebars.json b/website/versioned_sidebars/version-3.10.0-sidebars.json index 939a4d4d..9c12b115 100644 --- a/website/versioned_sidebars/version-3.10.0-sidebars.json +++ b/website/versioned_sidebars/version-3.10.0-sidebars.json @@ -115,6 +115,11 @@ "user-guides/uninstall-litmus" ] }, + { + "Developer Guide": [ + "developer-guide/chaoscenter-developer-guide" + ] + }, { "Litmusctl": [ "litmusctl/installation",