PageSourceSearch

https://helm.sh/assets/js/c3822739.455a053d.js

js helm.sh collected 2026-09-24 07:28:06 UTC 52,021 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkhelm_www=self.webpackChunkhelm_www||[]).push([["38807"],{93831(e,n,s){s.r(n),s.d(n,{metadata:()=>a,default:()=>h,frontMatter:()=>r,contentTitle:()=>l,toc:()=>o,assets:()=>c});var a=JSON.parse('{"id":"developing_charts/developing_charts","title":"Charts","description":"Helm uses a packaging format called charts. A chart is a collection of files","source":"@site/versioned_docs/version-2/developing_charts/developing_charts.md","sourceDirName":"developing_charts","slug":"/developing_charts/","permalink":"/docs/v2/developing_charts/","draft":false,"unlisted":false,"editUrl":"https://github.com/helm/helm-www/blob/main/versioned_docs/version-2/developing_charts/developing_charts.md","tags":[],"version":"2","sidebarPosition":5,"frontMatter":{"sidebar_position":5,"sidebar_label":"Charts"},"sidebar":"tutorialSidebar","previous":{"title":"Helm Version","permalink":"/docs/v2/helm/helm_version"},"next":{"title":"Chart Lifecycle Hooks","permalink":"/docs/v2/developing_charts/charts_hooks"}}'),t=s(74848),i=s(28453);let r={sidebar_position:5,sidebar_label:"Charts"},l="Charts",c={},o=[{value:"The Chart File Structure",id:"the-chart-file-structure",level:2},{value:"The Chart.yaml File",id:"the-chartyaml-file",level:2},{value:"Charts and Versioning",id:"charts-and-versioning",level:3},{value:"The appVersion field",id:"the-appversion-field",level:3},{value:"Deprecating Charts",id:"deprecating-charts",level:3},{value:"Chart LICENSE, README and NOTES",id:"chart-license-readme-and-notes",level:2},{value:"Chart Dependencies",id:"chart-dependencies",level:2},{value:"Managing Dependencies with <code>requirements.yaml</code>",id:"managing-dependencies-with-requirementsyaml",level:3},{value:"Alias field in requirements.yaml",id:"alias-field-in-requirementsyaml",level:4},{value:"Tags and Condition fields in requirements.yaml",id:"tags-and-condition-fields-in-requirementsyaml",level:4},{value:"Using the CLI with Tags and Conditions",id:"using-the-cli-with-tags-and-conditions",level:5},{value:"Tags and Condition Resolution",id:"tags-and-condition-resolution",level:5},{value:"Importing Child Values via requirements.yaml",id:"importing-child-values-via-requirementsyaml",level:4},{value:"Using the exports format",id:"using-the-exports-format",level:5},{value:"Using the child-parent format",id:"using-the-child-parent-format",level:5},{value:"Managing Dependencies manually via the <code>charts/</code> directory",id:"managing-dependencies-manually-via-the-charts-directory",level:3},{value:"Operational aspects of using dependencies",id:"operational-aspects-of-using-dependencies",level:3},{value:"Templates and Values",id:"templates-and-values",level:2},{value:"Template Files",id:"template-files",level:3},{value:"Predefined Values",id:"predefined-values",level:3},{value:"Values files",id:"values-files",level:3},{value:"Scope, Dependencies, and Values",id:"scope-dependencies-and-values",level:3},{value:"Global Values",id:"global-values",level:4},{value:"References",id:"references",level:3},{value:"Using Helm to Manage Charts",id:"using-helm-to-manage-charts",level:2},{value:"Chart Repositories",id:"chart-repositories",level:2},{value:"Chart Starter Packs",id:"chart-starter-packs",level:2}];function d(e){let n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"charts",children:"Charts"})}),"\n",(0,t.jsxs)(n.p,{children:["Helm uses a packaging format called ",(0,t.jsx)(n.em,{children:"charts"}),". A chart is a collection of files\nthat describe a related set of Kubernetes resources. A single chart\nmight be used to deploy something simple, like a memcached pod, or\nsomething complex, like a full web app stack with HTTP servers,\ndatabases, caches, and so on."]}),"\n",(0,t.jsx)(n.p,{children:"Charts are created as files laid out in a particular directory tree,\nthen they can be packaged into versioned archives to be deployed."}),"\n",(0,t.jsx)(n.p,{children:"This document explains the chart format, and provides basic guidance for\nbuilding charts with Helm."}),"\n",(0,t.jsx)(n.h2,{id:"the-chart-file-structure",children:"The Chart File Structure"}),"\n",(0,t.jsxs)(n.p,{children:["A chart is organized as a collection of files inside of a directory. The\ndirectory name is the name of the chart (without versioning information). Thus,\na chart describing WordPress would be stored in the ",(0,t.jsx)(n.code,{children:"wordpress/"})," directory."]}),"\n",(0,t.jsx)(n.p,{children:"Inside of this directory, Helm will expect a structure that matches this:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"wordpress/\n  Chart.yaml          # A YAML file containing information about the chart\n  LICENSE             # OPTIONAL: A plain text file containing the license for the chart\n  README.md           # OPTIONAL: A human-readable README file\n  requirements.yaml   # OPTIONAL: A YAML file listing dependencies for the chart\n  values.yaml         # The default configuration values for this chart\n  charts/             # A directory containing any charts upon which this chart depends.\n  templates/          # A directory of templates that, when combined with values,\n                      # will generate valid Kubernetes manifest files.\n  templates/NOTES.txt # OPTIONAL: A plain text file containing short usage notes\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Helm reserves use of the ",(0,t.jsx)(n.code,{children:"charts/"})," and ",(0,t.jsx)(n.code,{children:"templates/"})," directories, and of\nthe listed file names. Other files will be left as they are."]}),"\n",(0,t.jsx)(n.h2,{id:"the-chartyaml-file",children:"The Chart.yaml File"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"Chart.yaml"})," file is required for a chart. It contains the following fields:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: The chart API version, always \"v1\" (required)\nname: The name of the chart (required)\nversion: A SemVer 2 version (required)\nkubeVersion: A SemVer range of compatible Kubernetes versions (optional)\ndescription: A single-sentence description of this project (optional)\nkeywords:\n  - A list of keywords about this project (optional)\nhome: The URL of this project's home page (optional)\nsources:\n  - A list of URLs to source code for this project (optional)\nmaintainers: # (optional)\n  - name: The maintainer's name (required for each maintainer)\n    email: The maintainer's email (optional for each maintainer)\n    url: A URL for the maintainer (optional for each maintainer)\nengine: gotpl # The name of the template engine (optional, defaults to gotpl)\nicon: A URL to an SVG or PNG image to be used as an icon (optional).\nappVersion: The version of the app that this contains (optional). This needn't be SemVer.\ndeprecated: Whether this chart is deprecated (optional, boolean)\ntillerVersion: The version of Tiller that this chart requires. This should be expressed as a SemVer range: \">2.0.0\" (optional)\n"})}),"\n",(0,t.jsxs)(n.p,{children:["If you are familiar with the ",(0,t.jsx)(n.code,{children:"Chart.yaml"})," file format for Helm Classic, you will\nnotice that fields specifying dependencies have been removed. That is because\nthe new Chart format expresses depen
1dencies using the ",(0,t.jsx)(n.code,{children:"charts/"})," directory."]}),"\n",(0,t.jsx)(n.p,{children:"Other fields will be silently ignored."}),"\n",(0,t.jsx)(n.h3,{id:"charts-and-versioning",children:"Charts and Versioning"}),"\n",(0,t.jsxs)(n.p,{children:["Every chart must have a version number. A version must follow the\n",(0,t.jsx)(n.a,{href:"https://semver.org/",children:"SemVer 2"})," standard. Unlike Helm Classic, Kubernetes\nHelm uses version numbers as release markers. Packages in repositories\nare identified by name plus version."]}),"\n",(0,t.jsxs)(n.p,{children:["For example, an ",(0,t.jsx)(n.code,{children:"nginx"})," chart whose version field is set to ",(0,t.jsx)(n.code,{children:"version: 1.2.3"})," will be named:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"nginx-1.2.3.tgz\n"})}),"\n",(0,t.jsxs)(n.p,{children:["More complex SemVer 2 names are also supported, such as\n",(0,t.jsx)(n.code,{children:"version: 1.2.3-alpha.1+ef365"}),". But non-SemVer names are explicitly\ndisallowed by the system."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"NOTE:"})," Whereas Helm Classic and Deployment Manager were both\nvery GitHub oriented when it came to charts, Kubernetes Helm does not\nrely upon or require GitHub or even Git. Consequently, it does not use\nGit SHAs for versioning at all."]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"version"})," field inside of the ",(0,t.jsx)(n.code,{children:"Chart.yaml"})," is used by many of the\nHelm tools, including the CLI and the Tiller server. When generating a\npackage, the ",(0,t.jsx)(n.code,{children:"helm package"})," command will use the version that it finds\nin the ",(0,t.jsx)(n.code,{children:"Chart.yaml"})," as a token in the package name. The system assumes\nthat the version number in the chart package name matches the version number in\nthe ",(0,t.jsx)(n.code,{children:"Chart.yaml"}),". Failure to meet this assumption will cause an error."]}),"\n",(0,t.jsx)(n.h3,{id:"the-appversion-field",children:"The appVersion field"}),"\n",(0,t.jsxs)(n.p,{children:["Note that the ",(0,t.jsx)(n.code,{children:"appVersion"})," field is not related to the ",(0,t.jsx)(n.code,{children:"version"})," field. It is\na way of specifying the version of the application. For example, the ",(0,t.jsx)(n.code,{children:"drupal"}),"\nchart may have an ",(0,t.jsx)(n.code,{children:"appVersion: 8.2.1"}),", indicating that the version of Drupal\nincluded in the chart (by default) is ",(0,t.jsx)(n.code,{children:"8.2.1"}),". This field is informational, and\nhas no impact on chart version calculations."]}),"\n",(0,t.jsx)(n.h3,{id:"deprecating-charts",children:"Deprecating Charts"}),"\n",(0,t.jsxs)(n.p,{children:["When managing charts in a Chart Repository, it is sometimes necessary to\ndeprecate a chart. The optional ",(0,t.jsx)(n.code,{children:"deprecated"})," field in ",(0,t.jsx)(n.code,{children:"Chart.yaml"})," can be used\nto mark a chart as deprecated. If the ",(0,t.jsx)(n.strong,{children:"latest"})," version of a chart in the\nrepository is marked as deprecated, then the chart as a whole is considered to\nbe deprecated. The chart name can later be reused by publishing a newer version\nthat is not marked as deprecated. The workflow for deprecating charts, as\nfollowed by the ",(0,t.jsx)(n.a,{href:"https://github.com/helm/charts",children:"helm/charts"}),"\nproject is:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Update chart's ",(0,t.jsx)(n.code,{children:"Chart.yaml"})," to mark the chart as deprecated, bumping the version"]}),"\n",(0,t.jsx)(n.li,{children:"Release the new chart version in the Chart Repository"}),"\n",(0,t.jsx)(n.li,{children:"Remove the chart from the source repository (e.g. git)"}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"chart-license-readme-and-notes",children:"Chart LICENSE, README and NOTES"}),"\n",(0,t.jsx)(n.p,{children:"Charts can also contain files that describe the installation, configuration, usage and license of a\nchart."}),"\n",(0,t.jsxs)(n.p,{children:["A LICENSE is a plain text file containing the ",(0,t.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/Software_license",children:"license"}),"\nfor the chart. The chart can contain a license as it may have programming logic in the templates and\nwould therefore not be configuration only. There can also be separate license(s) for the application\ninstalled by the chart, if required."]}),"\n",(0,t.jsx)(n.p,{children:"A README for a chart should be formatted in Markdown (README.md), and should generally\ncontain:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"A description of the application or service the chart provides"}),"\n",(0,t.jsx)(n.li,{children:"Any prerequisites or requirements to run the chart"}),"\n",(0,t.jsxs)(n.li,{children:["Descriptions of options in ",(0,t.jsx)(n.code,{children:"values.yaml"})," and default values"]}),"\n",(0,t.jsx)(n.li,{children:"Any other information that may be relevant to the installation or configuration of the chart"}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["The chart can also contain a short plain text ",(0,t.jsx)(n.code,{children:"templates/NOTES.txt"})," file that will be printed out\nafter installation, and when viewing the status of a release. This file is evaluated as a\n",(0,t.jsx)(n.a,{href:"#templates-and-values",children:"template"}),", and can be used to display usage notes, next steps, or any other\ninformation relevant to a release of the chart. For example, instructions could be provided for\nconnecting to a database, or accessing a web UI. Since this file is printed to STDOUT when running\n",(0,t.jsx)(n.code,{children:"helm install"})," or ",(0,t.jsx)(n.code,{children:"helm status"}),", it is recommended to keep the content brief and point to the README\nfor greater detail."]}),"\n",(0,t.jsx)(n.h2,{id:"chart-dependencies",children:"Chart Dependencies"}),"\n",(0,t.jsxs)(n.p,{children:["In Helm, one chart may depend on any number of other charts.\nThese dependencies can be dynamically linked through the ",(0,t.jsx)(n.code,{children:"requirements.yaml"}),"\nfile or brought in to the ",(0,t.jsx)(n.code,{children:"charts/"})," directory and managed manually."]}),"\n",(0,t.jsxs)(n.p,{children:["Although manually managing your dependencies has a few advantages some teams need,\nthe preferred method of declaring dependencies is by using a\n",(0,t.jsx)(n.code,{children:"requirements.yaml"})," file inside of your chart."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Note:"})," The ",(0,t.jsx)(n.code,{children:"dependencies:"})," section of the ",(0,t.jsx)(n.code,{children:"Chart.yaml"})," from Helm\nClassic has been completely removed."]}),"\n",(0,t.jsxs)(n.h3,{id:"managing-dependencies-with-requirementsyaml",children:["Managing Dependencies with ",(0,t.jsx)(n.code,{children:"requirements.yaml"})]}),"\n",(0,t.jsxs)(n.p,{children:["A ",(0,t.jsx)(n.code,{children:"requirements.yaml"})," file is a simple file for listing your\ndependencies."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"dependencies:\n  - name: apache\n    version: 1.2.3\n    repository: http://example.com/charts\n  - name: mysql\n    version: 3.2.1\n    repository: http://another.example.com/charts\n"})}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.code,{children:"name"})," field is the name of the chart you want."]}),"\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.code,{children:"version"})," field is the version of the chart you want."]}),"\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.code,{children:"repository"})," field is the full URL to the chart repository. Note\nthat you must also use ",(0,t.jsx)(n.code,{children:"helm repo add"})," to add that repo locally."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Once you have a dependencies file, you can run ",(0,t.jsx)(n.code,{children:"helm dependency update"}),"\nand it will use your dependency file to download all the specified\ncharts into your ",(0,t.jsx)(n.code,{children:"charts/"})," directory for you."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-console",children:'$ helm dep up foochart\nHang tight while we grab the latest from your chart repositories...\n...Successfully got an update from the "local" chart repository\n...Successfully got an update from the "stable" chart repository\n...Successfully got an update from the "example" chart repository\n...Successfully got an update from the "another" chart repository\nUpdate Complete.\nSaving 2 charts\nDownloading apache from repo http://example.com/charts\nDownloading mysql from repo http://another.example.com/charts\n'})}),"\n",(0,t.jsxs)(n.p,{children:["When ",(0,t.jsx)(n.code,{children:"helm dependency update"})," retrieves charts, it will store them as\nchart archives in the ",(0,t.jsx)(n.code,{children:"charts/"})," directory. So for the example above, one\nwould expect to see the following files in the charts directory:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"charts/\n  apache-1.2.3.tgz\n  mysql-3.2.1.tgz\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Managing charts with ",(0,t.jsx)(n.code,{children:"requirements.yaml"})," is a good way to easily keep\ncharts updated, and also share requirements information throughout a\nteam."]}),"\n",(0,t.jsx)(n.h4,{id:"alias-field-in-requirementsyaml",children:"Alias field in requirements.yaml"}),"\n",(0,t.jsxs)(n.p,{children:["In addition to the other fields above, each requirements entry may contain\nthe optional field ",(0,t.jsx)(n.code,{children:"alias"}),"."]}),"\n",(0,t.jsx)(n.p,{children:"Adding an alias for a dependency chart would put\na chart in dependencies using alias as name of new depen
1dency."}),"\n",(0,t.jsxs)(n.p,{children:["One can use ",(0,t.jsx)(n.code,{children:"alias"})," in cases where they need to access a chart\nwith other name(s)."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"# parentchart/requirements.yaml\ndependencies:\n  - name: subchart\n    repository: http://localhost:10191\n    version: 0.1.0\n    alias: new-subchart-1\n  - name: subchart\n    repository: http://localhost:10191\n    version: 0.1.0\n    alias: new-subchart-2\n  - name: subchart\n    repository: http://localhost:10191\n    version: 0.1.0\n"})}),"\n",(0,t.jsxs)(n.p,{children:["In the above example we will get 3 dependencies in all for ",(0,t.jsx)(n.code,{children:"parentchart"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"subchart\nnew-subchart-1\nnew-subchart-2\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The manual way of achieving this is by copy/pasting the same chart in the\n",(0,t.jsx)(n.code,{children:"charts/"})," directory multiple times with different names."]}),"\n",(0,t.jsx)(n.h4,{id:"tags-and-condition-fields-in-requirementsyaml",children:"Tags and Condition fields in requirements.yaml"}),"\n",(0,t.jsxs)(n.p,{children:["In addition to the other fields above, each requirements entry may contain\nthe optional fields ",(0,t.jsx)(n.code,{children:"tags"})," and ",(0,t.jsx)(n.code,{children:"condition"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["All charts are loaded by default. If ",(0,t.jsx)(n.code,{children:"tags"})," or ",(0,t.jsx)(n.code,{children:"condition"})," fields are present,\nthey will be evaluated and used to control loading for the chart(s) they are applied to."]}),"\n",(0,t.jsx)(n.p,{children:"Condition - The condition field holds one or more YAML paths (delimited by commas).\nIf this path exists in the parent's values and resolves to a boolean value,\nthe chart will be enabled or disabled based on that boolean value. Only the first\nvalid path found in the list is evaluated and if no paths exist then the condition\nhas no effect. For multiple level dependencies the condition is prependend by the\npath to the parent chart."}),"\n",(0,t.jsx)(n.p,{children:"Tags - The tags field is a YAML list of labels to associate with this chart.\nIn the top parent's values, all charts with tags can be enabled or disabled by\nspecifying the tag and a boolean value."}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"# parentchart/requirements.yaml\ndependencies:\n  - name: subchart1\n    repository: http://localhost:10191\n    version: 0.1.0\n    condition: subchart1.enabled\n    tags:\n      - front-end\n      - subchart1\n\n  - name: subchart2\n    repository: http://localhost:10191\n    version: 0.1.0\n    condition: subchart2.enabled\n    tags:\n      - back-end\n      - subchart2\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"# subchart2/requirements.yaml\ndependencies:\n  - name: subsubchart\n    repository: http://localhost:10191\n    version: 0.1.0\n    condition: subsubchart.enabled\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"# parentchart/values.yaml\n\nsubchart1:\n  enabled: true\nsubchart2:\n  subsubchart:\n    enabled: false\ntags:\n  front-end: false\n  back-end: true\n"})}),"\n",(0,t.jsxs)(n.p,{children:["In the above example all charts with the tag ",(0,t.jsx)(n.code,{children:"front-end"})," would be disabled but since the\n",(0,t.jsx)(n.code,{children:"subchart1.enabled"})," path evaluates to 'true' in the parent's values, the condition will override the\n",(0,t.jsx)(n.code,{children:"front-end"})," tag and ",(0,t.jsx)(n.code,{children:"subchart1"})," will be enabled."]}),"\n",(0,t.jsxs)(n.p,{children:["Since ",(0,t.jsx)(n.code,{children:"subchart2"})," is tagged with ",(0,t.jsx)(n.code,{children:"back-end"})," and that tag evaluates to ",(0,t.jsx)(n.code,{children:"true"}),", ",(0,t.jsx)(n.code,{children:"subchart2"})," will be\nenabled. Also note that although ",(0,t.jsx)(n.code,{children:"subchart2"})," has a condition specified in ",(0,t.jsx)(n.code,{children:"requirements.yaml"}),", there\nis no corresponding path and value in the parent's values so that condition has no effect."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"subsubchart"})," is disabled by default but can be enabled by setting ",(0,t.jsx)(n.code,{children:"subchart2.subsubchart.enabled=true"}),".\nHint: disabling ",(0,t.jsx)(n.code,{children:"subchart2"})," via tag will also disable all sub-charts (even if overriding the value ",(0,t.jsx)(n.code,{children:"subchart2.subsubchart.enabled=true"}),")."]}),"\n",(0,t.jsx)(n.h5,{id:"using-the-cli-with-tags-and-conditions",children:"Using the CLI with Tags and Conditions"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"--set"})," parameter can be used as usual to alter tag and condition values."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"helm install --set tags.front-end=true --set subchart2.enabled=false\n"})}),"\n",(0,t.jsx)(n.h5,{id:"tags-and-condition-resolution",children:"Tags and Condition Resolution"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.strong,{children:"Conditions (when set in values) always override tags."})}),"\n",(0,t.jsx)(n.li,{children:"The first condition path that exists wins and subsequent ones for that chart are ignored."}),"\n",(0,t.jsx)(n.li,{children:"Tags are evaluated as 'if any of the chart'
1s tags are true then enable the chart'."}),"\n",(0,t.jsx)(n.li,{children:"Tags and conditions values must be set in the top parent's values."}),"\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.code,{children:"tags:"})," key in values must be a top level key. Globals and nested ",(0,t.jsx)(n.code,{children:"tags:"})," tables\nare not currently supported."]}),"\n"]}),"\n",(0,t.jsx)(n.h4,{id:"importing-child-values-via-requirementsyaml",children:"Importing Child Values via requirements.yaml"}),"\n",(0,t.jsxs)(n.p,{children:["In some cases it is desirable to allow a child chart's values to propagate to the parent chart and be\nshared as common defaults. An additional benefit of using the ",(0,t.jsx)(n.code,{children:"exports"})," format is that it will enable future\ntooling to introspect user-settable values."]}),"\n",(0,t.jsxs)(n.p,{children:["The keys containing the values to be imported can be specified in the parent chart's ",(0,t.jsx)(n.code,{children:"requirements.yaml"})," file\nusing a YAML list. Each item in the list is a key which is imported from the child chart's ",(0,t.jsx)(n.code,{children:"exports"})," field."]}
1),"\n",(0,t.jsxs)(n.p,{children:["To import values not contained in the ",(0,t.jsx)(n.code,{children:"exports"})," key, use the ",(0,t.jsx)(n.a,{href:"#using-the-child-parent-format",children:"child-parent"})," format.\nExamples of both formats are described below."]}),"\n",(0,t.jsx)(n.h5,{id:"using-the-exports-format",children:"Using the exports format"}),"\n",(0,t.jsxs)(n.p,{children:["If a child chart's ",(0,t.jsx)(n.code,{children:"values.yaml"})," file contains an ",(0,t.jsx)(n.code,{children:"exports"})," field at the root, its contents may be imported\ndirectly into the parent's values by specifying the keys to import as in the example below:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"# parent's requirements.yaml file\n    ...\n    import-values:\n      - data\n"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"# child's values.yaml file\n...\nexports:\n  data:\n    myint: 99\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Since we are specifying the key ",(0,t.jsx)(n.code,{children:"data"})," in our import list, Helm looks in the ",(0,t.jsx)(n.code,{children:"exports"})," field of the child\nchart for ",(0,t.jsx)(n.code,{children:"data"})," key and imports its contents."]}),"\n",(0,t.jsx)(n.p,{children:"The final parent values would contain our exported field:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"# parent's values file\n...\nmyint: 99\n\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Please note the parent key ",(0,t.jsx)(n.code,{children:"data"})," is not contained in the parent's final values. If you need to specify the\nparent key, use the 'child-parent' format."]}),"\n",(0,t.jsx)(n.h5,{id:"using-the-child-parent-format",children:"Using the child-parent format"}),"\n",(0,t.jsxs)(n.p,{children:["To access values that are not contained in the ",(0,t.jsx)(n.code,{children:"exports"})," key of the child chart's values, you will need to\nspecify the source key of the values to be imported (",(0,t.jsx)(n.code,{children:"child"}),") and the destination path in the parent chart's\nvalues (",(0,t.jsx)(n.code,{children:"parent"}),")."]}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"import-values"})," in the example below instructs Helm to take any values found at ",(0,t.jsx)(n.code,{children:"child:"})," path and copy them\nto the parent's values at the path specified in ",(0,t.jsx)(n.code,{children:"parent:"})]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"# parent's requirements.yaml file\ndependencies:\n  - name: subchart1\n    repository: http://localhost:10191\n    version: 0.1.0\n    ...\n    import-values:\n      - child: default.data\n        parent: myimports\n"})}),"\n",(0,t.jsxs)(n.p,{children:["In the above example, values found at ",(0,t.jsx)(n.code,{children:"default.data"})," in the subchart1's values will be imported\nto the ",(0,t.jsx)(n.code,{children:"myimports"})," key in the parent chart's values as detailed below:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:'# parent\'s values.yaml file\n\nmyimports:\n  myint: 0\n  mybool: false\n  mystring: "helm rocks!"\n\n'})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"# subchart1's values.yaml file\n\ndefault:\n  data:\n    myint: 999\n    mybool: true\n\n"})}),"\n",(0,t.jsx)(n.p,{children:"The parent chart's resulting values would be:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:'# parent\'s final values\n\nmyimports:\n  myint: 999\n  mybool: true\n  mystring: "helm rocks!"\n\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The parent's final values now contains the ",(0,t.jsx)(n.code,{children:"myint"})," and ",(0,t.jsx)(n.code,{children:"mybool"})," fields imported from subchart1."]}),"\n",(0,t.jsxs)(n.h3,{id:"managing-dependencies-manually-via-the-charts-directory",children:["Managing Dependencies manually via the ",(0,t.jsx)(n.code,{children:"charts/"})," directory"]}),"\n",(0,t.jsxs)(n.p,{children:["If more control over dependencies is desired, these dependencies can\nbe expressed explicitly by copying the dependency charts into the\n",(0,t.jsx)(n.code,{children:"charts/"})," directory."]}),"\n",(0,t.jsxs)(n.p,{children:["A dependency can be either a chart archive (",(0,t.jsx)(n.code,{children:"foo-1.2.3.tgz"}),") or an\nunpacked chart directory. But its name cannot start with ",(0,t.jsx)(n.code,{children:"_"})," or ",(0,t.jsx)(n.code,{children:"."}),".\nSuch files are ignored by the chart loader."]}),"\n",(0,t.jsxs)(n.p,{children:["For example, if the WordPress chart depends on the Apache chart, the\nApache chart (of the correct version) is supplied in the WordPress\nchart's ",(0,t.jsx)(n.code,{children:"charts/"})," directory:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{children:"wordpress:\n  Chart.yaml\n  requirements.yaml\n  # ...\n  charts/\n    apache/\n      Chart.yaml\n      # ...\n    mysql/\n      Chart.yaml\n      # ...\n"})}),"\n",(0,t.jsxs)(n.p,{children:["The example above shows how the WordPress chart expresses its dependency\non Apache and MySQL by including those charts inside of its ",(0,t.jsx)(n.code,{children:"charts/"}),"\ndirectory."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"TIP:"})," ",(0,t.jsxs)(n.em,{children:["To drop a dependency into your ",(0,t.jsx)(n.code,{children:"charts/"})," directory, use the\n",(0,t.jsx)(n.code,{children:"helm fetch"})," command"]})]}),"\n",(0,t.jsx)(n.h3,{id:"operational-aspects-of-using-dependencies",children:"Operational aspects of using dependencies"}),"\n",(0,t.jsxs)(n.p,{children:["The above sections explain how to specify chart dependencies, but how does this affect\nchart installation using ",(0,t.jsx)(n.code,{children:"helm install"})," and ",(0,t.jsx)(n.code,{children:"helm upgrade"}),"?"]}),"\n",(0,t.jsx)(n.p,{children:'Suppose that a chart named "A" creates the following Kubernetes objects'}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:'namespace "A-Namespace"'}),"\n",(0,t.jsx)(n.li,{children:'statefulset "A-StatefulSet"'}),"\n",(0,t.jsx)(n.li,{children:'service "A-Service"'}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"Furthermore, A is dependent on chart B that creates objects"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:'namespace "B-Namespace"'}),"\n",(0,t.jsx)(n.li,{children:'replicaset "B-ReplicaSet"'}),"\n",(0,t.jsx)(n.li,{children:'service "B-Service"'}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"After installation/upgrade of chart A, a single Helm release is created/modified. The release will\ncreate/update all of the above Kubernetes objects in the following order:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"A-Namespace"}),"\n",(0,t.jsx)(n.li,{children:"B-Namespace"}),"\n",(0,t.jsx)(n.li,{children:"A-StatefulSet"}),"\n",(0,t.jsx)(n.li,{children:"B-ReplicaSet"}),"\n",(0,t.jsx)(n.li,{children:"A-Service"}),"\n",(0,t.jsx)(n.li,{children:"B-Service"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"This is because when Helm installs/upgrades charts,\nthe Kubernetes objects from the charts and all its dependencies are"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"aggregated into a single set; then"}),"\n",(0,t.jsx)(n.li,{children:"sorted by type followed by name; and then"}),"\n",(0,t.jsx)(n.li,{children:"created/updated in that order."}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"Hence a single release is created with all the objects for the chart and its dependencies."}),"\n",(0,t.jsxs)(n.p,{children:["The install order of Kubernetes types is given by the enumeration InstallOrder in kind_sorter.go\n(see ",(0,t.jsx)(n.a,{href:"https://github.com/helm/helm/blob/master/pkg/tiller/kind_sorter.go#L26",children:"the Helm source file"}),")."]}),"\n",(0,t.jsx)(n.h2,{id:"templates-and-values",children:"Templates and Values"}),"\n",(0,t.jsxs)(n.p,{children:["Helm Chart templates are written in the\n",(0,t.jsx)(n.a,{href:"https://golang.org/pkg/text/template/",children:"Go template language"}),", with the\naddition of 50 or so add-on template\nfunctions ",(0,t.jsx)(n.a,{href:"https://github.com/Masterminds/sprig",children:"from the Sprig library"})," and a\nfew other ",(0,t.jsx)(n.a,{href:"/docs/v2/developing_charts/charts_tips_and_tricks",children:"specialized functions"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["All template files are stored in a chart's ",(0,t.jsx)(n.code,{children:"templates/"})," folder. When\nHelm renders the charts, it will pass every file in that directory\nthrough the template engine."]}),"\n",(0,t.jsx)(n.p,{children:"Values for the templates are supplied two ways:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Chart developers may supply a file called ",(0,t.jsx)(n.code,{children:"values.yaml"})," inside of a\nchart. This file can contain default values."]}),"\n",(0,t.jsxs)(n.li,{children:["Chart users may supply a YAML file that contains values. This can be\nprov
1ided on the command line with ",(0,t.jsx)(n.code,{children:"helm install"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["When a user supplies custom values, these values will override the\nvalues in the chart's ",(0,t.jsx)(n.code,{children:"values.yaml"})," file."]}),"\n",(0,t.jsx)(n.h3,{id:"template-files",children:"Template Files"}),"\n",(0,t.jsxs)(n.p,{children:["Template files follow the standard conventions for writing Go templates\n(see ",(0,t.jsx)(n.a,{href:"https://golang.org/pkg/text/template/",children:"the text/template Go package documentation"}),"\nfor details).\nAn example template file might look something like this:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:'apiVersion: v1\nkind: ReplicationController\nmetadata:\n  name: deis-database\n  namespace: deis\n  labels:\n    app.kubernetes.io/managed-by: deis\nspec:\n  replicas: 1\n  selector:\n    app.kubernetes.io/name: deis-database\n  template:\n    metadata:\n      labels:\n        app.kubernetes.io/name: deis-database\n    spec:\n      serviceAccount: deis-database\n      containers:\n        - name: deis-database\n          image: {{.Values.imageRegistry}}/postgres:{{.Values.dockerTag}}\n          imagePullPolicy: {{.Values.pullPolicy}}\n          ports:\n            - containerPort: 5432\n          env:\n            - name: DATABASE_STORAGE\n              value: {{default "minio" .Values.storage}}\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The above example, based loosely on ",(0,t.jsx)(n.a,{href:"https://github.com/deis/charts",children:"https://github.com/deis/charts"}),", is a template for a Kubernetes replication controller.\nIt can use the following four template values (usually defined in a\n",(0,t.jsx)(n.code,{children:"values.yaml"})," file):"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"imageRegistry"}),": The source registry for the Docker image."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"dockerTag"}),": The tag for the docker image."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"pullPolicy"}),": The Kubernetes pull policy."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"storage"}),": The storage backend, whose default is set to ",(0,t.jsx)(n.code,{children:'"minio"'})]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"All of these values are defined by the template author. Helm does not\nrequire or dictate parameters."}),"\n",(0,t.jsxs)(n.p,{children:["To see many working charts, check out the ",(0,t.jsx)(n.a,{href:"https://github.com/helm/charts",children:"Helm Charts\nproject"})]}),"\n",(0,t.jsx)(n.h3,{id:"predefined-values",children:"Predefined Values"}),"\n",(0,t.jsxs)(n.p,{children:["Values that are supplied via a ",(0,t.jsx)(n.code,{children:"values.yaml"})," file (or via the ",(0,t.jsx)(n.code,{children:"--set"}),"\nflag) are accessible from the ",(0,t.jsx)(n.code,{children:".Values"})," object in a template. But there\nare other pre-defined pieces of data you can access in your templates."]}),"\n",(0,t.jsxs)(n.p,{children:["The following values are pre-defined, are available to every template, and\ncannot be overridden. As with all values, the names are ",(0,t.jsx)(n.em,{children:"case\nsensitive"}),"."]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"Release.Name"}),": The name of the release (not the chart)"]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"Release.Time"}),": The time the chart release was last updated. This will\nmatch the ",(0,t.jsx)(n.code,{children:"Last Released"})," time on a Release object."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"Release.Namespace"}),": The namespace the chart was released to."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"Release.Service"}),": The service that conducted the release. Usually\nthis is ",(0,t.jsx)(n.code,{children:"Tiller"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"Release.IsUpgrade"}),": This is set to true if the current operation is an upgrade or rollback."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"Release.IsInstall"}),": This is set to true if the current operation is an\ninstall."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"Release.Revision"}),": The revision number. It begins at 1, and increments with\neach ",(0,t.jsx)(n.code,{children:"helm upgrade"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"Chart"}),": The contents of the ",(0,t.jsx)(n.code,{children:"Chart.yaml"}),". Thus, the chart version is\nobtainable as ",(0,t.jsx)(n.code,{children:"Chart.Version"})," and the maintainers are in\n",(0,t.jsx)(n.code,{children:"Chart.Maintainers"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"Files"}
1),": A map-like object containing all non-special files in the chart. This\nwill not give you access to templates, but will give you access to additional\nfiles that are present (unless they are excluded using ",(0,t.jsx)(n.code,{children:".helmignore"}),"). Files can be\naccessed using ",(0,t.jsx)(n.code,{children:'{{index .Files "file.name"}}'})," or using the ",(0,t.jsx)(n.code,{children:"{{.Files.Get name}}"})," or\n",(0,t.jsx)(n.code,{children:"{{.Files.GetString name}}"})," functions. You can also access the contents of the file\nas ",(0,t.jsx)(n.code,{children:"[]byte"})," using ",(0,t.jsx)(n.code,{children:"{{.Files.GetBytes}}"})]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"Capabilities"}),": A map-like object that contains information about the versions\nof Kubernetes (",(0,t.jsx)(n.code,{children:"{{.Capabilities.KubeVersion}}"}),", Tiller\n(",(0,t.jsx)(n.code,{children:"{{.Capabilities.TillerVersion}}"}),", and the supported Kubernetes API versions\n(",(0,t.jsx)(n.code,{children:'{{.Capabilities.APIVersions.Has "batch/v1"'}),")"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"NOTE:"})," Any unknown Chart.yaml fields will be dropped. They will not\nbe accessible inside of the ",(0,t.jsx)(n.code,{children:"Chart"})," object. Thus, Chart.yaml cannot be\nused to pass arbitrarily structured data into the template. The values\nfile can be used for that, though."]}),"\n",(0,t.jsx)(n.h3,{id:"values-files",children:"Values files"}),"\n",(0,t.jsxs)(n.p,{children:["Considering the template in the previous section, a ",(0,t.jsx)(n.code,{children:"values.yaml"})," file\nthat supplies the necessary values would look like this:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:'imageRegistry: "quay.io/deis"\ndockerTag: "latest"\npullPolicy: "Always"\nstorage: "s3"\n'})}),"\n",(0,t.jsxs)(n.p,{children:["A values file is formatted in YAML. A chart may include a default\n",(0,t.jsx)(n.code,{children:"values.yaml"})," file. The Helm install command allows a user to override\nvalues by supplying additional YAML values:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-console",children:"$ helm install --values=myvals.yaml wordpress\n"})}),"\n",(0,t.jsxs)(n.p,{children:["When values are passed in this way, they will be merged into the default\nvalues file. For example, consider a ",(0,t.jsx)(n.code,{children:"myvals.yaml"})," file that looks like\nthis:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:'storage: "gcs"\n'})}),"\n",(0,t.jsxs)(n.p,{children:["When this is merged with the ",(0,t.jsx)(n.code,{children:"values.yaml"})," in the chart, the resulting\ngenerated content will be:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:'imageRegistry: "quay.io/deis"\ndockerTag: "latest"\npullPolicy: "Always"\nstorage: "gcs"\n'})}),"\n",(0,t.jsx)(n.p,{children:"Note that only the last field was overridden."}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"NOTE:"})," The default values file included inside of a chart ",(0,t.jsx)(n.em,{children:"must"})," be named\n",(0,t.jsx)(n.code,{children:"values.yaml"}),". But files specified on the command line can be named\nanything."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"NOTE:"})," If the ",(0,t.jsx)(n.code,{children:"--set"})," flag is used on ",(0,t.jsx)(n.code,{children:"helm install"})," or ",(0,t.jsx)(n.code,{children:"helm upgrade"}),", those\nvalues are simply converted to YAML on the client side."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"NOTE:"})," If any required entries in the values file exist, they can be declared\nas required in the chart template by using the ",(0,t.jsx)(n.a,{href:"/docs/v2/developing_charts/charts_tips_and_tricks",children:"'required' function"})]}),"\n",(0,t.jsxs)(n.p,{children:["Any of these values are then accessible inside of templates using the\n",(0,t.jsx)(n.code,{children:".Values"})," object:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:'apiVersion: v1\nkind: ReplicationController\nmetadata:\n  name: deis-database\n  namespace: deis\n  labels:\n    app.kubernetes.io/managed-by: deis\nspec:\n  replicas: 1\n  selector:\n    app.kubernetes.io/name: deis-database\n  template:\n    metadata:\n      labels:\n        app.kubernetes.io/name: deis-database\n    spec:\n      serviceAccount: deis-database\n      containers:\n        - name: deis-database\n          image: {{.Values.imageRegistry}}/postgres:{{.Values.dockerTag}}\n          imagePullPolicy: {{.Values.pullPolicy}}\n          ports:\n            - containerPort: 5432\n          env:\n            - name: DATABASE_STORAGE\n              value: {{default "minio" .Values.storage}}\n\n'})}
1),"\n",(0,t.jsx)(n.h3,{id:"scope-dependencies-and-values",children:"Scope, Dependencies, and Values"}),"\n",(0,t.jsxs)(n.p,{children:["Values files can declare values for the top-level chart, as well as for\nany of the charts that are included in that chart's ",(0,t.jsx)(n.code,{children:"charts/"})," directory.\nOr, to phrase it differently, a values file can supply values to the\nchart as well as to any of its dependencies. For example, the\ndemonstration WordPress chart above has both ",(0,t.jsx)(n.code,{children:"mysql"})," and ",(0,t.jsx)(n.code,{children:"apache"})," as\ndependencies. The values file could supply values to all of these\ncomponents:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:'title: "My WordPress Site" # Sent to the WordPress template\n\nmysql:\n  max_connections: 100 # Sent to MySQL\n  password: "secret"\n\napache:\n  port: 8080 # Passed to Apache\n'})}),"\n",(0,t.jsxs)(n.p,{children:["Charts at a higher level have access to all of the variables defined\nbeneath. So the WordPress chart can access the MySQL password as\n",(0,t.jsx)(n.code,{children:".Values.mysql.password"}),". But lower level charts cannot access things in\nparent charts, so MySQL will not be able to access the ",(0,t.jsx)(n.code,{children:"title"})," property. Nor,\nfor that matter, can it access ",(0,t.jsx)(n.code,{children:"apache.port"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["Values are namespaced, but namespaces are pruned. So for the WordPress\nchart, it can access the MySQL password field as ",(0,t.jsx)(n.code,{children:".Values.mysql.password"}),". But\nfor the MySQL chart, the scope of the values has been reduced and the\nnamespace prefix removed, so it will see the password field simply as\n",(0,t.jsx)(n.code,{children:".Values.password"}),"."]}),"\n",(0,t.jsx)(n.h4,{id:"global-values",children:"Global Values"}),"\n",(0,t.jsx)(n.p,{children:'As of 2.0.0-Alpha.2, Helm supports special "global" value. Consider\nthis modified version of the previous example:'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:'title: "My WordPress Site" # Sent to the WordPress template\n\nglobal:\n  app: MyWordPress\n\nmysql:\n  max_connections: 100 # Sent to MySQL\n  password: "secret"\n\napache:\n  port: 8080 # Passed to Apache\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The above adds a ",(0,t.jsx)(n.code,{children:"global"})," section with the value ",(0,t.jsx)(n.code,{children:"app: MyWordPress"}),".\nThis value is available to ",(0,t.jsx)(n.em,{children:"all"})," charts as ",(0,t.jsx)(n.code,{children:".Values.global.app"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["For example, the ",(0,t.jsx)(n.code,{children:"mysql"})," templates may access ",(0,t.jsx)(n.code,{children:"app"})," as ",(0,t.jsx)(n.code,{children:"{{.Values.global.app}}"}),", and\nso can the ",(0,t.jsx)(n.code,{children:"apache"})," chart. Effectively, the values file above is\nregenerated like this:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:'title: "My WordPress Site" # Sent to the WordPress template\n\nglobal:\n  app: MyWordPress\n\nmysql:\n  global:\n    app: MyWordPress\n  max_connections: 100 # Sent to MySQL\n  password: "secret"\n\napache:\n  global:\n    app: MyWordPress\n  port: 8080 # Passed to Apache\n'})}),"\n",(0,t.jsxs)(n.p,{children:["This provides a way of sharing one top-level variable with all\nsubcharts, which is useful for things like setting ",(0,t.jsx)(n.code,{children:"metadata"})," properties\nlike labels."]}),"\n",(0,t.jsxs)(n.p,{children:["If a subchart declares a global variable, that global will be passed\n",(0,t.jsx)(n.em,{children:"downward"})," (to the subchart's subcharts), but not ",(0,t.jsx)(n.em,{children:"upward"})," to the parent\nchart. There is no way for a subchart to influence the values of the\nparent chart."]}),"\n",(0,t.jsx)(n.p,{children:"Also, global variables of parent charts take precedence over the global variables from subcharts."}),"\n",(0,t.jsx)(n.h3,{id:"references",children:"References"}),"\n",(0,t.jsx)(n.p,{children:"When it comes to writing templates and values files, there are several\nstandard references that will help you out."}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://godoc.org/text/template",children:"Go templates"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://godoc.org/github.com/Masterminds/sprig",children:"Extra template functions"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.a,{href:"https://yaml.org/spec/",children:"The YAML format"})}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"using-helm-to-manage-charts",children:"Using Helm to Manage Charts"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"helm"})," tool has several commands for working with charts."]}),"\n",(0,t.jsx)(n.p,{children:"It can create a new chart for you:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-console",children:"$ helm create mychart\nCreated mychart/\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Once you have edited a chart, ",(0,t.jsx)(n.code,{children:"helm"})," can package it into a chart archive\nfor you:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-console",children:"$ helm package mychart\nArchived mychart-0.1.-.tgz\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can also use ",(0,t.jsx)(n.code,{children:"helm"}
1)," to help you find issues with your chart's\nformatting or information:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-console",children:"$ helm lint mychart\nNo issues found\n"})}),"\n",(0,t.jsx)(n.h2,{id:"chart-repositories",children:"Chart Repositories"}),"\n",(0,t.jsxs)(n.p,{children:["A ",(0,t.jsx)(n.em,{children:"chart repository"})," is an HTTP server that houses one or more packaged\ncharts. While ",(0,t.jsx)(n.code,{children:"helm"})," can be used to manage local chart directories, when\nit comes to sharing charts, the preferred mechanism is a chart\nrepository."]}),"\n",(0,t.jsx)(n.p,{children:"Any HTTP server that can serve YAML files and tar files and can answer\nGET requests can be used as a repository server."}),"\n",(0,t.jsxs)(n.p,{children:["Helm comes with built-in package server for developer testing (",(0,t.jsx)(n.code,{children:"helm serve"}),"). The Helm team has tested other servers, including Google Cloud\nStorage with website mode enabled, and S3 with website mode enabled."]}),"\n",(0,t.jsxs)(n.p,{children:["A repository is characterized primarily by the presence of a special\nfile called ",(0,t.jsx)(n.code,{children:"index.yaml"})," that has a list of all of the packages supplied\nby the repository, together with metadata that allows retrieving and\nverifying those packages."]}),"\n",(0,t.jsxs)(n.p,{children:["On the client side, repositories are managed with the ",(0,t.jsx)(n.code,{children:"helm repo"}),"\ncommands. However, Helm does not provide tools for uploading charts to\nremote repository servers. This is because doing so would add\nsubstantial requirements to an implementing server, and thus raise the\nbarrier for setting up a repository."]}),"\n",(0,t.jsx)(n.h2,{id:"chart-starter-packs",children:"Chart Starter Packs"}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"helm create"})," command takes an optional ",(0,t.jsx)(n.code,{children:"--starter"}),' option that lets you\nspecify a "starter chart".']}),"\n",(0,t.jsxs)(n.p,{children:["Starters are just regular charts, but are located in ",(0,t.jsx)(n.code,{children:"$HELM_HOME/starters"}),".\nAs a chart developer, you may author charts that are specifically designed\nto be used as starters. Such charts should be designed with the following\nconsiderations in mind:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.code,{children:"Chart.yaml"})," will be overwritten by the generator."]}),"\n",(0,t.jsx)(n.li,{children:"Users will expect to modify such a chart's contents, so documentation\nshould indicate how users can do so."}),"\n",(0,t.jsxs)(n.li,{children:["All occurrences of ",(0,t.jsx)(n.code,{children:"<CHARTNAME>"})," in files within the ",(0,t.jsx)(n.code,{children:"templates"})," directory\nwill be replaced with the specified chart name so that starter charts can be\nused as templates. Additionally, occurrences of ",(0,t.jsx)(n.code,{children:"<CHARTNAME>"})," in\n",(0,t.jsx)(n.code,{children:"values.yaml"})," will also be replaced."]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["Currently the only way to add a chart to ",(0,t.jsx)(n.code,{children:"$HELM_HOME/starters"})," is to manually\ncopy it there. In your chart's documentation, you may want to explain that\nprocess."]})]})}function h(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},28453(e,n,s){s.d(n,{R:()=>r,x:()=>l});var a=s(96540);let t={},i=a.createContext(t);function r(e){let n=a.useContext(i);return a.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),a.createElement(i.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.