From 1419d6c4a784631bc8879027a0344e31911bf919 Mon Sep 17 00:00:00 2001 From: Devank Gupta Date: Tue, 28 Oct 2025 01:51:23 +0530 Subject: [PATCH] feat(chaoscenter): add Helm installation option in Deploy step (#4897) Signed-off-by: Devank Gupta --- ...sInfrastructureStepWizardConfiguration.tsx | 184 ++++++++++-------- 1 file changed, 108 insertions(+), 76 deletions(-) diff --git a/chaoscenter/web/src/views/KubernetesChaosInfrastructureCreationModal/KubernetesChaosInfrastructureStepWizardConfiguration.tsx b/chaoscenter/web/src/views/KubernetesChaosInfrastructureCreationModal/KubernetesChaosInfrastructureStepWizardConfiguration.tsx index 21b69ea775a..6b835d1e8d8 100644 --- a/chaoscenter/web/src/views/KubernetesChaosInfrastructureCreationModal/KubernetesChaosInfrastructureStepWizardConfiguration.tsx +++ b/chaoscenter/web/src/views/KubernetesChaosInfrastructureCreationModal/KubernetesChaosInfrastructureStepWizardConfiguration.tsx @@ -1,4 +1,5 @@ -import { Dialog } from '@blueprintjs/core'; +import React, { useState } from 'react'; +import { Dialog, RadioGroup, Radio } from '@blueprintjs/core'; import { Color, FontVariation } from '@harnessio/design-system'; import { Button, @@ -15,7 +16,6 @@ import { import { Icon } from '@harnessio/icons'; import { FieldArray, Formik, Form, FormikProps } from 'formik'; import { get } from 'lodash-es'; -import React from 'react'; import * as Yup from 'yup'; import type { ApolloQueryResult } from '@apollo/client'; import { useStrings } from '@strings'; @@ -324,9 +324,28 @@ export function DeploySetupStep({ }: StepProps & DeploySetupStepProps): React.ReactElement { const { getString } = useStrings(); const [infraRegistered, setInfraRegistered] = React.useState(false); + const [installMethod, setInstallMethod] = useState<'manifest' | 'helm'>('manifest'); const data = prevStepData; + + // Dummy values — these should come dynamically from backend (PR #4903) + const infraID = 'INFRA-XYZ123'; + const accessKey = 'ABCD1234'; + const serverURL = window.location.origin; + + // Sample helm command + const helmCommand = ` +helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/ +helm repo update +helm install litmus-${infraID.toLowerCase()} litmuschaos/litmus \ + --namespace ${data?.value.chaosInfrastructureNamespace || 'litmus'} \ + --set accessKey=${accessKey} \ + --set infraID=${infraID} \ + --set server=${serverURL} +`.trim(); + return ( + {/* Title bar */} {getString('deployChaosInfrastructure')} @@ -341,81 +360,94 @@ export function DeploySetupStep({ }} /> - <> -
- - {getString('kubernetesSetupInstructions')} - -
- {data?.value.infraScope === DeploymentScopeOptions.NAMESPACE && ( - <> - - {getString('createNamespace')} - - + {/* ---- New Section: Choose installation method ---- */} + + Select Installation Method + + + setInstallMethod((e.target as HTMLInputElement).value as 'manifest' | 'helm')} + > + + + + +
+ + {/* ---- Show commands based on selection ---- */} + {installMethod === 'manifest' ? ( + <> + + {getString('kubernetesSetupInstructions')} + + + {data?.value.infraScope === DeploymentScopeOptions.NAMESPACE && ( + <> + + {getString('createNamespace')} + + + + {getString('copyPrompt1')} + + + + )} + + + {getString('infrastructureCommand')} + + + {data && ( + - - {getString('copyPrompt1')} - - - - )} - - {data?.value.infraScope === DeploymentScopeOptions.NAMESPACE - ? getString('copyPrompt2') - : getString('copyPrompt')} - - - {getString('infrastructureCommand')} - - {data && ( - - )} - - {getString('statusCheck')} - -
- - -