Skip to content

Commit

Permalink
Update templates.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
davidstauffer authored Dec 2, 2022
1 parent 6a37a5e commit 6db7e3d
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ spec:
name: "{{ .params.CLUSTER_NAME }}"
```


### Parameter metadata - `spec.params`

You can provide additional metadata about the parameters to the templates in the `spec.params` section.
Expand All @@ -263,7 +264,22 @@ spec:
required: true
default: DEFAULT_2
```

### 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`

### Loading the template into the cluster

Expand Down

0 comments on commit 6db7e3d

Please sign in to comment.