{"id":417292,"date":"2024-06-30T01:28:42","date_gmt":"2024-06-30T01:28:42","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=417292"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-30T01:28:42","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=417292","title":{"rendered":"<span>\u041a\u0430\u043a \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c helm \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c?<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Helm \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <a href=\"https:\/\/pkg.go.dev\/text\/template\" rel=\"noopener noreferrer nofollow\">go templates<\/a> \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u0432.  \u0415\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f helm. \u041d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u0432\u043e\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"http:\/\/masterminds.github.io\/sprig\/\" rel=\"noopener noreferrer nofollow\">Sprig<\/a>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/e9c\/8e7\/e28\/e9c8e7e28cdf05808d18569bdd853e05.jpg\" width=\"1280\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e9c\/8e7\/e28\/e9c8e7e28cdf05808d18569bdd853e05.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043c\u0430\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u0438\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0432\u043e\u0438\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c?<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440 <code>gomplate<\/code>. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u043e\u0439. \u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435.<\/p>\n<p><code>gomplate<\/code>  \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u0441\u0435\u0442\u044c\u044e, \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0435\u0439 \u0438 \u0442.\u0434. <\/p>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u043a\u0438\u043b\u043b\u0435\u0440-\u0444\u0438\u0447\u0435\u0439 \u2013 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432: \u0444\u0430\u0439\u043b\u044b, https, git, ssh, AWS EC2 metadata, AWS Secret Manager, <a href=\"https:\/\/pkg.go.dev\/go.etcd.io\/bbolt\" rel=\"noopener noreferrer nofollow\">BoltDB<\/a>, <a href=\"https:\/\/www.consul.io\/\" rel=\"noopener noreferrer nofollow\">Hashicorp Consul<\/a> \u0438 <a href=\"https:\/\/www.vaultproject.io\/\" rel=\"noopener noreferrer nofollow\">Hashicorp Vault<\/a>. <\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <code>helm<\/code> \u0438 <code>gomplate<\/code> , \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0435\u0449\u0435 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b.<\/p>\n<pre><code>$ brew install helm $ brew install gomplate<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c: <a href=\"https:\/\/github.com\/hairyhenderson\/gomplate\" rel=\"noopener noreferrer nofollow\">gomplate<\/a> \u0438 helm \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438-\u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438 <code>{{<\/code> \u0438 <code>}}<\/code> \u0434\u043b\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0445 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u043e \u044d\u0442\u043e \u043d\u0438 \u043a \u0447\u0435\u043c\u0443 \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043d\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442. \u0411\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043d\u0435\u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u043a\u0430\u0432\u044b\u0447\u0435\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0449\u0435  \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c  \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0434\u043b\u044f <code>gomplate<\/code>. <\/p>\n<pre><code>export GOMPLATE_LEFT_DELIM=\"[[\" export GOMPLATE_RIGHT_DELIM=\"]]\"<\/code><\/pre>\n<p><strong>\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c:<\/strong><\/p>\n<pre><code>echo 'Hello, [[ .Env.USER ]]' | gomplate Hello, zhilyaev<\/code><\/pre>\n<h3>\u0421\u043e\u0437\u0434\u0430\u0435\u043c helm chart<\/h3>\n<pre><code class=\"yaml\"># [[ defineDatasource \"foo\" \"https:\/\/httpbin.org\/get\" ]]   # [[ if not (datasourceReachable \"foo\")]] unreachable [[end]] # [[ $d := ds \"foo\" ]]   apiVersion: v1   kind: ConfigMap   metadata:     name: {{ include \"this.fullname\" . }}     labels: {{ include \"this.labels\" . | nindent 4 }}   data:     random: \"[[ random.AlphaNum 32 ]]\"     host: \"[[ $d.headers.Host ]]\" <\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. Helm \u0438\u043c\u0435\u0435\u0442 \u0444\u043b\u0430\u0436\u043e\u043a <code>--post-renderer<\/code> \u0435\u0433\u043e \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u0436\u0430\u0434\u043d\u043e \u0430\u0431\u0443\u0437\u0438\u0442\u044c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/719\/1f1\/2d5\/7191f12d53cfa88e6b639d0f5ba9fa76.png\" alt=\"\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b\" title=\"\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b\" width=\"1152\" height=\"452\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/719\/1f1\/2d5\/7191f12d53cfa88e6b639d0f5ba9fa76.png\"\/><figcaption>\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b<\/figcaption><\/figure>\n<p><strong>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/strong><\/p>\n<p>helm template this chart &#8212;post-renderer gomplate<\/p>\n<pre><code># Source: this\/templates\/configmap.yaml # #  #  apiVersion: v1 kind: ConfigMap metadata:   name: this   labels:     helm.sh\/chart: this-0.1.0     app.kubernetes.io\/name: this     app.kubernetes.io\/instance: this     app.kubernetes.io\/version: \"1.16.0\"     app.kubernetes.io\/managed-by: Helm data:   random: \"2tJyK9xSsg1gvEmunEokQf4lyGkvojiQ\"   host: \"httpbin.org\" <\/code><\/pre>\n<p><strong>\u0414\u0435\u043f\u043b\u043e\u0438\u043c:<\/strong><\/p>\n<pre><code>helm upgrade --install this chart --post-renderer gomplate<\/code><\/pre>\n<p><strong>Profit<\/strong><\/p>\n<h3>\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/h3>\n<p>\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 <code>--post-renderer<\/code> \u0432\u043d\u043e\u0441\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. C\u043b\u0435\u0434\u0443\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c KISS, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 <a href=\"https:\/\/github.com\/helmwave\/helmwave\" rel=\"noopener noreferrer nofollow\">helmwave<\/a>. \u0412 \u043d\u0435\u043c \u043c\u044b \u0440\u0435\u0448\u0430\u0435\u043c \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b  \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 helm, \u043d\u0435 \u0432\u043c\u0435\u0448\u0438\u0432\u0430\u044f\u0441\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0447\u0430\u0440\u0442\u043e\u0432.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/582578\/\"> https:\/\/habr.com\/ru\/articles\/582578\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Helm \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <a href=\"https:\/\/pkg.go.dev\/text\/template\" rel=\"noopener noreferrer nofollow\">go templates<\/a> \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u0432.  \u0415\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f helm. \u041d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u0432\u043e\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"http:\/\/masterminds.github.io\/sprig\/\" rel=\"noopener noreferrer nofollow\">Sprig<\/a>.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043c\u0430\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u0438\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0432\u043e\u0438\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c?<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440 <code>gomplate<\/code>. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u0448\u0430\u0435\u0442 \u0432\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u043e\u0439. \u041f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435.<\/p>\n<p><code>gomplate<\/code>  \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u0441\u0435\u0442\u044c\u044e, \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0435\u0439 \u0438 \u0442.\u0434. <\/p>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u043a\u0438\u043b\u043b\u0435\u0440-\u0444\u0438\u0447\u0435\u0439 \u2013 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432: \u0444\u0430\u0439\u043b\u044b, https, git, ssh, AWS EC2 metadata, AWS Secret Manager, <a href=\"https:\/\/pkg.go.dev\/go.etcd.io\/bbolt\" rel=\"noopener noreferrer nofollow\">BoltDB<\/a>, <a href=\"https:\/\/www.consul.io\/\" rel=\"noopener noreferrer nofollow\">Hashicorp Consul<\/a> \u0438 <a href=\"https:\/\/www.vaultproject.io\/\" rel=\"noopener noreferrer nofollow\">Hashicorp Vault<\/a>. <\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <code>helm<\/code> \u0438 <code>gomplate<\/code> , \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0435\u0449\u0435 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b.<\/p>\n<pre><code>$ brew install helm $ brew install gomplate<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c: <a href=\"https:\/\/github.com\/hairyhenderson\/gomplate\" rel=\"noopener noreferrer nofollow\">gomplate<\/a> \u0438 helm \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438-\u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438 <code>{{<\/code> \u0438 <code>}}<\/code> \u0434\u043b\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0445 \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u041d\u043e \u044d\u0442\u043e \u043d\u0438 \u043a \u0447\u0435\u043c\u0443 \u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043d\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442. \u0411\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043d\u0435\u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u043a\u0430\u0432\u044b\u0447\u0435\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0449\u0435  \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c  \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0434\u043b\u044f <code>gomplate<\/code>. <\/p>\n<pre><code>export GOMPLATE_LEFT_DELIM=\"[[\" export GOMPLATE_RIGHT_DELIM=\"]]\"<\/code><\/pre>\n<p><strong>\u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c:<\/strong><\/p>\n<pre><code>echo 'Hello, [[ .Env.USER ]]' | gomplate Hello, zhilyaev<\/code><\/pre>\n<h3>\u0421\u043e\u0437\u0434\u0430\u0435\u043c helm chart<\/h3>\n<pre><code class=\"yaml\"># [[ defineDatasource \"foo\" \"https:\/\/httpbin.org\/get\" ]]   # [[ if not (datasourceReachable \"foo\")]] unreachable [[end]] # [[ $d := ds \"foo\" ]]   apiVersion: v1   kind: ConfigMap   metadata:     name: {{ include \"this.fullname\" . }}     labels: {{ include \"this.labels\" . | nindent 4 }}   data:     random: \"[[ random.AlphaNum 32 ]]\"     host: \"[[ $d.headers.Host ]]\" <\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. Helm \u0438\u043c\u0435\u0435\u0442 \u0444\u043b\u0430\u0436\u043e\u043a <code>--post-renderer<\/code> \u0435\u0433\u043e \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u0436\u0430\u0434\u043d\u043e \u0430\u0431\u0443\u0437\u0438\u0442\u044c.<\/p>\n<figure class=\"full-width\"><figcaption>\u0414\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b<\/figcaption><\/figure>\n<p><strong>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/strong><\/p>\n<p>helm template this chart &#8212;post-renderer gomplate<\/p>\n<pre><code># Source: this\/templates\/configmap.yaml # #  #  apiVersion: v1 kind: ConfigMap metadata:   name: this   labels:     helm.sh\/chart: this-0.1.0     app.kubernetes.io\/name: this     app.kubernetes.io\/instance: this     app.kubernetes.io\/version: \"1.16.0\"     app.kubernetes.io\/managed-by: Helm data:   random: \"2tJyK9xSsg1gvEmunEokQf4lyGkvojiQ\"   host: \"httpbin.org\" <\/code><\/pre>\n<p><strong>\u0414\u0435\u043f\u043b\u043e\u0438\u043c:<\/strong><\/p>\n<pre><code>helm upgrade --install this chart --post-renderer gomplate<\/code><\/pre>\n<p><strong>Profit<\/strong><\/p>\n<h3>\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/h3>\n<p>\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 <code>--post-renderer<\/code> \u0432\u043d\u043e\u0441\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. C\u043b\u0435\u0434\u0443\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c KISS, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 <a href=\"https:\/\/github.com\/helmwave\/helmwave\" rel=\"noopener noreferrer nofollow\">helmwave<\/a>. \u0412 \u043d\u0435\u043c \u043c\u044b \u0440\u0435\u0448\u0430\u0435\u043c \u043f\u043e\u0432\u0441\u0435\u0434\u043d\u0435\u0432\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b  \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 helm, \u043d\u0435 \u0432\u043c\u0435\u0448\u0438\u0432\u0430\u044f\u0441\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0447\u0430\u0440\u0442\u043e\u0432.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/582578\/\"> https:\/\/habr.com\/ru\/articles\/582578\/<\/a><br \/><\/br><\/br><\/p>\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-417292","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/417292","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=417292"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/417292\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=417292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=417292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=417292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}