Skip to content

Commit

Permalink
docs(helm): add examples for using OCI charts
Browse files Browse the repository at this point in the history
  • Loading branch information
stefreak committed Mar 28, 2024
1 parent a7104e6 commit a423e2d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
9 changes: 5 additions & 4 deletions core/src/plugins/kubernetes/helm/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const helmChartSpecSchema = () =>
"The path, relative to the action path, to the chart sources (i.e. where the Chart.yaml file is, if any)."
),
repo: helmChartRepoSchema(),
url: joi.string().uri().description("An absolute URL to a packaged URL."),
url: joi.string().uri().description("URL to OCI repository, or a URL to a packaged Helm chart archive."),
version: helmChartVersionSchema(),
})
.without("path", ["name", "repo", "version", "url"])
Expand All @@ -156,9 +156,10 @@ const helmChartSpecSchema = () =>
If the chart is defined in the same directory as the action, you can skip this, and the chart sources will be detected. If the chart is in the source tree but in a sub-directory, you should set \`chart.path\` to the directory path, relative to the action directory.
If the chart is remote, you can specify \`chart.name\` and \`chart.version\, and optionally \`chart.repo\` (if the chart is not in the default "stable" repo).
You may also specify an absolute URL to a packaged chart via \`chart.url\`.
For remote charts, there are multiple options:
- **[Helm Chart repository](https://helm.sh/docs/topics/chart_repository/)**: specify \`chart.name\` and \`chart.version\, and optionally \`chart.repo\` (if the chart is not in the default "stable" repo).
- **[OCI-Based Registry](https://helm.sh/docs/topics/registries/)**: specify \`chart.url\` with the \`oci://\` URL and optionally \`chart.version\`.
- **Absolute URL to a packaged chart**: specify \`chart.url\`.
One of \`chart.name\`, \`chart.path\` or \`chart.url\` must be specified.
`
Expand Down
31 changes: 25 additions & 6 deletions docs/k8s-plugins/actions/deploy/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,31 @@ _[kubernetes guide](./kubernetes.md) for more info._
## Referencing external charts

Using external charts, where the chart sources are not located in your own project, can be quite straightforward. At a
minimum, you just need to point to the chart, and perhaps provide some values as inputs. For example here is the `redis` deploy from
our example project:
minimum, you just need to point to the chart, and perhaps provide some values as inputs. There are two options to deploy external Charts, [Helm chart repositories](https://helm.sh/docs/topics/chart_repository/) (Accessible via `https`) or [OCI-based registries](https://helm.sh/docs/topics/registries/).

Adding `deploy.redis` as a dependency of one of your other actions ensures that redis is up and running before the other actions are executed.

### Example: Redis from Bitnami OCI Repository

A specific chart repository can be referenced via the `repo` field. This may be useful if you run your own Helm Chart Repository for your organization, or are referencing an action that isn't contained in the default Helm Repository.

```yaml
kind: Deploy
type: helm
name: redis
spec:
chart:
# Chart name is part of the OCI URL
url: oci://registry-1.docker.io/bitnamicharts/redis
version: "19.0.1"
values:
auth:
enabled: false
```

### Example: Redis from Bitnami Helm Repository

A specific chart repository can be referenced via the `repo` field. This may be useful if you run your own Helm Chart Repository for your organization, or are referencing an action that isn't contained in the default Helm Repository.

```yaml
kind: Deploy
Expand All @@ -37,10 +60,6 @@ spec:
enabled: false
```

This may be all you need for a chart to be deployed with the rest of your stack. You can also list `deploy.redis` as a dependency of one of your other actions. That will ensure redis being up and running before the other actions are executed.

A specific chart repository can be referenced via the `repo` field. This may be useful if you run your own chart repository for your organization, or are referencing an action that isn't contained in the default Helm repo.

## Local charts

Instead of fetching the chart sources from another repository, you'll often want to include your chart sources in your Garden project. To do this, you can simply add a `garden.yml` in your chart directory (next to your `Chart.yaml`) and start by giving it a name:
Expand Down

0 comments on commit a423e2d

Please sign in to comment.