github.com/flant/helm@v2.8.1+incompatible/docs/charts.md (about)

     1  # Charts
     2  
     3  Helm uses a packaging format called _charts_. A chart is a collection of files
     4  that describe a related set of Kubernetes resources. A single chart
     5  might be used to deploy something simple, like a memcached pod, or
     6  something complex, like a full web app stack with HTTP servers,
     7  databases, caches, and so on.
     8  
     9  Charts are created as files laid out in a particular directory tree,
    10  then they can be packaged into versioned archives to be deployed.
    11  
    12  This document explains the chart format, and provides basic guidance for
    13  building charts with Helm.
    14  
    15  ## The Chart File Structure
    16  
    17  A chart is organized as a collection of files inside of a directory. The
    18  directory name is the name of the chart (without versioning information). Thus,
    19  a chart describing WordPress would be stored in the `wordpress/` directory.
    20  
    21  Inside of this directory, Helm will expect a structure that matches this:
    22  
    23  ```
    24  wordpress/
    25    Chart.yaml          # A YAML file containing information about the chart
    26    LICENSE             # OPTIONAL: A plain text file containing the license for the chart
    27    README.md           # OPTIONAL: A human-readable README file
    28    requirements.yaml   # OPTIONAL: A YAML file listing dependencies for the chart
    29    values.yaml         # The default configuration values for this chart
    30    charts/             # OPTIONAL: A directory containing any charts upon which this chart depends.
    31    templates/          # OPTIONAL: A directory of templates that, when combined with values,
    32                        # will generate valid Kubernetes manifest files.
    33    templates/NOTES.txt # OPTIONAL: A plain text file containing short usage notes
    34  ```
    35  
    36  Helm reserves use of the `charts/` and `templates/` directories, and of
    37  the listed file names. Other files will be left as they are.
    38  
    39  While the `charts` and `template` directories are optional there must be at least one chart dependency or template file for the chart to be valid.
    40  
    41  ## The Chart.yaml File
    42  
    43  The `Chart.yaml` file is required for a chart. It contains the following fields:
    44  
    45  ```yaml
    46  name: The name of the chart (required)
    47  version: A SemVer 2 version (required)
    48  description: A single-sentence description of this project (optional)
    49  keywords:
    50    - A list of keywords about this project (optional)
    51  home: The URL of this project's home page (optional)
    52  sources:
    53    - A list of URLs to source code for this project (optional)
    54  maintainers: # (optional)
    55    - name: The maintainer's name (required for each maintainer)
    56      email: The maintainer's email (optional for each maintainer)
    57      url: A URL for the maintainer (optional for each maintainer)
    58  engine: gotpl # The name of the template engine (optional, defaults to gotpl)
    59  icon: A URL to an SVG or PNG image to be used as an icon (optional).
    60  appVersion: The version of the app that this contains (optional). This needn't be SemVer.
    61  deprecated: Whether or not this chart is deprecated (optional, boolean)
    62  tillerVersion: The version of Tiller that this chart requires. This should be expressed as a SemVer range: ">2.0.0" (optional)
    63  ```
    64  
    65  If you are familiar with the `Chart.yaml` file format for Helm Classic, you will
    66  notice that fields specifying dependencies have been removed. That is because
    67  the new Chart format expresses dependencies using the `charts/` directory.
    68  
    69  Other fields will be silently ignored.
    70  
    71  ### Charts and Versioning
    72  
    73  Every chart must have a version number. A version must follow the
    74  [SemVer 2](http://semver.org/) standard. Unlike Helm Classic, Kubernetes
    75  Helm uses version numbers as release markers. Packages in repositories
    76  are identified by name plus version.
    77  
    78  For example, an `nginx` chart whose version field is set to `version:
    79  1.2.3` will be named:
    80  
    81  ```
    82  nginx-1.2.3.tgz
    83  ```
    84  
    85  More complex SemVer 2 names are also supported, such as
    86  `version: 1.2.3-alpha.1+ef365`. But non-SemVer names are explicitly
    87  disallowed by the system.
    88  
    89  **NOTE:** Whereas Helm Classic and Deployment Manager were both
    90  very GitHub oriented when it came to charts, Kubernetes Helm does not
    91  rely upon or require GitHub or even Git. Consequently, it does not use
    92  Git SHAs for versioning at all.
    93  
    94  The `version` field inside of the `Chart.yaml` is used by many of the
    95  Helm tools, including the CLI and the Tiller server. When generating a
    96  package, the `helm package` command will use the version that it finds
    97  in the `Chart.yaml` as a token in the package name. The system assumes
    98  that the version number in the chart package name matches the version number in
    99  the `Chart.yaml`. Failure to meet this assumption will cause an error.
   100  
   101  ### The appVersion field
   102  
   103  Note that the `appVersion` field is not related to the `version` field. It is
   104  a way of specifying the version of the application. For example, the `drupal`
   105  chart may have an `appVersion: 8.2.1`, indicating that the version of Drupal
   106  included in the chart (by default) is `8.2.1`. This field is informational, and
   107  has no impact on chart version calculations.
   108  
   109  ### Deprecating Charts
   110  
   111  When managing charts in a Chart Repository, it is sometimes necessary to
   112  deprecate a chart. The optional `deprecated` field in `Chart.yaml` can be used
   113  to mark a chart as deprecated. If the **latest** version of a chart in the
   114  repository is marked as deprecated, then the chart as a whole is considered to
   115  be deprecated. The chart name can later be reused by publishing a newer version
   116  that is not marked as deprecated. The workflow for deprecating charts, as
   117  followed by the [kubernetes/charts](https://github.com/kubernetes/charts)
   118  project is:
   119    - Update chart's `Chart.yaml` to mark the chart as deprecated, bumping the
   120    version
   121    - Release the new chart version in the Chart Repository
   122    - Remove the chart from the source repository (e.g. git)
   123  
   124  ## Chart LICENSE, README and NOTES
   125  
   126  Charts can also contain files that describe the installation, configuration, usage and license of a
   127  chart. A README for a chart should be formatted in Markdown (README.md), and should generally
   128  contain:
   129  
   130  - A description of the application or service the chart provides
   131  - Any prerequisites or requirements to run the chart
   132  - Descriptions of options in `values.yaml` and default values
   133  - Any other information that may be relevant to the installation or configuration of the chart
   134  
   135  The chart can also contain a short plain text `templates/NOTES.txt` file that will be printed out
   136  after installation, and when viewing the status of a release. This file is evaluated as a
   137  [template](#templates-and-values), and can be used to display usage notes, next steps, or any other
   138  information relevant to a release of the chart. For example, instructions could be provided for
   139  connecting to a database, or accessing a web UI. Since this file is printed to STDOUT when running
   140  `helm install` or `helm status`, it is recommended to keep the content brief and point to the README
   141  for greater detail.
   142  
   143  ## Chart Dependencies
   144  
   145  In Helm, one chart may depend on any number of other charts. 
   146  These dependencies can be dynamically linked through the `requirements.yaml`
   147  file or brought in to the `charts/` directory and managed manually. 
   148  
   149  Although manually managing your dependencies has a few advantages some teams need,
   150  the preferred method of declaring dependencies is by using a
   151  `requirements.yaml` file inside of your chart.
   152  
   153  **Note:** The `dependencies:` section of the `Chart.yaml` from Helm
   154  Classic has been completely removed.
   155  
   156  
   157  ### Managing Dependencies with `requirements.yaml`
   158  
   159  A `requirements.yaml` file is a simple file for listing your
   160  dependencies.
   161  
   162  ```yaml
   163  dependencies:
   164    - name: apache
   165      version: 1.2.3
   166      repository: http://example.com/charts
   167    - name: mysql
   168      version: 3.2.1
   169      repository: http://another.example.com/charts
   170  ```
   171  
   172  - The `name` field is the name of the chart you want.
   173  - The `version` field is the version of the chart you want.
   174  - The `repository` field is the full URL to the chart repository. Note
   175    that you must also use `helm repo add` to add that repo locally.
   176  
   177  Once you have a dependencies file, you can run `helm dependency update`
   178  and it will use your dependency file to download all of the specified
   179  charts into your `charts/` directory for you.
   180  
   181  ```console
   182  $ helm dep up foochart
   183  Hang tight while we grab the latest from your chart repositories...
   184  ...Successfully got an update from the "local" chart repository
   185  ...Successfully got an update from the "stable" chart repository
   186  ...Successfully got an update from the "example" chart repository
   187  ...Successfully got an update from the "another" chart repository
   188  Update Complete. Happy Helming!
   189  Saving 2 charts
   190  Downloading apache from repo http://example.com/charts
   191  Downloading mysql from repo http://another.example.com/charts
   192  ```
   193  
   194  When `helm dependency update` retrieves charts, it will store them as
   195  chart archives in the `charts/` directory. So for the example above, one
   196  would expect to see the following files in the charts directory:
   197  
   198  ```
   199  charts/
   200    apache-1.2.3.tgz
   201    mysql-3.2.1.tgz
   202  ```
   203  
   204  Managing charts with `requirements.yaml` is a good way to easily keep
   205  charts updated, and also share requirements information throughout a
   206  team.
   207  
   208  #### Alias field in requirements.yaml
   209  
   210  In addition to the other fields above, each requirements entry may contain
   211  the optional field `alias`.
   212  
   213  Adding an alias for a dependency chart would put
   214  a chart in dependencies using alias as name of new dependency.
   215  
   216  One can use `alias` in cases where they need to access a chart
   217  with other name(s).
   218  
   219  ```yaml
   220  # parentchart/requirements.yaml
   221  dependencies:
   222    - name: subchart
   223      repository: http://localhost:10191
   224      version: 0.1.0
   225      alias: new-subchart-1
   226    - name: subchart
   227      repository: http://localhost:10191
   228      version: 0.1.0
   229      alias: new-subchart-2
   230    - name: subchart
   231      repository: http://localhost:10191
   232      version: 0.1.0
   233  ```
   234  
   235  In the above example we will get 3 dependencies in all for `parentchart`
   236  ```
   237  subchart
   238  new-subchart-1
   239  new-subchart-2
   240  ```
   241  
   242  The manual way of achieving this is by copy/pasting the same chart in the
   243  `charts/` directory multiple times with different names.
   244  
   245  #### Tags and Condition fields in requirements.yaml
   246  
   247  In addition to the other fields above, each requirements entry may contain
   248  the optional fields `tags` and `condition`.
   249  
   250  All charts are loaded by default. If `tags` or `condition` fields are present,
   251  they will be evaluated and used to control loading for the chart(s) they are applied to.
   252  
   253  Condition - The condition field holds one or more YAML paths (delimited by commas).
   254  If this path exists in the top parent's values and resolves to a boolean value,
   255  the chart will be enabled or disabled based on that boolean value.  Only the first
   256  valid path found in the list is evaluated and if no paths exist then the condition has no effect.
   257  
   258  Tags - The tags field is a YAML list of labels to associate with this chart.
   259  In the top parent's values, all charts with tags can be enabled or disabled by
   260  specifying the tag and a boolean value.
   261  
   262  ````
   263  # parentchart/requirements.yaml
   264  dependencies:
   265        - name: subchart1
   266          repository: http://localhost:10191
   267          version: 0.1.0
   268          condition: subchart1.enabled, global.subchart1.enabled
   269          tags:
   270            - front-end
   271            - subchart1
   272  
   273        - name: subchart2
   274          repository: http://localhost:10191
   275          version: 0.1.0
   276          condition: subchart2.enabled,global.subchart2.enabled
   277          tags:
   278            - back-end
   279            - subchart1
   280  
   281  ````
   282  ````
   283  # parentchart/values.yaml
   284  
   285  subchart1:
   286    enabled: true
   287  tags:
   288    front-end: false
   289    back-end: true
   290  ````
   291  
   292  In the above example all charts with the tag `front-end` would be disabled but since the
   293  `subchart1.enabled` path evaluates to 'true' in the parent's values, the condition will override the
   294  `front-end` tag and `subchart1` will be enabled.  
   295  
   296  Since `subchart2` is tagged with `back-end` and that tag evaluates to `true`, `subchart2` will be
   297  enabled. Also note that although `subchart2` has a condition specified in `requirements.yaml`, there
   298  is no corresponding path and value in the parent's values so that condition has no effect.  
   299  
   300  ##### Using the CLI with Tags and Conditions
   301  
   302  The `--set` parameter can be used as usual to alter tag and condition values.
   303  
   304  ````
   305  helm install --set tags.front-end=true --set subchart2.enabled=false
   306  
   307  ````
   308  
   309  ##### Tags and Condition Resolution
   310  
   311  
   312    * **Conditions (when set in values) always override tags.** The first condition
   313      path that exists wins and subsequent ones for that chart are ignored.
   314    * Tags are evaluated as 'if any of the chart's tags are true then enable the chart'.
   315    * Tags and conditions values must be set in the top parent's values.
   316    * The `tags:` key in values must be a top level key. Globals and nested `tags:` tables
   317      are not currently supported.
   318  
   319  #### Importing Child Values via requirements.yaml
   320  
   321  In some cases it is desirable to allow a child chart's values to propagate to the parent chart and be 
   322  shared as common defaults. An additional benefit of using the `exports` format is that it will enable future 
   323  tooling to introspect user-settable values.
   324  
   325  The keys containing the values to be imported can be specified in the parent chart's `requirements.yaml` file 
   326  using a YAML list. Each item in the list is a key which is imported from the child chart's `exports` field. 
   327  
   328  To import values not contained in the `exports` key, use the [child/parent](#using-the-child/parent-format) format.
   329  Examples of both formats are described below.
   330  
   331  ##### Using the exports format
   332  
   333  If a child chart's `values.yaml` file contains an `exports` field at the root, its contents may be imported 
   334  directly into the parent's values by specifying the keys to import as in the example below:
   335  
   336  ```yaml
   337  # parent's requirements.yaml file
   338      ...
   339      import-values:
   340        - data
   341  ```
   342  ```yaml
   343  # child's values.yaml file
   344  ...
   345  exports:
   346    data:
   347      myint: 99
   348  ```
   349  
   350  Since we are specifying the key `data` in our import list, Helm looks in the `exports` field of the child 
   351  chart for `data` key and imports its contents. 
   352  
   353  The final parent values would contain our exported field:
   354  
   355  ```yaml
   356  # parent's values file
   357  ...
   358  myint: 99
   359  
   360  ```
   361  
   362  Please note the parent key `data` is not contained in the parent's final values. If you need to specify the 
   363  parent key, use the 'child/parent' format. 
   364  
   365  ##### Using the child/parent format
   366  
   367  To access values that are not contained in the `exports` key of the child chart's values, you will need to 
   368  specify the source key of the values to be imported (`child`) and the destination path in the parent chart's 
   369  values (`parent`).
   370  
   371  The `import-values` in the example below instructs Helm to take any values found at `child:` path and copy them 
   372  to the parent's values at the path specified in `parent:`
   373  
   374  ```yaml
   375  # parent's requirements.yaml file
   376  dependencies:
   377    - name: subchart1
   378      repository: http://localhost:10191
   379      version: 0.1.0
   380      ...
   381      import-values:
   382        - child: default.data
   383          parent: myimports
   384  ```
   385  In the above example, values found at `default.data` in the subchart1's values will be imported
   386  to the `myimports` key in the parent chart's values as detailed below: 
   387  
   388  ```yaml
   389  # parent's values.yaml file
   390  
   391  myimports:
   392    myint: 0
   393    mybool: false
   394    mystring: "helm rocks!"
   395    
   396  ```
   397  ```yaml
   398  # subchart1's values.yaml file
   399  
   400  default:
   401    data:
   402      myint: 999
   403      mybool: true
   404      
   405  ```
   406  The parent chart's resulting values would be:
   407  
   408  ```yaml
   409  # parent's final values
   410  
   411  myimports:
   412    myint: 999
   413    mybool: true
   414    mystring: "helm rocks!"
   415  
   416  ```
   417  
   418  The parent's final values now contains the `myint` and `mybool` fields imported from subchart1.
   419  
   420  ### Managing Dependencies manually via the `charts/` directory
   421  
   422  If more control over dependencies is desired, these dependencies can
   423  be expressed explicitly by copying the dependency charts into the
   424  `charts/` directory.
   425  
   426  A dependency can be either a chart archive (`foo-1.2.3.tgz`) or an
   427  unpacked chart directory. But its name cannot start with `_` or `.`.
   428  Such files are ignored by the chart loader.
   429  
   430  For example, if the WordPress chart depends on the Apache chart, the
   431  Apache chart (of the correct version) is supplied in the WordPress
   432  chart's `charts/` directory:
   433  
   434  ```
   435  wordpress:
   436    Chart.yaml
   437    requirements.yaml
   438    # ...
   439    charts/
   440      apache/
   441        Chart.yaml
   442        # ...
   443      mysql/
   444        Chart.yaml
   445        # ...
   446  ```
   447  
   448  The example above shows how the WordPress chart expresses its dependency
   449  on Apache and MySQL by including those charts inside of its `charts/`
   450  directory.
   451  
   452  **TIP:** _To drop a dependency into your `charts/` directory, use the
   453  `helm fetch` command_
   454  
   455  ### Operational aspects of using dependencies
   456  
   457  The above sections explain how to specify chart dependencies, but how does this affect
   458  chart installation using `helm install` and `helm upgrade`?
   459  
   460  Suppose that a chart named "A" creates the following Kubernetes objects
   461  
   462  - namespace "A-Namespace"
   463  - statefulset "A-StatefulSet"
   464  - service "A-Service"
   465  
   466  Furthermore, A is dependent on chart B that creates objects
   467  
   468  - namespace "B-Namespace"
   469  - replicaset "B-ReplicaSet"
   470  - service "B-Service"
   471  
   472  After installation/upgrade of chart A a single Helm release is created/modified. The release will 
   473  create/update all of the above Kubernetes objects in the following order:
   474  
   475  - A-Namespace
   476  - B-Namespace
   477  - A-StatefulSet
   478  - B-ReplicaSet
   479  - A-Service
   480  - B-Service
   481  
   482  This is because when Helm installs/upgrades charts, 
   483  the Kubernetes objects from the charts and all its dependencies are 
   484  
   485  - aggregrated into a single set; then 
   486  - sorted by type followed by name; and then 
   487  - created/updated in that order. 
   488  
   489  Hence a single release is created with all the objects for the chart and its dependencies.
   490  
   491  The install order of Kubernetes types is given by the enumeration InstallOrder in kind_sorter.go 
   492  (see [the Helm source file](https://github.com/kubernetes/helm/blob/master/pkg/tiller/kind_sorter.go#L26)).
   493  
   494  ## Templates and Values
   495  
   496  Helm Chart templates are written in the
   497  [Go template language](https://golang.org/pkg/text/template/), with the
   498  addition of 50 or so add-on template
   499  functions [from the Sprig library](https://github.com/Masterminds/sprig) and a
   500  few other [specialized functions](charts_tips_and_tricks.md).
   501  
   502  All template files are stored in a chart's `templates/` folder. When
   503  Helm renders the charts, it will pass every file in that directory
   504  through the template engine.
   505  
   506  Values for the templates are supplied two ways:
   507  
   508    - Chart developers may supply a file called `values.yaml` inside of a
   509      chart. This file can contain default values.
   510    - Chart users may supply a YAML file that contains values. This can be
   511      provided on the command line with `helm install`.
   512  
   513  When a user supplies custom values, these values will override the
   514  values in the chart's `values.yaml` file.
   515  
   516  ### Template Files
   517  
   518  Template files follow the standard conventions for writing Go templates
   519  (see [the text/template Go package documentation](https://golang.org/pkg/text/template/)
   520  for details).
   521  An example template file might look something like this:
   522  
   523  ```yaml
   524  apiVersion: v1
   525  kind: ReplicationController
   526  metadata:
   527    name: deis-database
   528    namespace: deis
   529    labels:
   530      heritage: deis
   531  spec:
   532    replicas: 1
   533    selector:
   534      app: deis-database
   535    template:
   536      metadata:
   537        labels:
   538          app: deis-database
   539      spec:
   540        serviceAccount: deis-database
   541        containers:
   542          - name: deis-database
   543            image: {{.Values.imageRegistry}}/postgres:{{.Values.dockerTag}}
   544            imagePullPolicy: {{.Values.pullPolicy}}
   545            ports:
   546              - containerPort: 5432
   547            env:
   548              - name: DATABASE_STORAGE
   549                value: {{default "minio" .Values.storage}}
   550  ```
   551  
   552  The above example, based loosely on [https://github.com/deis/charts](https://github.com/deis/charts), is a template for a Kubernetes replication controller.
   553  It can use the following four template values (usually defined in a
   554  `values.yaml` file):
   555  
   556  - `imageRegistry`: The source registry for the Docker image.
   557  - `dockerTag`: The tag for the docker image.
   558  - `pullPolicy`: The Kubernetes pull policy.
   559  - `storage`: The storage backend, whose default is set to `"minio"`
   560  
   561  All of these values are defined by the template author. Helm does not
   562  require or dictate parameters.
   563  
   564  To see many working charts, check out the [Kubernetes Charts
   565  project](https://github.com/kubernetes/charts)
   566  
   567  ### Predefined Values
   568  
   569  Values that are supplied via a `values.yaml` file (or via the `--set`
   570  flag) are accessible from the `.Values` object in a template. But there
   571  are other pre-defined pieces of data you can access in your templates.
   572  
   573  The following values are pre-defined, are available to every template, and
   574  cannot be overridden. As with all values, the names are _case
   575  sensitive_.
   576  
   577  - `Release.Name`: The name of the release (not the chart)
   578  - `Release.Time`: The time the chart release was last updated. This will
   579    match the `Last Released` time on a Release object.
   580  - `Release.Namespace`: The namespace the chart was released to.
   581  - `Release.Service`: The service that conducted the release. Usually
   582    this is `Tiller`.
   583  - `Release.IsUpgrade`: This is set to true if the current operation is an upgrade or rollback.
   584  - `Release.IsInstall`: This is set to true if the current operation is an
   585    install.
   586  - `Release.Revision`: The revision number. It begins at 1, and increments with
   587    each `helm upgrade`.
   588  - `Chart`: The contents of the `Chart.yaml`. Thus, the chart version is
   589    obtainable as `Chart.Version` and the maintainers are in
   590    `Chart.Maintainers`.
   591  - `Files`: A map-like object containing all non-special files in the chart. This
   592    will not give you access to templates, but will give you access to additional
   593    files that are present (unless they are excluded using `.helmignore`). Files can be
   594    accessed using `{{index .Files "file.name"}}` or using the `{{.Files.Get name}}` or
   595    `{{.Files.GetString name}}` functions. You can also access the contents of the file
   596    as `[]byte` using `{{.Files.GetBytes}}`
   597  - `Capabilities`: A map-like object that contains information about the versions
   598    of Kubernetes (`{{.Capabilities.KubeVersion}}`, Tiller
   599    (`{{.Capabilities.TillerVersion}}`, and the supported Kubernetes API versions
   600    (`{{.Capabilities.APIVersions.Has "batch/v1"`)
   601  
   602  **NOTE:** Any unknown Chart.yaml fields will be dropped. They will not
   603  be accessible inside of the `Chart` object. Thus, Chart.yaml cannot be
   604  used to pass arbitrarily structured data into the template. The values
   605  file can be used for that, though.
   606  
   607  ### Values files
   608  
   609  Considering the template in the previous section, a `values.yaml` file
   610  that supplies the necessary values would look like this:
   611  
   612  ```yaml
   613  imageRegistry: "quay.io/deis"
   614  dockerTag: "latest"
   615  pullPolicy: "Always"
   616  storage: "s3"
   617  ```
   618  
   619  A values file is formatted in YAML. A chart may include a default
   620  `values.yaml` file. The Helm install command allows a user to override
   621  values by supplying additional YAML values:
   622  
   623  ```console
   624  $ helm install --values=myvals.yaml wordpress
   625  ```
   626  
   627  When values are passed in this way, they will be merged into the default
   628  values file. For example, consider a `myvals.yaml` file that looks like
   629  this:
   630  
   631  ```yaml
   632  storage: "gcs"
   633  ```
   634  
   635  When this is merged with the `values.yaml` in the chart, the resulting
   636  generated content will be:
   637  
   638  ```yaml
   639  imageRegistry: "quay.io/deis"
   640  dockerTag: "latest"
   641  pullPolicy: "Always"
   642  storage: "gcs"
   643  ```
   644  
   645  Note that only the last field was overridden.
   646  
   647  **NOTE:** The default values file included inside of a chart _must_ be named
   648  `values.yaml`. But files specified on the command line can be named
   649  anything.
   650  
   651  **NOTE:** If the `--set` flag is used on `helm install` or `helm upgrade`, those
   652  values are simply converted to YAML on the client side.
   653  
   654  **NOTE:** If any required entries in the values file exist, they can be declared
   655  as required in the chart template by using the ['required' function](charts_tips_and_tricks.md)
   656  
   657  Any of these values are then accessible inside of templates using the
   658  `.Values` object:
   659  
   660  ```yaml
   661  apiVersion: v1
   662  kind: ReplicationController
   663  metadata:
   664    name: deis-database
   665    namespace: deis
   666    labels:
   667      heritage: deis
   668  spec:
   669    replicas: 1
   670    selector:
   671      app: deis-database
   672    template:
   673      metadata:
   674        labels:
   675          app: deis-database
   676      spec:
   677        serviceAccount: deis-database
   678        containers:
   679          - name: deis-database
   680            image: {{.Values.imageRegistry}}/postgres:{{.Values.dockerTag}}
   681            imagePullPolicy: {{.Values.pullPolicy}}
   682            ports:
   683              - containerPort: 5432
   684            env:
   685              - name: DATABASE_STORAGE
   686                value: {{default "minio" .Values.storage}}
   687  
   688  ```
   689  
   690  ### Scope, Dependencies, and Values
   691  
   692  Values files can declare values for the top-level chart, as well as for
   693  any of the charts that are included in that chart's `charts/` directory.
   694  Or, to phrase it differently, a values file can supply values to the
   695  chart as well as to any of its dependencies. For example, the
   696  demonstration WordPress chart above has both `mysql` and `apache` as
   697  dependencies. The values file could supply values to all of these
   698  components:
   699  
   700  ```yaml
   701  title: "My WordPress Site" # Sent to the WordPress template
   702  
   703  mysql:
   704    max_connections: 100 # Sent to MySQL
   705    password: "secret"
   706  
   707  apache:
   708    port: 8080 # Passed to Apache
   709  ```
   710  
   711  Charts at a higher level have access to all of the variables defined
   712  beneath. So the WordPress chart can access the MySQL password as
   713  `.Values.mysql.password`. But lower level charts cannot access things in
   714  parent charts, so MySQL will not be able to access the `title` property. Nor,
   715  for that matter, can it access `apache.port`.
   716  
   717  Values are namespaced, but namespaces are pruned. So for the WordPress
   718  chart, it can access the MySQL password field as `.Values.mysql.password`. But
   719  for the MySQL chart, the scope of the values has been reduced and the
   720  namespace prefix removed, so it will see the password field simply as
   721  `.Values.password`.
   722  
   723  #### Global Values
   724  
   725  As of 2.0.0-Alpha.2, Helm supports special "global" value. Consider
   726  this modified version of the previous example:
   727  
   728  ```yaml
   729  title: "My WordPress Site" # Sent to the WordPress template
   730  
   731  global:
   732    app: MyWordPress
   733  
   734  mysql:
   735    max_connections: 100 # Sent to MySQL
   736    password: "secret"
   737  
   738  apache:
   739    port: 8080 # Passed to Apache
   740  ```
   741  
   742  The above adds a `global` section with the value `app: MyWordPress`.
   743  This value is available to _all_ charts as `.Values.global.app`.
   744  
   745  For example, the `mysql` templates may access `app` as `{{.Values.global.app}}`, and
   746  so can the `apache` chart. Effectively, the values file above is
   747  regenerated like this:
   748  
   749  ```yaml
   750  title: "My WordPress Site" # Sent to the WordPress template
   751  
   752  global:
   753    app: MyWordPress
   754  
   755  mysql:
   756    global:
   757      app: MyWordPress
   758    max_connections: 100 # Sent to MySQL
   759    password: "secret"
   760  
   761  apache:
   762    global:
   763      app: MyWordPress
   764    port: 8080 # Passed to Apache
   765  ```
   766  
   767  This provides a way of sharing one top-level variable with all
   768  subcharts, which is useful for things like setting `metadata` properties
   769  like labels.
   770  
   771  If a subchart declares a global variable, that global will be passed
   772  _downward_ (to the subchart's subcharts), but not _upward_ to the parent
   773  chart. There is no way for a subchart to influence the values of the
   774  parent chart.
   775  
   776  Also, global variables of parent charts take precedence over the global variables from subcharts.
   777  
   778  ### References
   779  
   780  When it comes to writing templates and values files, there are several
   781  standard references that will help you out.
   782  
   783  - [Go templates](https://godoc.org/text/template)
   784  - [Extra template functions](https://godoc.org/github.com/Masterminds/sprig)
   785  - [The YAML format](http://yaml.org/spec/)
   786  
   787  ## Using Helm to Manage Charts
   788  
   789  The `helm` tool has several commands for working with charts.
   790  
   791  It can create a new chart for you:
   792  
   793  ```console
   794  $ helm create mychart
   795  Created mychart/
   796  ```
   797  
   798  Once you have edited a chart, `helm` can package it into a chart archive
   799  for you:
   800  
   801  ```console
   802  $ helm package mychart
   803  Archived mychart-0.1.-.tgz
   804  ```
   805  
   806  You can also use `helm` to help you find issues with your chart's
   807  formatting or information:
   808  
   809  ```console
   810  $ helm lint mychart
   811  No issues found
   812  ```
   813  
   814  ## Chart Repositories
   815  
   816  A _chart repository_ is an HTTP server that houses one or more packaged
   817  charts. While `helm` can be used to manage local chart directories, when
   818  it comes to sharing charts, the preferred mechanism is a chart
   819  repository.
   820  
   821  Any HTTP server that can serve YAML files and tar files and can answer
   822  GET requests can be used as a repository server.
   823  
   824  Helm comes with built-in package server for developer testing (`helm
   825  serve`). The Helm team has tested other servers, including Google Cloud
   826  Storage with website mode enabled, and S3 with website mode enabled.
   827  
   828  A repository is characterized primarily by the presence of a special
   829  file called `index.yaml` that has a list of all of the packages supplied
   830  by the repository, together with metadata that allows retrieving and
   831  verifying those packages.
   832  
   833  On the client side, repositories are managed with the `helm repo`
   834  commands. However, Helm does not provide tools for uploading charts to
   835  remote repository servers. This is because doing so would add
   836  substantial requirements to an implementing server, and thus raise the
   837  barrier for setting up a repository.
   838  
   839  ## Chart Starter Packs
   840  
   841  The `helm create` command takes an optional `--starter` option that lets you
   842  specify a "starter chart".
   843  
   844  Starters are just regular charts, but are located in `$HELM_HOME/starters`.
   845  As a chart developer, you may author charts that are specifically designed
   846  to be used as starters. Such charts should be designed with the following
   847  considerations in mind:
   848  
   849  - The `Chart.yaml` will be overwritten by the generator.
   850  - Users will expect to modify such a chart's contents, so documentation
   851    should indicate how users can do so.
   852  - All occurances of `<CHARTNAME>` will be replaced with the specified chart
   853    name so that starter charts can be used as templates.
   854  
   855  Currently the only way to add a chart to `$HELM_HOME/starters` is to manually
   856  copy it there. In your chart's documentation, you may want to explain that
   857  process.