{"id":299676,"date":"2020-03-04T21:00:12","date_gmt":"2020-03-04T21:00:12","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=299676"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=299676","title":{"rendered":"\u041e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u043f\u043b\u043e\u044f \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e k8s \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e helmfile"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/491108\/\">\n<p><a href=\"https:\/\/github.com\/roboll\/helmfile\" rel=\"nofollow\">Helmfile<\/a> \u2014 \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/helm\/helm\/\" rel=\"nofollow\">helm<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e helm \u0440\u0435\u043b\u0438\u0437\u043e\u0432, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0447\u0430\u0440\u0442\u044b \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u0445 \u0434\u0435\u043f\u043b\u043e\u044f.<\/p>\n<p>  <\/p>\n<p>\u041e \u0441\u0430\u043c\u043e\u043c helmfile \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/roboll\/helmfile\/blob\/master\/README.md\" rel=\"nofollow\">readme<\/a> \u0438 <a href=\"https:\/\/github.com\/roboll\/helmfile\/blob\/master\/docs\/writing-helmfile.md\" rel=\"nofollow\">best practices guide<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0436\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u043b\u0438\u0437\u044b \u0432 helmfile<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0430\u0447\u043a\u0430 helm-\u0447\u0430\u0440\u0442\u043e\u0432 (\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 postgres \u0438 \u043d\u0435\u043a\u043e\u0435 backend \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435) \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 (\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e kubernetes \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e namespace&#8217;\u043e\u0432 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438 \u0442\u043e\u0433\u043e, \u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e). \u0411\u0435\u0440\u0451\u043c helmfile, \u0447\u0438\u0442\u0430\u0435\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0440\u0435\u043b\u0438\u0437\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">    .     \u251c\u2500\u2500 envs     \u2502\u00a0\u00a0 \u251c\u2500\u2500 devel     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 values     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u2514\u2500\u2500 postgres.yaml     \u2502\u00a0\u00a0 \u2514\u2500\u2500 production     \u2502\u00a0\u00a0     \u2514\u2500\u2500 values     \u2502\u00a0\u00a0         \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0         \u2514\u2500\u2500 postgres.yaml     \u2514\u2500\u2500 helmfile.yaml<\/code><\/pre>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h4 id=\"helmfileyaml\"><strong><code>helmfile.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">environments:   devel:   production:  releases:   - name: postgres     labels:       app: postgres     wait: true     chart: stable\/postgresql     version: 8.4.0     values:       - envs\/{{ .Environment.Name }}\/values\/postgres.yaml   - name: backend     labels:       app: backend     wait: true     chart: private-helm-repo\/backend     version: 1.0.5     needs:       - postgres     values:       - envs\/{{ .Environment.Name }}\/values\/backend.yaml<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c 2 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f: <strong>devel<\/strong>, <strong>production<\/strong> \u2014 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f helm \u0447\u0430\u0440\u0442\u043e\u0432 \u0440\u0435\u043b\u0438\u0437\u043e\u0432. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0432 \u043d\u0438\u0445 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">helmfile -n &lt;namespace&gt; -e &lt;env&gt; apply<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"raznye-versii-helm-chartov-v-raznyh-okruzheniyah\">\u0420\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 helm \u0447\u0430\u0440\u0442\u043e\u0432 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445<\/h2>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f? \u041a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0440\u0435\u043b\u0438\u0437\u0430? \u041d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 <code>{{ .Values }}<\/code><\/p>\n<p>  <\/p>\n<h4 id=\"helmfileyaml-1\"><strong><code>helmfile.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"diff\">environments:   devel: +   values: +   - charts: +       versions: +         backend: 1.1.0   production: +   values: +   - charts: +       versions: +         backend: 1.0.5 ...   - name: backend     labels:       app: backend     wait: true     chart: private-helm-repo\/backend -   version: 1.0.5 +   version: {{ .Values.charts.versions.backend }} ...<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"raznyy-nabor-prilozheniy-v-raznyh-okruzheniyah\">\u0420\u0430\u0437\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u0445<\/h2>\n<p>  <\/p>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0435 \u043d\u0430\u0434\u043e \u0432 <code>production<\/code> \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c postgres, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0435 \u043d\u0430\u0434\u043e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0438\u0445\u0430\u0442\u044c \u0432 k8s \u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 postgres? \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043b\u0435\u0439\u0431\u043b\u044b (labels)<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">helmfile -n &lt;namespace&gt; -e devel apply helmfile -n &lt;namespace&gt; -e production -l app=backend apply<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u043d\u043e \u043b\u0438\u0447\u043d\u043e \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0432 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u043d\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0430 \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0441\u0430\u043c\u0438\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c? \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443, \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0435\u0441\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0443\u0436\u043d\u044b\u0445 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u0438 &quot;\u043f\u043e\u0434\u0446\u0435\u043f\u043b\u044f\u0442\u044c&quot; \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u0440\u0435\u043b\u0438\u0437\u044b, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"diff\">    .     \u251c\u2500\u2500 envs     \u2502\u00a0\u00a0 \u251c\u2500\u2500 devel     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 values     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u2514\u2500\u2500 postgres.yaml     \u2502\u00a0\u00a0 \u2514\u2500\u2500 production     \u2502\u00a0\u00a0     \u2514\u2500\u2500 values     \u2502\u00a0\u00a0         \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0         \u2514\u2500\u2500 postgres.yaml +   \u251c\u2500\u2500 releases +   \u2502\u00a0\u00a0 \u251c\u2500\u2500 backend.yaml +   \u2502\u00a0\u00a0 \u2514\u2500\u2500 postgres.yaml     \u2514\u2500\u2500 helmfile.yaml <\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"helmfileyaml-2\"><strong><code>helmfile.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"diff\">   environments:     devel:       values:       - charts:           versions:             backend: 1.1.0       - apps:         - postgres         - backend      production:       values:       - charts:           versions:             backend: 1.0.5       - apps:         - backend  - releases: -    - name: postgres -      labels: -        app: postgres -      wait: true -      chart: stable\/postgresql -      version: 8.4.0 -      values: -        - envs\/{{ .Environment.Name }}\/values\/postgres.yaml -    - name: backend -      labels: -        app: backend -      wait: true -      chart: private-helm-repo\/backend -     version: {{ .Values.charts.versions.backend }} -     needs: -       - postgres -     values: -       - envs\/{{ .Environment.Name }}\/values\/backend.yaml + --- + bases: + {{- range .Values.apps }} +   - releases\/{{ . }}.yaml + {{- end }}<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"releasespostgresyaml\"><strong><code>releases\/postgres.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">releases:   - name: postgres     labels:       app: postgres     wait: true     chart: stable\/postgresql     version: 8.4.0     values:       - envs\/{{ .Environment.Name }}\/values\/postgres.yaml<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"releasesbackendyaml\"><strong><code>releases\/backend.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">releases:   - name: backend     labels:       app: backend     wait: true     chart: private-helm-repo\/backend     version: {{ .Values.charts.versions.backend }}     needs:       - postgres     values:       - envs\/{{ .Environment.Name }}\/values\/backend.yaml<\/code><\/pre>\n<p>  <\/p>\n<hr>\n<p>  <\/p>\n<p><strong>\u0417\u0430\u043c\u0435\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>bases:<\/code> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c yaml \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c <code>---<\/code>, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c releases (\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438, \u0442\u0438\u043f\u0430 helmDefaults) \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0438\u0437 environments<\/p>\n<p>  <\/p>\n<hr>\n<p>  <\/p>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u043b\u0438\u0437 postgres \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u043b\u044f production. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e!<\/p>\n<p>  <\/p>\n<h2 id=\"pereopredelyaemye-globalnye-znacheniya-dlya-relizov\">\u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0435\u043b\u0438\u0437\u043e\u0432<\/h2>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f helm \u0447\u0430\u0440\u0442\u043e\u0432, \u043d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439, \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 <code>affinity<\/code>, \u043d\u043e \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u0441\u0430\u043c\u0438\u0445 \u0447\u0430\u0440\u0442\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0440\u0435\u043f\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430 \u0437\u0430\u0434\u0430\u0442\u044c 2 \u0444\u0430\u0439\u043b\u0430 \u0441 values: \u043f\u0435\u0440\u0432\u044b\u0439 \u0441 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u0447\u0430\u0440\u0442\u0430, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"diff\">    .     \u251c\u2500\u2500 envs +   \u2502\u00a0\u00a0 \u251c\u2500\u2500 default +   \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 values +   \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u251c\u2500\u2500 backend.yaml +   \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u2514\u2500\u2500 postgres.yaml     \u2502\u00a0\u00a0 \u251c\u2500\u2500 devel     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 values     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u2514\u2500\u2500 postgres.yaml     \u2502\u00a0\u00a0 \u2514\u2500\u2500 production     \u2502\u00a0\u00a0     \u2514\u2500\u2500 values     \u2502\u00a0\u00a0         \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0         \u2514\u2500\u2500 postgres.yaml     \u251c\u2500\u2500 releases     \u2502\u00a0\u00a0 \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0 \u2514\u2500\u2500 postgres.yaml     \u2514\u2500\u2500 helmfile.yaml<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"releasesbackendyaml-1\"><strong><code>releases\/backend.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"diff\">releases:   - name: backend     labels:       app: backend     wait: true     chart: private-helm-repo\/backend     version: {{ .Values.charts.versions.backend }}     needs:       - postgres     values: +     - envs\/default\/values\/backend.yaml       - envs\/{{ .Environment.Name }}\/values\/backend.yaml<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"envsdefaultvaluesbackendyaml\"><strong><code>envs\/default\/values\/backend.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">affinity:   podAntiAffinity:     preferredDuringSchedulingIgnoredDuringExecution:     - weight: 1       podAffinityTerm:         labelSelector:           matchExpressions:           - key: app.kubernetes.io\/name             operator: In             values:             - backend         topologyKey: &quot;kubernetes.io\/hostname&quot;<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"opredelenie-globalnyh-znacheniy-dlya-helm-chartov-vseh-relizov-na-urovne-okruzheniya\">\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f helm \u0447\u0430\u0440\u0442\u043e\u0432 \u0432\u0441\u0435\u0445 \u0440\u0435\u043b\u0438\u0437\u043e\u0432 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0440\u0435\u043b\u0438\u0437\u0430\u0445 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e ingress \u2014 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0447\u0430\u0440\u0442\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c <code>hosts:<\/code>, \u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u043c\u0435\u043d \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435, \u0442\u0430\u043a \u043f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043d\u0435\u043a\u0443\u044e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0451 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0447\u0430\u0440\u0442\u044b? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0435 \u0444\u0430\u0439\u043b\u044b \u0441 values, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <code>.gotmpl<\/code>, \u0447\u0442\u043e\u0431\u044b helmfile \u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440.<\/p>\n<p>  <\/p>\n<pre><code class=\"diff\">    .     \u251c\u2500\u2500 envs     \u2502\u00a0\u00a0 \u251c\u2500\u2500 default     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 values -   \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u251c\u2500\u2500 backend.yaml -   \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u251c\u2500\u2500 postgres.yaml +   \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u251c\u2500\u2500 backend.yaml.gotmpl +   \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u2514\u2500\u2500 postgres.yaml.gotmpl     \u2502\u00a0\u00a0 \u251c\u2500\u2500 devel     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 values     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u2514\u2500\u2500 postgres.yaml     \u2502\u00a0\u00a0 \u2514\u2500\u2500 production     \u2502\u00a0\u00a0     \u2514\u2500\u2500 values     \u2502\u00a0\u00a0         \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0         \u2514\u2500\u2500 postgres.yaml     \u251c\u2500\u2500 releases     \u2502\u00a0\u00a0 \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0 \u2514\u2500\u2500 postgres.yaml     \u2514\u2500\u2500 helmfile.yaml<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"helmfileyaml-3\"><strong><code>helmfile.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"diff\">  environments:     devel:       values:       - charts:           versions:             backend: 1.1.0       - apps:         - postgres         - backend +     - global: +         ingressDomain: k8s.devel.domain      production:       values:       - charts:           versions:             backend: 1.0.5       - apps:         - backend +     - global: +         ingressDomain: production.domain   ---   bases:   {{- range .Values.apps }}     - releases\/{{ . }}.yaml   {{- end }}<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"envsdefaultvaluesbackendyamlgotmpl\"><strong><code>envs\/default\/values\/backend.yaml.gotmpl<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">ingress:   enabled: true   paths:     - \/api   hosts:     - {{ .Values.global.ingressDomain }}<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"envsdefaultvaluespostgresyamlgotmpl\"><strong><code>envs\/default\/values\/postgres.yaml.gotmpl<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">ingress:   enabled: true   paths:     - \/   hosts:     - postgres.{{ .Values.global.ingressDomain }}<\/code><\/pre>\n<p>  <\/p>\n<hr>\n<p>  <\/p>\n<p><strong>\u0417\u0430\u043c\u0435\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e ingress \u0432 \u0447\u0430\u0440\u0442\u0435 postgres \u2014 \u044d\u0442\u043e \u043d\u0435\u0447\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0444\u0435\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432 \u0432\u0430\u043a\u0443\u0443\u043c\u0435 \u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0441\u0442\u0430\u0442\u044c\u044e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u043b\u0438\u0437 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0434\u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f ingress<\/p>\n<p>  <\/p>\n<hr>\n<p>  <\/p>\n<h2 id=\"podstanovka-sekretov-secrets-iz-znacheniy-okruzheniya\">\u041f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0435\u043a\u0440\u0435\u0442\u043e\u0432 (secrets) \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/github.com\/futuresimple\/helm-secrets\" rel=\"nofollow\">helm secrets<\/a> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0444\u0430\u0439\u043b secrets, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0434\u043b\u044f \u0447\u0430\u0440\u0442\u0430 \u0437\u0430\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u043c default.yaml.gotmpl \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439. \u0410 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0430\u0434\u043e \u043d\u0438 \u043e\u0442 \u043a\u043e\u0433\u043e \u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0440\u0435\u043b\u0438\u0437\u0430 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"diff\">    .     \u251c\u2500\u2500 envs     \u2502\u00a0\u00a0 \u251c\u2500\u2500 default     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 values     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u2514\u2500\u2500 postgres.yaml     \u2502\u00a0\u00a0 \u251c\u2500\u2500 devel     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 values     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 postgres.yaml +   \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 secrets.yaml     \u2502\u00a0\u00a0 \u2514\u2500\u2500 production     \u2502\u00a0\u00a0     \u251c\u2500\u2500 values     \u2502\u00a0\u00a0     \u2502\u00a0\u00a0 \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0     \u2502\u00a0\u00a0 \u2514\u2500\u2500 postgres.yaml +   \u2502\u00a0\u00a0     \u2514\u2500\u2500 secrets.yaml     \u251c\u2500\u2500 releases     \u2502\u00a0\u00a0 \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0 \u2514\u2500\u2500 postgres.yaml     \u2514\u2500\u2500 helmfile.yaml<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"helmfileyaml-4\"><strong><code>helmfile.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"diff\">  environments:     devel:       values:       - charts:           versions:             backend: 1.1.0       - apps:         - postgres         - backend       - global:           ingressDomain: k8s.devel.domain +     secrets: +       - envs\/devel\/secrets.yaml      production:       values:       - charts:           versions:             backend: 1.0.5       - apps:         - backend       - global:           ingressDomain: production.domain +     secrets: +       - envs\/production\/secrets.yaml   ---   bases:   {{- range .Values.apps }}     - releases\/{{ . }}.yaml   {{- end }}<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"envsdevelsecretsyaml\"><strong><code>envs\/devel\/secrets.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">secrets:     elastic:         password: ENC[AES256_GCM,data:hjCB,iv:Z1P6\/6xBJgJoKLJ0UUVfqZ80o4L84jvZfM+uH9gBelc=,tag:dGqQlCZnLdRAGoJSj63rBQ==,type:int] ...<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"envsproductionsecretsyaml\"><strong><code>envs\/production\/secrets.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">secrets:     elastic:         password: ENC[AES256_GCM,data:ZB\/VpTFk8f0=,iv:EA\/\/oT1Cb5wNFigTDOz3nA80qD9UwTjK5cpUwLnEXjs=,tag:hMdIUaqLRA8zuFBd82bz6A==,type:str] ...<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"envsdefaultvaluesbackendyamlgotmpl-1\"><strong><code>envs\/default\/values\/backend.yaml.gotmpl<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">elasticsearch:   host: elasticsearch   port: 9200   password: {{ .Values | getOrNil &quot;secrets.elastic.password&quot; | default &quot;password&quot; }}<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"envsdevelvaluesbackendyaml\"><strong><code>envs\/devel\/values\/backend.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">elasticsearch:   host: elastic-0.devel.domain<\/code><\/pre>\n<p>  <\/p>\n<h4 id=\"envsproductionvaluesbackendyaml\"><strong><code>envs\/production\/values\/backend.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">elasticsearch:   host: elastic-0.production.domain<\/code><\/pre>\n<p>  <\/p>\n<hr>\n<p>  <\/p>\n<p><strong>\u0417\u0430\u043c\u0435\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, <code>getOrNil<\/code> \u2014 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f go \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0432 helmfile, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 <code>.Values.secrets<\/code> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043d\u0435 \u0432\u044b\u043a\u0438\u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443, \u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>default<\/code> \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<p>  <\/p>\n<hr>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0449\u0438 \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c\u0438, \u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u0443\u0434\u043e\u0431\u043d\u043e\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0434\u0435\u043f\u043b\u043e\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e helmfile \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u0443\u0434\u043d\u0430, \u0430 \u044f \u043b\u044e\u0431\u043b\u044e IaC(Infrastructure-as-Code) \u0438 \u0445\u043e\u0447\u0443 \u0438\u043c\u0435\u0442\u044c \u0447\u0451\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0435\u0439\u0442\u0430 \u0434\u0435\u043f\u043b\u043e\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0445\u043e\u0447\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f default \u043c\u043e\u0436\u043d\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u041e\u0421 \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u0440\u0430\u043d\u043d\u0435\u0440\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0434\u0435\u043f\u043b\u043e\u0439, \u0438 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f<\/p>\n<p>  <\/p>\n<h4 id=\"helmfileyaml-5\"><strong><code>helmfile.yaml<\/code><\/strong><\/h4>\n<p>  <\/p>\n<pre><code class=\"plaintext\">environments:   default:     values:     - global:         clusterDomain: {{ env &quot;CLUSTER_DOMAIN&quot; | default &quot;cluster.local&quot; }}         ingressDomain: {{ env &quot;INGRESS_DOMAIN&quot; }}<\/code><\/pre>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/491108\/\"> https:\/\/habr.com\/ru\/post\/491108\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/491108\/\">\n<p><a href=\"https:\/\/github.com\/roboll\/helmfile\" rel=\"nofollow\">Helmfile<\/a> \u2014 \u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/helm\/helm\/\" rel=\"nofollow\">helm<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e helm \u0440\u0435\u043b\u0438\u0437\u043e\u0432, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0447\u0430\u0440\u0442\u044b \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u0445 \u0434\u0435\u043f\u043b\u043e\u044f.<\/p>\n<p>  <\/p>\n<p>\u041e \u0441\u0430\u043c\u043e\u043c helmfile \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/roboll\/helmfile\/blob\/master\/README.md\" rel=\"nofollow\">readme<\/a> \u0438 <a href=\"https:\/\/github.com\/roboll\/helmfile\/blob\/master\/docs\/writing-helmfile.md\" rel=\"nofollow\">best practices guide<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0436\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u043b\u0438\u0437\u044b \u0432 helmfile<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0430\u0447\u043a\u0430 helm-\u0447\u0430\u0440\u0442\u043e\u0432 (\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 postgres \u0438 \u043d\u0435\u043a\u043e\u0435 backend \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435) \u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 (\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e kubernetes \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e namespace&#8217;\u043e\u0432 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438 \u0442\u043e\u0433\u043e, \u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e). \u0411\u0435\u0440\u0451\u043c helmfile, \u0447\u0438\u0442\u0430\u0435\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0440\u0435\u043b\u0438\u0437\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">    .     \u251c\u2500\u2500 envs     \u2502\u00a0\u00a0 \u251c\u2500\u2500 devel     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 values     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u2514\u2500\u2500 postgres.yaml     \u2502\u00a0\u00a0 \u2514\u2500\u2500 production     \u2502\u00a0\u00a0     \u2514\u2500\u2500 values     \u2502\u00a0\u00a0         \u251c\u2500\u2500 backend.yaml     \u2502\u00a0\u00a0         \u2514\u2500\u2500 postgres.yaml     \u2514\u2500\u2500 helmfile.yaml<\/code><\/pre>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-299676","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=299676"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299676\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}