Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve helm chart clobbering and confusion between Zarf and Helm chart names #2174

Merged
merged 5 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions docs/3-create-a-zarf-package/2-zarf-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,11 @@ Charts using the `url` key can be:

- A remote URL (http/https) to a Git repository
- A remote URL (oci://) to an OCI registry
- A remote URL (http/https) to a Helm repository

#### Chart Examples

<Tabs queryString="chart-examples">
<TabItem value="localPath">
<ExampleYAML src={require('../../examples/helm-charts/zarf.yaml')} component="demo-helm-local-chart" />
</TabItem>
<TabItem value="URL (git)">
<ExampleYAML src={require('../../examples/helm-charts/zarf.yaml')} component="demo-helm-git-chart" />
</TabItem>
<TabItem value="URL (oci)">
<ExampleYAML src={require('../../examples/helm-charts/zarf.yaml')} component="demo-helm-oci-chart" />
</TabItem>
</Tabs>
<ExampleYAML src={require('../../examples/helm-charts/zarf.yaml')} component="demo-helm-charts" />

### Kubernetes Manifests

Expand Down
80 changes: 48 additions & 32 deletions docs/3-create-a-zarf-package/4-zarf-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ Must be one of:

![Required](https://img.shields.io/badge/Required-red)

**Description:** The name of the chart to deploy; this should be the name of the chart as it is installed in the helm repo
**Description:** The name of the chart within Zarf; note that this must be unique and does not need to be the same as the name in the chart repo

| | |
| -------- | -------- |
Expand All @@ -999,12 +999,12 @@ Must be one of:

<details>
<summary>
<strong> <a name="components_items_charts_items_releaseName"></a>releaseName</strong>
<strong> <a name="components_items_charts_items_version"></a>version</strong>
</summary>
&nbsp;
<blockquote>

**Description:** The name of the release to create; defaults to the name of the chart
**Description:** The version of the chart to deploy; for git-based charts this is also the tag of the git repo by default (when not using the '@' syntax for 'repos')

| | |
| -------- | -------- |
Expand All @@ -1029,19 +1029,19 @@ Must be one of:
**Examples:**

<code>
"OCI registry: oci://ghcr.io/stefanprodan/charts/podinfo", "helm chart repo: https://stefanprodan.github.io/podinfo", "git repo: https://github.com/stefanprodan/podinfo"</code>
"OCI registry: oci://ghcr.io/stefanprodan/charts/podinfo", "helm chart repo: https://stefanprodan.github.io/podinfo", "git repo: https://github.com/stefanprodan/podinfo (note the '@' syntax for 'repos' is supported here too)"</code>

</blockquote>
</details>

<details>
<summary>
<strong> <a name="components_items_charts_items_version"></a>version</strong>
<strong> <a name="components_items_charts_items_repoName"></a>repoName</strong>
</summary>
&nbsp;
<blockquote>

**Description:** The version of the chart to deploy; for git-based charts this is also the tag of the git repo
**Description:** The name of a chart within a Helm repository (defaults to the Zarf name of the chart)

| | |
| -------- | -------- |
Expand All @@ -1052,41 +1052,33 @@ Must be one of:

<details>
<summary>
<strong> <a name="components_items_charts_items_namespace"></a>namespace *</strong>
<strong> <a name="components_items_charts_items_gitPath"></a>gitPath</strong>
</summary>
&nbsp;
<blockquote>

![Required](https://img.shields.io/badge/Required-red)

**Description:** The namespace to deploy the chart to
**Description:** (git repo only) The sub directory to the chart within a git repo

| | |
| -------- | -------- |
| **Type** | `string` |

**Example:**

<code>
"charts/your-chart"</code>

</blockquote>
</details>

<details>
<summary>
<strong> <a name="components_items_charts_items_valuesFiles"></a>valuesFiles</strong>
<strong> <a name="components_items_charts_items_localPath"></a>localPath</strong>
</summary>
&nbsp;
<blockquote>

**Description:** List of local values file paths or remote URLs to include in the package; these will be merged together

| | |
| -------- | ----------------- |
| **Type** | `array of string` |

![Min Items: N/A](https://img.shields.io/badge/Min%20Items%3A%20N/A-gold)
![Max Items: N/A](https://img.shields.io/badge/Max%20Items%3A%20N/A-gold)
![Item unicity: False](https://img.shields.io/badge/Item%20unicity%3A%20False-gold)
![Additional items: N/A](https://img.shields.io/badge/Additional%20items%3A%20N/A-gold)

### <a name="autogenerated_heading_11"></a>valuesFiles items
**Description:** The path to a local chart's folder or .tgz archive

| | |
| -------- | -------- |
Expand All @@ -1097,33 +1089,30 @@ Must be one of:

<details>
<summary>
<strong> <a name="components_items_charts_items_gitPath"></a>gitPath</strong>
<strong> <a name="components_items_charts_items_namespace"></a>namespace *</strong>
</summary>
&nbsp;
<blockquote>

**Description:** The path to the chart in the repo if using a git repo instead of a helm repo
![Required](https://img.shields.io/badge/Required-red)

**Description:** The namespace to deploy the chart to

| | |
| -------- | -------- |
| **Type** | `string` |

**Example:**

<code>
"charts/your-chart"</code>

</blockquote>
</details>

<details>
<summary>
<strong> <a name="components_items_charts_items_localPath"></a>localPath</strong>
<strong> <a name="components_items_charts_items_releaseName"></a>releaseName</strong>
</summary>
&nbsp;
<blockquote>

**Description:** The path to the local chart's folder or .tgz archive
**Description:** The name of the Helm release to create (defaults to the Zarf name of the chart)

| | |
| -------- | -------- |
Expand All @@ -1148,6 +1137,33 @@ Must be one of:
</blockquote>
</details>

<details>
<summary>
<strong> <a name="components_items_charts_items_valuesFiles"></a>valuesFiles</strong>
</summary>
&nbsp;
<blockquote>

**Description:** List of local values file paths or remote URLs to include in the package; these will be merged together when deployed

| | |
| -------- | ----------------- |
| **Type** | `array of string` |

![Min Items: N/A](https://img.shields.io/badge/Min%20Items%3A%20N/A-gold)
![Max Items: N/A](https://img.shields.io/badge/Max%20Items%3A%20N/A-gold)
![Item unicity: False](https://img.shields.io/badge/Item%20unicity%3A%20False-gold)
![Additional items: N/A](https://img.shields.io/badge/Additional%20items%3A%20N/A-gold)

### <a name="autogenerated_heading_11"></a>valuesFiles items

| | |
| -------- | -------- |
| **Type** | `string` |

</blockquote>
</details>

</blockquote>
</details>

Expand Down
106 changes: 39 additions & 67 deletions examples/helm-charts/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,45 @@ metadata:
version: 0.0.1

components:
- name: demo-helm-local-chart
required: false
- name: demo-helm-charts
required: true
charts:
- name: podinfo
# Charts are organized in a list with unique chart names per component - note that a Zarf chart name does not need to match the chart name in a Chart.yaml
- name: podinfo-local
version: 6.4.0
namespace: podinfo-from-local-chart
# In this case `localPath` will load the podinfo chart that is located in the `chart` directory
localPath: chart
valuesFiles:
- values.yaml
images:
- ghcr.io/stefanprodan/podinfo:6.4.0
# This is the cosign signature for the podinfo image for image signature verification
- ghcr.io/stefanprodan/podinfo:sha256-57a654ace69ec02ba8973093b6a786faa15640575fbf0dbb603db55aca2ccec8.sig
actions:
onDeploy:
after:
- wait:
cluster:
kind: deployment
name: podinfo
namespace: podinfo-from-local-chart
condition: available

- name: podinfo-oci
version: 6.4.0
namespace: podinfo-from-oci
# In this case `url` will load the helm chart located in the podinfo OCI repository
url: oci://ghcr.io/stefanprodan/charts/podinfo
valuesFiles:
- values.yaml

- name: demo-helm-git-chart
required: false
charts:
- name: podinfo
- name: podinfo-git
version: 6.4.0
namespace: podinfo-from-git
# In this case `url` will load the helm chart located in the podinfo git repository
url: https://github.com/stefanprodan/podinfo.git
# By default git will look in the root of the git repository but you can define a sub directory with `gitPath`
gitPath: charts/podinfo
valuesFiles:
- values.yaml
images:
- ghcr.io/stefanprodan/podinfo:6.4.0
# This is the cosign signature for the podinfo image for image signature verification
- ghcr.io/stefanprodan/podinfo:sha256-57a654ace69ec02ba8973093b6a786faa15640575fbf0dbb603db55aca2ccec8.sig
actions:
onDeploy:
after:
- wait:
cluster:
kind: deployment
namespace: podinfo-from-git
name: podinfo
condition: available

- name: demo-helm-oci-chart
required: false
charts:
- name: podinfo
- name: podinfo-repo
version: 6.4.0
namespace: podinfo-from-oci
url: oci://ghcr.io/stefanprodan/charts/podinfo
namespace: podinfo-from-repo
# In this case `url` will load the helm chart located in the podinfo helm repository
url: https://stefanprodan.github.io/podinfo
# By default the chart `name` will be what is used to search a repository but since Zarf chart names must be unique per-component you can override this with `repoName`
repoName: podinfo
# By default the release name will be the chart name, but you can override this with the `releaseName` key
releaseName: cool-release-name
valuesFiles:
- values.yaml
images:
Expand All @@ -70,38 +55,25 @@ components:
after:
- wait:
cluster:
kind: pod
name: app.kubernetes.io/name=podinfo
namespace: podinfo-from-oci
condition: ready
kind: deployment
name: podinfo-local
namespace: podinfo-from-local-chart
condition: available
- wait:
cluster:
kind: deployment
# note this version is the same as the chart version
name: app.kubernetes.io/version=6.4.0
name: podinfo-oci
namespace: podinfo-from-oci
condition: available

- name: demo-helm-alt-release-name
required: false
charts:
- name: podinfo
version: 6.4.0
namespace: helm-alt-release-name
url: https://stefanprodan.github.io/podinfo
releaseName: cool-name
valuesFiles:
- values.yaml
images:
- ghcr.io/stefanprodan/podinfo:6.4.0
# This is the cosign signature for the podinfo image for image signature verification
- ghcr.io/stefanprodan/podinfo:sha256-57a654ace69ec02ba8973093b6a786faa15640575fbf0dbb603db55aca2ccec8.sig
actions:
onDeploy:
after:
- wait:
cluster:
kind: pod
name: app.kubernetes.io/name=cool-name-podinfo
namespace: helm-alt-release-name
condition: ready
kind: deployment
name: podinfo-git
namespace: podinfo-from-git
condition: available
- wait:
cluster:
kind: deployment
name: cool-release-name-podinfo
namespace: podinfo-from-repo
condition: available
Loading
Loading