Skip to content

Commit

Permalink
chore(website): add helm synthesis docs
Browse files Browse the repository at this point in the history
Signed-off-by: Vinayak Kukreja <[email protected]>
  • Loading branch information
vinayak-kukreja committed Sep 29, 2023
1 parent e41829f commit 1a92126
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docs/cli/synth.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,39 @@ You can also control the plugins storage directory by one of:

See [cdk8s-validation-plugin-example](https://github.com/cdk8s-team/cdk8s-validation-plugin-example)

## Synthesize cdk8s app as helm chart

You can synthesize your cdk8s application to a format that is compatible with [helm](https://helm.sh/).

!!! note
You will need helm to be [installed](https://helm.sh/docs/intro/install/) locally for this feature.

For example, you can run:

```
cdk8s synth --format helm --chart-version 1.0.0 --chart-api-version v2
```

Then it will synthesize a generated helm chart to the output folder(default is 'dist'). The manifest synthesized will be placed in `templates/` folder. If any crds were mentioned in `cdk8s.yaml` config file as `imports`, then they will be downloaded and placed in `crds` folder.

The folder structure will look like:

```
dist/
├── Chart.yaml
├── README.md
├── crds/
└── templates/
```

!!! note
CRDs are only supported with `--chart-api-version` as `v2`.

You can use the synthesized chart to deploy using helm:

```
cdk8s synth --format helm --chart-version 1.0.0 --chart-api-version v2 && helm install <release-name> ./dist
```

!!! note
Templates within the generated Helm chart are pure and static Kubernetes manifests; they don't contain any helm template directives. This means they cannot be customized with a values.yaml file or the release name. One important implication of this is that you cannot deploy two releases of the chart, as resource names will collide. If you need customization, you can do this within the cdk8s application (for example by explicitly reading a values.yaml file).

0 comments on commit 1a92126

Please sign in to comment.