refactor: remove duplicate template common.name
This commit is contained in:
30
README.md
30
README.md
@ -24,6 +24,7 @@ It provides utilities that reflect best practices of Kubernetes chart developmen
|
|||||||
* [`common.container`](#commoncontainer)
|
* [`common.container`](#commoncontainer)
|
||||||
* [`common.labels`](#commonlabels)
|
* [`common.labels`](#commonlabels)
|
||||||
* [`common.metadata`](#commonmetadata)
|
* [`common.metadata`](#commonmetadata)
|
||||||
|
* [`common.name`](#commonname)
|
||||||
* [`common.pod.template`](#commonpodtemplate)
|
* [`common.pod.template`](#commonpodtemplate)
|
||||||
* [`common.selectorLabels`](#commonselectorlabels)
|
* [`common.selectorLabels`](#commonselectorlabels)
|
||||||
|
|
||||||
@ -928,6 +929,35 @@ Most of the common templates that define a resource type (e.g. `common.configMap
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### `common.name`
|
||||||
|
|
||||||
|
The `common.name` template generates a name suitable for the `app.kubernetes.io/name` label. It is used like this:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
app.kubernetes.io/name: {{ include "common.name" . }}
|
||||||
|
```
|
||||||
|
|
||||||
|
This prints the value of `{{ .Chart.Name }}` by default, but can be overridden with `.Values.nameOverride`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
nameOverride: some-name
|
||||||
|
```
|
||||||
|
|
||||||
|
Example output:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
# with the values above
|
||||||
|
app.kubernetes.io/name: some-name
|
||||||
|
|
||||||
|
---
|
||||||
|
# the default, for chart "mychart"
|
||||||
|
app.kubernetes.io/name: mychart
|
||||||
|
```
|
||||||
|
|
||||||
|
Output of this function is truncated at 63 characters, which is the maximum length of name.
|
||||||
|
|
||||||
|
|
||||||
### `common.pod.template`
|
### `common.pod.template`
|
||||||
|
|
||||||
The `common.pod.template` template accepts a list of three values:
|
The `common.pod.template` template accepts a list of three values:
|
||||||
|
Reference in New Issue
Block a user