Skip to content

Commit

Permalink
Added changes required in helm charts for Litmus 3.0.0 (#335)
Browse files Browse the repository at this point in the history
* Added changes in helm manifests for litmus 3.0.0

Signed-off-by: Saranya-jena <[email protected]>

* Added some changes

Signed-off-by: Jonsy13 <[email protected]>

* Added changes requires for mongo support

Signed-off-by: Saranya-jena <[email protected]>

* Added some changes

Signed-off-by: Jonsy13 <[email protected]>

* updated mongo image tags

Signed-off-by: Saranya-jena <[email protected]>

* updated image tags for 3.0.0

Signed-off-by: Saranya-jena <[email protected]>

* updated the mongo images

Signed-off-by: Saranya-jena <[email protected]>

* updated images

Signed-off-by: Saranya-jena <[email protected]>

* Added final changes

Signed-off-by: Jonsy13 <[email protected]>

* Updated readme

Signed-off-by: Saranya-jena <[email protected]>

---------

Signed-off-by: Saranya-jena <[email protected]>
Signed-off-by: Jonsy13 <[email protected]>
Co-authored-by: Jonsy13 <[email protected]>
  • Loading branch information
Saranya-jena and Jonsy13 authored Oct 5, 2023
1 parent d4e2f34 commit deef923
Show file tree
Hide file tree
Showing 10 changed files with 242 additions and 138 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,15 @@ You can run the following commands if you wish to verify if all desired componen
```bash
root@demo:~# kubectl get pods -n litmus
NAME READY STATUS RESTARTS AGE
chaos-litmus-frontend-775585bf8f-jblf2 1/1 Running 0 79s
chaos-litmus-mongo-0 1/1 Running 0 79s
chaos-litmus-server-96b5f656-zqjt4 2/2 Running 0 79s
NAME READY STATUS RESTARTS AGE
litmusportal-server-6fd57cc89-6w5pn 1/1 Running 0 57s
litmusportal-auth-server-7b596fff9-5s6g5 1/1 Running 0 57s
litmusportal-frontend-55974fcf59-cxxrf 1/1 Running 0 58s
my-release-mongodb-0 1/1 Running 0 63s
my-release-mongodb-1 1/1 Running 0 63s
my-release-mongodb-2 1/1 Running 0 62s
my-release-mongodb-arbiter-0 1/1 Running 0 64s
```
### Install External Agent
Expand Down
4 changes: 2 additions & 2 deletions charts/litmus/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
appVersion: "2.14.0"
appVersion: "3.0.0"
description: A Helm chart to install ChaosCenter
name: litmus
version: 2.15.11
version: 3.0.0
kubeVersion: ">=1.16.0-0"
home: https://litmuschaos.io
sources:
Expand Down
45 changes: 20 additions & 25 deletions charts/litmus/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# litmus

![Version: 2.15.11](https://img.shields.io/badge/Version-2.15.11-informational?style=flat-square) ![AppVersion: 2.14.0](https://img.shields.io/badge/AppVersion-2.14.0-informational?style=flat-square)
![Version: 3.0.0](https://img.shields.io/badge/Version-3.0.0-informational?style=flat-square) ![AppVersion: 3.0.0](https://img.shields.io/badge/AppVersion-3.0.0-informational?style=flat-square)

A Helm chart to install ChaosCenter

Expand Down Expand Up @@ -57,7 +57,7 @@ We separated service configuration from `portal.server.service` to `portal.serve
| adminConfig.DB_SERVER | string | `""` | |
| adminConfig.JWTSecret | string | `"litmus-portal@123"` | |
| adminConfig.SKIP_SSL_VERIFY | string | `"false"` | |
| adminConfig.VERSION | string | `"2.14.0"` | |
| adminConfig.VERSION | string | `"3.0.0"` | |
| customLabels | object | `{}` | Additional labels |
| existingSecret | string | `""` | Use existing secret (e.g., External Secrets) |
| image.imagePullSecrets | list | `[]` | |
Expand All @@ -72,7 +72,7 @@ We separated service configuration from `portal.server.service` to `portal.serve
| ingress.ingressClassName | string | `""` | |
| ingress.name | string | `"litmus-ingress"` | |
| ingress.tls | list | `[]` | |
| mongodb | object | `{"architecture":"standalone","auth":{"enabled":true,"existingSecret":"","rootPassword":"superhardpassword"},"enabled":true,"metrics":{"enabled":false,"prometheusRule":{"enabled":false}},"replicaCount":1,"useStatefulSet":false}` | Configure the Bitnami MongoDB subchart see values at https://github.com/bitnami/charts/blob/master/bitnami/mongodb/values.yaml |
| mongodb | object | `{"architecture":"replicaset","auth":{"enabled":true,"existingSecret":"","rootPassword":"1234","rootUser":"root"},"enabled":true,"metrics":{"enabled":false,"prometheusRule":{"enabled":false}},"persistence":{"enabled":true},"replicaCount":3,"volumePermissions":{"enabled":true}}` | Configure the Bitnami MongoDB subchart see values at https://github.com/bitnami/charts/blob/master/bitnami/mongodb/values.yaml |
| mongodb.auth.existingSecret | string | `""` | existingSecret Existing secret with MongoDB(&reg;) credentials (keys: `mongodb-passwords`, `mongodb-root-password`, `mongodb-metrics-password`, ` mongodb-replica-set-key`) |
| nameOverride | string | `""` | |
| openshift.route.annotations | object | `{}` | |
Expand All @@ -86,11 +86,11 @@ We separated service configuration from `portal.server.service` to `portal.serve
| portal.frontend.autoscaling.minReplicas | int | `2` | |
| portal.frontend.autoscaling.targetCPUUtilizationPercentage | int | `50` | |
| portal.frontend.autoscaling.targetMemoryUtilizationPercentage | int | `50` | |
| portal.frontend.containerPort | int | `8080` | |
| portal.frontend.containerPort | int | `8185` | |
| portal.frontend.customLabels | object | `{}` | |
| portal.frontend.image.pullPolicy | string | `"Always"` | |
| portal.frontend.image.repository | string | `"litmusportal-frontend"` | |
| portal.frontend.image.tag | string | `"2.14.0"` | |
| portal.frontend.image.tag | string | `"3.0.0"` | |
| portal.frontend.livenessProbe.failureThreshold | int | `5` | |
| portal.frontend.livenessProbe.initialDelaySeconds | int | `30` | |
| portal.frontend.livenessProbe.periodSeconds | int | `10` | |
Expand All @@ -108,12 +108,9 @@ We separated service configuration from `portal.server.service` to `portal.serve
| portal.frontend.resources.requests.cpu | string | `"125m"` | |
| portal.frontend.resources.requests.ephemeral-storage | string | `"500Mi"` | |
| portal.frontend.resources.requests.memory | string | `"150Mi"` | |
| portal.frontend.securityContext.allowPrivilegeEscalation | bool | `false` | |
| portal.frontend.securityContext.runAsNonRoot | bool | `true` | |
| portal.frontend.securityContext.runAsUser | int | `2000` | |
| portal.frontend.service.annotations | object | `{}` | |
| portal.frontend.service.port | int | `9091` | |
| portal.frontend.service.targetPort | int | `8080` | |
| portal.frontend.service.targetPort | int | `8185` | |
| portal.frontend.service.type | string | `"ClusterIP"` | |
| portal.frontend.tolerations | list | `[]` | |
| portal.frontend.updateStrategy | object | `{}` | |
Expand All @@ -131,7 +128,7 @@ We separated service configuration from `portal.server.service` to `portal.serve
| portal.server.authServer.env.LITMUS_GQL_GRPC_PORT | string | `":8000"` | |
| portal.server.authServer.image.pullPolicy | string | `"Always"` | |
| portal.server.authServer.image.repository | string | `"litmusportal-auth-server"` | |
| portal.server.authServer.image.tag | string | `"2.14.0"` | |
| portal.server.authServer.image.tag | string | `"3.0.0"` | |
| portal.server.authServer.ports[0].containerPort | int | `3030` | |
| portal.server.authServer.ports[0].name | string | `"auth-server"` | |
| portal.server.authServer.ports[1].containerPort | int | `3000` | |
Expand All @@ -156,28 +153,26 @@ We separated service configuration from `portal.server.service` to `portal.serve
| portal.server.authServer.volumeMounts | list | `[]` | |
| portal.server.authServer.volumes | list | `[]` | |
| portal.server.customLabels | object | `{}` | |
| portal.server.graphqlServer.genericEnv.AGENT_DEPLOYMENTS | string | `"[\"app=chaos-exporter\", \"name=chaos-operator\", \"app=event-tracker\", \"app=workflow-controller\"]"` | |
| portal.server.graphqlServer.genericEnv.CHAOS_CENTER_UI_ENDPOINT | string | `""` | |
| portal.server.graphqlServer.genericEnv.CONTAINER_RUNTIME_EXECUTOR | string | `"k8sapi"` | |
| portal.server.graphqlServer.genericEnv.HUB_BRANCH_NAME | string | `"v2.14.x"` | |
| portal.server.graphqlServer.genericEnv.DEFAULT_HUB_BRANCH_NAME | string | `"v3.0.x"` | |
| portal.server.graphqlServer.genericEnv.INFRA_COMPATIBLE_VERSIONS | string | `"[\"3.0.0\"]"` | |
| portal.server.graphqlServer.genericEnv.INFRA_DEPLOYMENTS | string | `"[\"app=chaos-exporter\", \"name=chaos-operator\", \"app=event-tracker\", \"app=workflow-controller\"]"` | |
| portal.server.graphqlServer.genericEnv.LITMUS_AUTH_GRPC_PORT | string | `":3030"` | |
| portal.server.graphqlServer.genericEnv.REMOTE_HUB_MAX_SIZE | string | `"5000000"` | |
| portal.server.graphqlServer.genericEnv.SELF_AGENT | string | `"true"` | |
| portal.server.graphqlServer.genericEnv.SELF_AGENT_NODE_SELECTOR | string | `""` | |
| portal.server.graphqlServer.genericEnv.SELF_AGENT_TOLERATIONS | string | `""` | |
| portal.server.graphqlServer.genericEnv.TLS_CERT_64 | string | `""` | |
| portal.server.graphqlServer.genericEnv.TLS_SECRET_NAME | string | `""` | |
| portal.server.graphqlServer.genericEnv.WORKFLOW_HELPER_IMAGE_VERSION | string | `"2.14.0"` | |
| portal.server.graphqlServer.genericEnv.WORKFLOW_HELPER_IMAGE_VERSION | string | `"3.0.0"` | |
| portal.server.graphqlServer.image.pullPolicy | string | `"Always"` | |
| portal.server.graphqlServer.image.repository | string | `"litmusportal-server"` | |
| portal.server.graphqlServer.image.tag | string | `"2.14.0"` | |
| portal.server.graphqlServer.image.tag | string | `"3.0.0"` | |
| portal.server.graphqlServer.imageEnv.ARGO_WORKFLOW_CONTROLLER_IMAGE | string | `"workflow-controller:v3.3.1"` | |
| portal.server.graphqlServer.imageEnv.ARGO_WORKFLOW_EXECUTOR_IMAGE | string | `"argoexec:v3.3.1"` | |
| portal.server.graphqlServer.imageEnv.EVENT_TRACKER_IMAGE | string | `"litmusportal-event-tracker:2.14.0"` | |
| portal.server.graphqlServer.imageEnv.LITMUS_CHAOS_EXPORTER_IMAGE | string | `"chaos-exporter:2.14.0"` | |
| portal.server.graphqlServer.imageEnv.LITMUS_CHAOS_OPERATOR_IMAGE | string | `"chaos-operator:2.14.0"` | |
| portal.server.graphqlServer.imageEnv.LITMUS_CHAOS_RUNNER_IMAGE | string | `"chaos-runner:2.14.0"` | |
| portal.server.graphqlServer.imageEnv.SUBSCRIBER_IMAGE | string | `"litmusportal-subscriber:2.14.0"` | |
| portal.server.graphqlServer.imageEnv.EVENT_TRACKER_IMAGE | string | `"litmusportal-event-tracker:3.0.0"` | |
| portal.server.graphqlServer.imageEnv.LITMUS_CHAOS_EXPORTER_IMAGE | string | `"chaos-exporter:3.0.0"` | |
| portal.server.graphqlServer.imageEnv.LITMUS_CHAOS_OPERATOR_IMAGE | string | `"chaos-operator:3.0.0"` | |
| portal.server.graphqlServer.imageEnv.LITMUS_CHAOS_RUNNER_IMAGE | string | `"chaos-runner:3.0.0"` | |
| portal.server.graphqlServer.imageEnv.SUBSCRIBER_IMAGE | string | `"litmusportal-subscriber:3.0.0"` | |
| portal.server.graphqlServer.livenessProbe.failureThreshold | int | `5` | |
| portal.server.graphqlServer.livenessProbe.initialDelaySeconds | int | `30` | |
| portal.server.graphqlServer.livenessProbe.periodSeconds | int | `10` | |
Expand Down Expand Up @@ -221,8 +216,8 @@ We separated service configuration from `portal.server.service` to `portal.serve
| portal.server.tolerations | list | `[]` | |
| portal.server.updateStrategy | object | `{}` | |
| portal.server.waitForMongodb.image.pullPolicy | string | `"Always"` | |
| portal.server.waitForMongodb.image.repository | string | `"curl"` | |
| portal.server.waitForMongodb.image.tag | string | `"2.14.0"` | |
| portal.server.waitForMongodb.image.repository | string | `"mongo"` | |
| portal.server.waitForMongodb.image.tag | int | `6` | |
| portal.server.waitForMongodb.resources.limits.cpu | string | `"250m"` | |
| portal.server.waitForMongodb.resources.limits.ephemeral-storage | string | `"1Gi"` | |
| portal.server.waitForMongodb.resources.limits.memory | string | `"512Mi"` | |
Expand All @@ -234,7 +229,7 @@ We separated service configuration from `portal.server.service` to `portal.serve
| upgradeAgent.affinity | object | `{}` | |
| upgradeAgent.controlPlane.image.pullPolicy | string | `"Always"` | |
| upgradeAgent.controlPlane.image.repository | string | `"upgrade-agent-cp"` | |
| upgradeAgent.controlPlane.image.tag | string | `"2.14.0"` | |
| upgradeAgent.controlPlane.image.tag | string | `"3.0.0"` | |
| upgradeAgent.controlPlane.restartPolicy | string | `"OnFailure"` | |
| upgradeAgent.nodeSelector | object | `{}` | |
| upgradeAgent.resources | object | `{}` | |
Expand Down
18 changes: 12 additions & 6 deletions charts/litmus/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,16 @@ Check for existing secret
{{- end -}}
{{- end -}}

{{- define "litmus-portal.mongodbServiceName" -}}
{{- if not (eq .Values.mongodb.architecture "replicaset") }}
{{- include "mongodb.fullname" .Subcharts.mongodb -}}
{{ else }}
{{- include "mongodb.service.nameOverride" .Subcharts.mongodb -}}
{{- end -}}
{{/*
Returns mongodb connection string
*/}}
{{- define "litmus-portal.mongodbConnectionString" -}}
{{- $hosts := "" -}}
{{- $count := (.Values.mongodb.replicaCount | int) -}}
{{- range $i, $e := until $count -}}
{{- $host := printf "%s-mongodb-%d.%s-mongodb-headless" $.Release.Name $i $.Release.Name -}}
{{- $hosts = printf "%s%s:%d," $hosts $host 27017 -}}
{{- end -}}
mongodb://{{ trimSuffix "," $hosts }}/admin
{{- end -}}

37 changes: 34 additions & 3 deletions charts/litmus/templates/auth-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,41 @@ spec:
- name: wait-for-mongodb
image: {{ .Values.image.imageRegistryName }}/{{ .Values.portal.server.waitForMongodb.image.repository }}:{{ .Values.portal.server.waitForMongodb.image.tag }}
imagePullPolicy: {{ .Values.portal.server.waitForMongodb.image.pullPolicy }}
command: ["/bin/sh", "-c"]
command: ["/bin/bash", "-c"]
env:
- name: DB_PASSWORD
{{- if .Values.mongodb.enabled }}
{{- if not .Values.mongodb.auth.existingSecret }}
value: {{ .Values.mongodb.auth.rootPassword | quote }}
{{- else }}
valueFrom:
secretKeyRef:
name: {{ .Values.mongodb.auth.existingSecret }}
key: mongodb-root-password
{{- end }}
{{- else }}
valueFrom:
secretKeyRef:
name: {{ include "litmus-portal.secretname" . }}
key: DB_PASSWORD
{{- end }}
- name: DB_USER
{{- if .Values.mongodb.enabled }}
value: {{ .Values.mongodb.auth.rootUser }}
{{- else }}
valueFrom:
secretKeyRef:
name: {{ include "litmus-portal.secretname" . }}
key: DB_USER
{{- end }}
- name: DB_SERVER
valueFrom:
configMapKeyRef:
name: {{ include "litmus-portal.fullname" . }}-admin-config
key: DB_SERVER
args:
[
"while [[ $(curl -sw '%{http_code}' http://{{ include "litmus-portal.mongodbServiceName" . }}:{{ .Values.mongodb.service.ports.mongodb }} -o /dev/null) -ne 200 ]]; do sleep 5; echo 'Waiting for the MongoDB to be ready...'; done; echo 'Connection with MongoDB established'",
"until [[ $(mongosh -u ${DB_USER} -p ${DB_PASSWORD} ${DB_SERVER} --eval 'rs.status()' | grep 'ok' | wc -l) -eq 1 ]]; do sleep 5; echo 'Waiting for the MongoDB to be ready...'; done; echo 'Connection with MongoDB established'",
]
resources:
{{- toYaml .Values.portal.server.waitForMongodb.resources | nindent 12 }}
Expand All @@ -67,7 +98,7 @@ spec:
- name: DB_PASSWORD
{{- if .Values.mongodb.enabled }}
{{- if not .Values.mongodb.auth.existingSecret }}
value: {{ .Values.mongodb.auth.rootPassword }}
value: {{ .Values.mongodb.auth.rootPassword | quote }}
{{- else }}
valueFrom:
secretKeyRef:
Expand Down
Loading

0 comments on commit deef923

Please sign in to comment.