aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

(AWS-EKS): (Support for helm upgrade)

Open mavais opened this issue 2 years ago • 4 comments

Describe the feature

support upgrade or install helm chart as an argument to eks.HelmChart

Use Case

We've a EKS cluster and use CDK to run helm charts and pass values by reading in a yaml and parsing it. However, in some use cases, where we make an update to the yaml values file, the changes do not take into effect when we update the stack. As a workaround, we currently delete the stack and recreate it with new values.

Proposed Solution

to have an argument to let either upgrade or install the helm charts https://helm.sh/docs/helm/helm_upgrade/

Other Information

No response

Acknowledgements

  • [ ] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

CDK version used

2.93

Environment details (OS name and version, etc.)

typescript

mavais avatar Nov 16 '23 14:11 mavais

I am not 100% clear about your use case. Are you able to share a minimal code to illustrate your use case? Generally when you define a HelmChart, under the hood the custom resource would always run helm upgrade for you.

pahud avatar Nov 16 '23 18:11 pahud

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

github-actions[bot] avatar Nov 18 '23 20:11 github-actions[bot]

@pahud we are deploying some charts using the following CDK

const openmetadataHelmChart = new eks.HelmChart( this, addStageSuffix('ABCOpenmetadataHelmChart', props.stage), { cluster: props.eksCluster, chart: 'openmetadata', repository: 'oci://' + props.ecrOpenMetadataRepo.repositoryUri, release: 'openmetadata', namespace: 'default', version: '1.1.14', values: openmetadataDefinition, timeout: Duration.minutes(15), }, );

The values openmetadataDefinition is a yaml which we parse before applying to it:

const openmetadataDefinition = yaml.parse( fs.readFileSync(path.join(__dirname, '../../../lib/resources/yaml/openmetadata.yaml'), 'utf8'), );

However, any change to yaml isn't reflected in the pods run. To make a change, we've to bring down the stack by deleting it. Recreating the stack as new one helps in picking up the new changes to the yaml file

if the resource is already running an helm upgrade, what probably can help us fix the above behavior. We don't want to everytime bring the stack down just for upgrading config values

mavais avatar Nov 20 '23 12:11 mavais

I guess the proposed solution is as straightforward as https://github.com/aws/aws-cdk/issues/22254, just need to add the --reuse-values flag for helm commands.

Wayne9981 avatar Jun 28 '24 09:06 Wayne9981