Skip to content

Commit

Permalink
Adds some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
foot committed Dec 2, 2022
1 parent 6cb9786 commit 9d5fbaf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions website/docs/gitops-templates/templates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,23 @@ spec:
You can provide additional metadata about the parameters to the templates in the `spec.params` section.

### Required Parameters

Currently templates use the `CLUSTER_NAME` to determine the path in gitrepo and `RESOURCE_NAME` for the file name when we create the PR and write to your git repository.

You must provide either:
- `CLUSTER_NAME`
- `RESOURCE_NAME`

**Default path for templates**

The default path for a template has a few components:
- From the params: `CLUSTER_NAME` or `RESOURCE_NAME`, **required**.
- From the params: `NAMESPACE`, default: `default`
- From values.yaml: `values.config.capi.repositoryPath`, default: `./clusters/management/clusters`

These are composed to create the path:
`${repositoryPath}/${NAMESPACE}/${CLUSTER_OR_RESOURCE_NAME}.yaml`

Using the default values and supplying `CLUSTER_NAME` as `my-cluster` will result in the path:
`./clusters/management/clusters/default/my-cluster.yaml`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,24 +240,29 @@ spec:
name: "{{ .params.CLUSTER_NAME }}"
```


## Parameters

You can provide additional metadata about the parameters to the templates in the `spec.params` section.

### Required Parameters

Currently templates use the `CLUSTER_NAME` to determine the path in gitrepo and `RESOURCE_NAME` for the file name when we create the PR and write to your git repository.

You must provide either:
- `CLUSTER_NAME`
- `RESOURCE_NAME`

**Default path for templates**

The default path for a template has a few components:
- From the params: `CLUSTER_NAME` or `RESOURCE_NAME`, **required**.
- From the params: `NAMESPACE`, default: `default`
- From values.yaml: `values.config.capi.repositoryPath`, default: `./clusters/management/clusters`

These are composed to create the path:
`${repositoryPath}/${NAMESPACE}/${CLUSTER_OR_RESOURCE_NAME}.yaml`

Using the default values and supplying `CLUSTER_NAME` as `my-cluster` will result in the path:
`./clusters/management/clusters/default/my-cluster.yaml`

Expand All @@ -282,6 +287,8 @@ spec:
required: true
default: DEFAULT_2
```


### Loading the template into the cluster

Load templates into the cluster by adding them to your flux managed git repository or by using apply directly with
Expand Down

0 comments on commit 9d5fbaf

Please sign in to comment.