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