Commit Graph

316 Commits

Author SHA1 Message Date
Yusuke Kuoka b910591e1d
Add support for Kustomize Transformers (#1592)
Please see the updated `advanced-features.md` for more details.

This is often used for adding common labels and annotations to any resources rendered from a Helm chart.
2020-11-19 09:33:05 +09:00
Wi1dcard 4e485219d7
Fix the logic of helmfile deps and add tests. (#1588) 2020-11-19 09:29:59 +09:00
Yusuke Kuoka 88884b68dc
feat: `helmfile template --skip-cleanup` (#1570)
* feat: `helmfile template --skip-cleanup`

Resolves #1517
2020-11-06 09:23:49 +09:00
Yusuke Kuoka 5a15b65b94
feat: Add `helmfile apply --skip-cleanup` (#1571)
This deprecates the old `--retain-values` which was not working as intended.

Also see #1570 - there's now `--skip-cleanup` for `helmfile-template`, too.
2020-11-05 10:18:30 +09:00
Yusuke Kuoka 3899680672
feat: Add `helmfile test --logs` (#1569)
When `--logs` is provided, Helmfile runs `helm test --logs` so that it can stream test logs

Ref #1541
2020-11-05 10:17:18 +09:00
Yusuke Kuoka 6b86408500
feat: Add `helmfile template --include-crds` (#1568)
This allows you to use helmfile-template output as a GitOps source, when the template output contains CRDs and you use Helm 3.

Helm 3 by default removes CRDs from the template output. If you want to git-commit helmfile-template containing CRDs for GitOps and you use Helm 3 for templating, the only way is provide this newly added `--include-crds` flag.
2020-11-05 10:13:25 +09:00
Yusuke Kuoka bdbaa00628
Fix redundant helm-dep-build and prepare hook regression (#1566)
Fixes #1511
Fixes #1497
2020-11-05 09:43:42 +09:00
Yusuke Kuoka 0663831dd5
Disable dependency update while running helm-x/chartify in more cases (#1548)
`helm dep up` is now skipped while running helm-x/chartify when the chart/directory is obtained by running go-getter, or `skipDeps` is configured using a command-line flag, helmDefaults, or release configuration.

Resolves #1547
2020-10-25 11:25:59 +09:00
isindir afb2653452
fix: printing error to stdout together with templated resources (#1550)
Fixes #1551
2020-10-25 09:14:07 +09:00
Javier Palacios 8f8669778c
Support for azure acr helm repositories (#1526)
Adds a basic support for Helm repositories hosted on Azure Container Registry (not OCI but classic ones). Add a new field to RepositorySpec to state that is externally managed and runs the `az-cli` command instead of the helm one to manage the repository.
2020-10-15 08:45:45 +09:00
Yusuke Kuoka ab9fb2c9dc
Fix concurrent-map-iteration-and-write errors while running release hooks (#1534)
Fixes #1495
2020-10-13 14:49:01 +09:00
Yusuke Kuoka c170b5a621
Minor tweaks for `helmfile write-values` (#1533)
See 1 and 3 in https://github.com/roboll/helmfile/issues/1460#issuecomment-691863465
2020-10-13 09:33:49 +09:00
Yusuke Kuoka d9286ed8f6
Fix intermittent failures while building deps on local chart (#1532)
Fixes #1521
2020-10-13 09:14:45 +09:00
Yusuke Kuoka 3018e82902
Fix multiple --set in --args messed up in `helmfile template` (#1529)
Fixes #1520
2020-10-13 08:38:06 +09:00
Wi1dcard 5d8eba9b29
Append --force-update for specific helm versions. (#1494)
* Parse and process helm version using github.com/Masterminds/semver/v3.

* Add --force-update only when Helm version >= 3.3.2, < 3.3.4.

See: https://github.com/helm/helm/pull/8777.

* Add test cases.
2020-10-12 09:20:55 +09:00
Yusuke Kuoka ff81b2f279
Enable release hook template to access .Values (#1485)
Fixes #1484
2020-09-21 09:43:30 +09:00
Wi1dcard 988c218096
Support the latest Helm (>=v3.3.2) and bump the Helm version in Docker image. (#1488)
Changes:

* Bump Helm to v2.16.12 and v3.3.3.
* Add --force-update only when using Helm 3.
2020-09-21 09:41:49 +09:00
Jason Witkowski 87d04f0202
Append KubeContext to temporary directory path (#1471)
Fix bug where KubeContext is not taken into account in temporary directories
2020-09-13 09:46:08 +09:00
Yusuke Kuoka 0fad9f0544
Add experimental write-values command for writing values files only (#1469)
Ref #1460
2020-09-11 22:19:36 +09:00
Johannes Alkjær 9d2c0d4285
Bump sprig to v3.1.0 and mergo 3.11 (#1456)
* Bump sprig to v3.1.0
test for mergeOverwrite

* Let mergo not (accidentally) try to merge unexported fields

This is also a good chance separate `HelmState` with the config loaded from YAML, which I had been wanting to do for a long time.

Co-authored-by: Johannes Alkjær <johannes.alkjaer@wunderman.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2020-09-04 09:58:54 +09:00
Yusuke Kuoka 5f1698d0ed
Fix wrong deletion order (#1451)
Fixes #1450
2020-09-01 17:36:11 +09:00
Yusuke Kuoka 19d79427a1
Add experimental "forceNamespace" in helmfile.yaml (#1444)
This is an experimental feature to support a potential use-case that you need to set namespaces in manifests rendered by `helmfile template`, WHEN the chart is unconventional hence does not have `namespace: {{ .Namespace }}`.
Rather than using this, you should usually fork/maintain or update/pull-request the chart to have `namespace: {{ .Namespace }}`.
Use this only when you CAN NOT do so, but still need to use `helmfile template`.
2020-09-01 10:13:27 +09:00
Yusuke Kuoka cd0ecc5263 Fix build error after `helmfile build --embed-values` addition
This is a follow-up for #1436
2020-08-29 15:01:22 +09:00
Yusuke Kuoka 0fc0869671
feat: `helmfile build --embed-values` to embed release values and secrets into the output (#1436) 2020-08-29 13:18:17 +09:00
Maksym Lushpenko 5ca7ce15bc
feat: common labels for all releases in a helmfile (#1415)
This adds `comonLabels` option to helmfile by:

- Adding `CommonLabels` to HelmState
- Changing `markExcludedReleases` and `ListReleases` functions to merge common labels into release labels

Resolves #1266
2020-08-29 13:14:58 +09:00
Joshua Hansen 7b11ce851a
feat: Allow .Release.Name to be used in gotmpl values templates (#1424)
This adds the ability to utilize `.Release` inside of gotmpl files as discussed [here](https://github.com/roboll/helmfile/issues/760).

Resolves: https://github.com/roboll/helmfile/issues/760

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2020-08-29 13:07:46 +09:00
Yusuke Kuoka f2dfa7ce64 Fix kubeContext not taken into account for release uniqueness
Fixes #1440
2020-08-29 11:33:05 +09:00
Yusuke Kuoka 9e54af5c2c fixup! fixup! Fix race while running `helm dep build` on local chart 2020-08-29 10:14:42 +09:00
Yusuke Kuoka 8a43e8f782 fixup! Fix race while running `helm dep build` on local chart 2020-08-29 10:04:09 +09:00
Yusuke Kuoka b42e847154 Fix race while running `helm dep build` on local chart
Resolves #1438
2020-08-28 20:08:44 +09:00
Yusuke Kuoka 14e2b9ed93
Fix regression in helmfile deps (#1431)
Fixes #1421
2020-08-27 09:22:02 +09:00
KUOKA Yusuke 738409ee0e
Fix regression for helmfile template with helm v2 since v0.125.4 (#1416)
This fixes the regression introduced by #1406 that resulted in `helmfile template` with helm v2 failing when there is any release with `version`.

Fixes #1414
2020-08-14 09:57:10 +09:00
KUOKA Yusuke ec87a39015
Revert filtering on repositories to be updated (#1412)
This reverts a part of #1383 so that repository updates are done in the pre-0.125.0 way, which tries to update any repositories only once regardless of they are referenced by selected releases or not.

Ref #1404
2020-08-13 10:10:30 +09:00
KUOKA Yusuke 9a03d79a84
Fix chart fetched by go-getter not to fail due to missing dependencies (#1408)
Ref https://github.com/roboll/helmfile/issues/1401#issuecomment-670915272
2020-08-08 21:22:57 +09:00
KUOKA Yusuke 0ef7e65f02
Fix race on/sometimes missing postsync and cleanup hooks (#1407)
So that those hooks are fully executed as intended. The documentation about hooks are updated as well to clarify the intended behaviour.

Fixes #1398
2020-08-08 16:45:21 +09:00
KUOKA Yusuke 61b61d3009
Fix `helmfile template` with Helm 3 ignoring chart version (#1406)
This fixes a regression introduced in #1399
Fixes #1377
2020-08-08 15:26:40 +09:00
KUOKA Yusuke 2710cb382f
Fix go-getter URL in chart to actually work (#1405)
Fixes #1401
2020-08-08 11:01:47 +09:00
KUOKA Yusuke b85243a6b4
Fix various issues in chart preparation (#1400)
In #1172, we accidentally changed the meaning of prepare hook that is intended to be called BEFORE the pathExists check. It broke the scenario where one used a prepare hook for generating the local chart dynamically. This fixes Helmfile not to fetch local chart generated by prepare hook.

In addition to that, this patch results in the following fixes:

- Fix an issue that `helmfile template` without `--skip-deps` fails while trying to run `helm dep build` on `helm fetch`ed chart, when the remote chart has outdated dependencies in the Chart.lock file. It should be up to the chart maintainer to update Chart.lock and the user should not be blocked due to that. So, after this patch `helm dep build` is run only on the local chart, not on fetched remote chart.
- Skip fetching chart on `helmfile template` when using Helm v3. `helm template` in helm v3 does support rendering remote charts so we do not need to fetch beforehand.

Fixes #1328
May relate to #1341
2020-08-06 09:06:25 +09:00
Kyrylo Lebediev 2ce57ba2ee
Handle --disable-openapi-validation parameter in helm upgrade (#1396) 2020-08-04 08:36:18 +09:00
KUOKA Yusuke cc9b7f3942
Fix regression on template failing due to duplicate fetch target (#1395)
This fixes a regression introduced in #1388
Fixes #1394
2020-08-04 02:28:58 +09:00
KUOKA Yusuke 85a2024669
Fix `helmfile lint` failure when `installed: false` (#1391)
Fixes #1344
2020-08-01 13:47:57 +09:00
KUOKA Yusuke b4857937fb
Fix lint to not fail for duplicate release names across ns (#1388)
Fixes #1384
2020-08-01 10:36:01 +09:00
KUOKA Yusuke 1e260e4a5e
Fix and enhancement to repository update (#1383)
Changes:

- Prevent Helmfile from unnecessarily running `helm repo add` and `helm repo up` against repositories for unused repositories(repositories of releases filtered out by selector)
- Fixes #1330
2020-07-28 10:17:43 +09:00
KUOKA Yusuke ee8ea507a6
Add pre/postuninstall hooks (#1375)
Exmple:

```
releases:
- name: test2
  chart: stable/mysql
  installed: false
  hooks:
  - events:
    - prepare
    - preuninstall
    - postuninstall
    - cleanup
    showlogs: true
    command: "echo"
    args:
    - "event name = {{` {{ .Event.Name `}} }}"
```

Output:

```
helmfile apply
Listing releases matching ^test2$
test2   default         1               2020-07-23 00:51:44.975478 +0900 JST    deployed        mysql-1.6.6     5.7.30

helmfile.yaml: basePath=.

hook[preuninstall] logs | event name =  preuninstall
hook[preuninstall] logs |
Deleting test2
release "test2" uninstalled

helmfile.yaml: basePath=.

hook[postuninstall] logs | event name =  postuninstall
hook[postuninstall] logs |
helmfile.yaml: basePath=.

hook[cleanup] logs | event name =  cleanup
hook[cleanup] logs |

DELETED RELEASES:
NAME
test2
```

Resolves #802
2020-07-23 01:09:36 +09:00
KUOKA Yusuke b5830a3011
Add ability to use go-getter for fetching remote manifests directory as chart (#1374)
This, in combination with #1172, allows you to use `go-getter`-supported URL for K8s manifests on `chart`, so that Helmfile automatically fetches it and then turning it into a temporary local chart, which is then installed by Helmfile as similar as standard Helm charts.

An example usecase of this is to install cert-manager CRDs which is distributed separately from the chart:

```
releases:
- name: cert-manager-crds
  chart: git::http://github.com/jetstack/cert-manager.git@deploy/crds?ref=v0.15.2
```

I'm adding this based on discussion with @lukasmrtvy. He was trying to install cert-manager and prometheus-opreator with Helmfile, and this combined with #1373 should do the job. Thanks for the input!
2020-07-23 00:30:16 +09:00
KUOKA Yusuke 4fde6e13db
Add disableValidation and disableOpenAPIValidation per release (#1373)
`disableOpenAPIValidation: true` might be useful for workaround for broken CRDs that is known to be exist in older OpenShift versions, and `disableValidation: true` is confirmed to allow installing charts like prometheus-operator that tries to install CRDs and CRs in the same chart.

Strictly speaking, for the latter case I believe you only need `disableValidation: true` set during the first installation, but for the ease of operation I shall suggest you to always set it.

Obviously turning validation mostly(disableOpenAPIValidation) or entirely(disableValidation) result in deferring any real error until sync time. We need completely client-side validation that is able to read CRDs and use it for validating any CRs to catch any error before sync. But it worth an another (big) issue.

Fixes #1124
2020-07-22 23:10:22 +09:00
KUOKA Yusuke df6489ab43
feat: `helmfile template --output-dir-template` for customizing output dirs (#1357)
This is useful for e.g. removing state file names and their hash values out of output dirs so that it can be used easily in a gitops setup. For example, `--output-dir-template mybasedir/{{.Release.Name}}` produces `mybasedir/RELEASE/CHART/templates/*.yaml` for each release in your helmfile.yaml.
2020-07-16 09:02:26 +09:00
ento face92536c
Add integration test for Kustomize inetgration (#1288)
Summary of changes:

* Output any error from Mkdir in `helmfile template`

* Add failing test for .Release.Name interpolation

* Add golden files for testing

* Parse resources with kustomize to compare them structure by structure

* Decode resources into plain maps

The RNode type from kustomize uses yaml.Node under the hood,
which carries extra information like line numbers, which
become noisy when comparing with deep.Equal.
2020-06-16 09:06:52 +09:00
KUOKA Yusuke 3a2a460fe7
Do cleanup decrypted env secrets files (#1304)
* Do cleanup decrypted env secrets files

Resolves #503
2020-06-16 08:59:48 +09:00
Max Audron f16d96bc8f
Add global hooks (#1301)
Changes:

* Add global hooks
* Add top level hooks field to yaml spec
* Add functions for global prepare and cleanup events
* Call global prepare and cleanup events in withPreparedCharts function
* Update README
* Add helmfileCommand variable to withPreparedCharts
  Pass the information on what helmfileCommand has been run down from the
  top level functions through withReposAndPreparedCharts and withPreparedCharts.
2020-06-11 10:05:38 +09:00
Yusuke Kuoka 68432b1848 fix: Do not skip passing values files when adhocDependencies/jsonPatches/jsonPatches exist
This is a follow-up for #1172
2020-05-27 21:13:05 +09:00
KUOKA Yusuke 16288dfa7d
feat: GA of Kustomize and K8s manifests support (#1172)
This is the GA version of the helm-x integration #673 developed last year.

You get all the following benefits without an extra helm plugin:

- Ability to add ad-hoc chart dependencies/aliases, without forking the chart (Fixes #876 )
- Ability to patch resulting K8s resources before installing the helm chart
- Ability to install a kustomization as a chart (Requires `kustomize` binary to be available in `$PATH`
- Ability to install a directory of K8s manifests as a chart
- etc.
2020-05-27 11:42:43 +09:00
Craig Furman eb8ab54865
Optionally error when subhelmfiles do not exist (#1245)
This prevents typos in helmfiles from silently preventing operations
from running. The default behavior is to print a warning, to preserve
backwards compatibility.
2020-05-12 09:41:39 +09:00
Guillaume Perrin 6d5f8c71cb
Allow skipping chart-related operations when `installed: false` (#1233)
Resolves #1232

CHANGES:

* Disable repo update when installed is false

When install is false, we do not need to update the repositories and get
the chart.

Signed-off-by: Guillaume Perrin <guillaume28.perrin@gmail.com>
2020-05-09 14:03:56 +09:00
Craig Dunford d71ac15748
Enhance createNamespace error handling (#1227)
- An error is raised if createNamespace is set explicitly and the
  helm version being used is not 3.2+
2020-04-27 08:59:44 +09:00
Craig Dunford eeb61e6174
Support for createNamespace (#1226)
- createNamespace is a new attribute that can be added to helmDefaults
  or an individual release to enforce the creation of a release namespace
  during sync if the namespace does not exist. This leverages helm's
  (3.2+) --create-namespace flag for the install/upgrade command. If
  running helm < 3.2, the createNamespace attribute has no effect.

Resolves #891
Resolves #1140
2020-04-26 10:41:40 +09:00
Ash Caire 3a19a394ab
Add condition release attribute (#1190) 2020-04-23 08:43:34 +09:00
KUOKA Yusuke 3a34d28d7c
fix: helmDefaults.timeout and releases[].timeout not working for `helmfile test` (#1211)
Fixes #1191
2020-04-17 09:08:21 +09:00
KUOKA Yusuke 870cc03c70
feat: `helmfile diff --detailed-exitcode` should also detect deletions (#1186)
Resolves #499
Resolves #1072
2020-04-10 08:22:33 +09:00
RaymondKYLiu 71635caace
feat: add option `--include-tests` for diff and apply command (#1179)
Co-authored-by: Raymond Liu (RD-TW) <raymond_liu@trend.com.tw>
2020-04-05 17:43:54 +09:00
KUOKA Yusuke 9d7d2de6f5
Fix misleading `helmfile diff` output (#1174)
Fixes #749
2020-04-04 17:39:20 +09:00
KUOKA Yusuke 69feadc360
feat: `helmBinary` in helmfile.yaml (#1160)
* feat: `helmBinary` in helmfile.yaml

Resolves #1083

* Add regression test for `helmfile destroy`
2020-03-29 17:51:07 +09:00
KUOKA Yusuke bf22502a2f
feat: add helmfile template --validate (#1135)
This adds the ability for helmfile to call `helm template --validate` introduced in helm 3.

fixes #1105
2020-03-05 08:07:02 +09:00
KUOKA Yusuke 10f2a576c5
fix: `helmfile -n ns statuses` should set ns for helm 3 (#1108)
This fixes the issue reported in Slack https://sweetops.slack.com/archives/CE5NGCB9Q/p1582088381195000
2020-02-20 22:30:02 +09:00
Anton Trifonov 27425bc4d2
Fix status command for helm 3 (#1098) 2020-02-13 08:40:20 +09:00
Emil 05add478c1
Add option to suppress diff on apply (#1092)
* Add option to suppress diff on apply

Add --supress-diff option on apply. Usable for fresh installs when a
lot of output is produces by diff.

Resolves #458

* fix tests for suppress-diff
2020-02-05 21:29:55 +09:00
Daniel Poelzleithner 5fb037c8e3
Fix crash on missing chart (#1087)
When chart is not set, an exception without any hints occure due
normalizeChart tries to access the first character of a 0 length string.
Properly inform user of missing chart.
2020-02-03 08:42:54 +09:00
Christoph Hösler 9fab6851f0
fix test command for helm 3 (#1080) 2020-02-03 08:41:38 +09:00
a-hat fc75f25293 do not pass --api-versions to "helm diff" (#1061) 2020-01-08 08:48:29 +09:00
KUOKA Yusuke b044820607
fix: helmfile destroy does not delete helm releases in status : PENDING_INSTALL (#995)
Fixes #539
2019-12-27 09:33:28 +09:00
a-hat 9cf6b59cd8 feat: Option to pass apiVersions to `helm diff` and `helm template` (#1046)
This makes it possible to pass the API Capabilities to helmfile when executing a task that does not render against an actual cluster (diff, template, apply).

Resolves #1014
2019-12-27 08:30:39 +09:00
刘相轩 ac534a897b Add historyMax (#1022)
Resloves #868
2019-12-17 08:27:42 +09:00
KUOKA Yusuke 27c098c17c
Fix capitalization of cleanup-on-fail config key (#1005)
It is how `cleanupOnFail` to be consistent with other keys.

Ref #969
2019-11-29 09:29:26 +09:00
Harshal Shah 04379cee80 Add the cleanup-on-fail flag to upgrade command (#969)
* Adding the cleanup-on-fail flag to upgrade command

* Adding tests and making the flag optional

* Updating readme with new flag details

* go fmt
2019-11-29 08:47:19 +09:00
Andrew Drake c099f69d94 feat: Automatically enable Helm v3 mode
Runs `helm version` in helmexec.New, and exposes a method on Interface to allow other packages to use the detected version. Preserves compatibility with previous HELMFILE_HELM3 mechanism.

Resolves #923
2019-11-14 10:50:18 -08:00
Yusuke Kuoka e2e4e8440d fix the bug that resulted in `helmfile sync` not delete releases with `--namespace` 2019-11-07 20:48:55 +09:00
Yusuke Kuoka 77082cef58 fix regression that `--namespace` breaks delete/destroy and possibly sync/apply as well
The problem was that `--namespace NS` had been not taken into account while deleting releases, that resulted in releases that should be deleted are not deleted.
2019-11-07 19:53:27 +09:00
Yusuke Kuoka 8d7c79a323 fix: release not found on uninstall through sync/apply
The recent addition of the DAG support(`needs`) and the fixes on it broke the delete-on-sync functionality. And there were two more bugs. One is that it was not correctly running `helm delete` when needed and the another is that it was failing when `--selector` is specified and the releases to delete by sync found, but nothing actually got deleted. This fixes all of them.

Fixes #941
2019-11-07 10:09:54 +09:00
KUOKA Yusuke f41fe86452
fix: Fix --selector to not break `needs` (#934) 2019-11-06 17:05:25 +09:00
Yusuke Kuoka 30751e94f7 Fix `helmfile --namespace ns delete` to not fail consistently
Until now `helmfile delete` with helm v3 had been failing when `--namespace` is provided. Helmfile was missing the fact that in helm v3 namespace must be passed instead of tiller-namespace to scope releases to be deleted.

```
err: release "b-1" failed: helm3rc2 exited with status 1:
  Error: uninstall: Release not loaded: b-1: release: not found
in ./helmfile.yaml: release "b-1" failed: helm3rc2 exited with status 1:
  Error: uninstall: Release not loaded: b-1: release: not found
```
2019-11-02 15:52:07 +09:00
KUOKA Yusuke 3f02b86640
fix: Fix `needs` to work for upgrades and when selectors are provided (#922)
* fix: Fix `needs` to work for upgrades and when selectors are provided

Fixes #919

* Add test framework for `helmfile apply`

* Various enhancements and fixes to the DAG support

- Make the order of upgrades/deletes more deterministic for testability
- Fix the test framework so that we can validate log outputs and errors
- Add more test cases for `helmfile apply`, along with bug fixes.
- Make sure it fails with an intuitive error when you have non-existent releases referenced from witin "needs"
2019-11-02 14:04:16 +09:00
Tom Duffield 464e6bc782 Run vals against values files that contain the syntax (#920)
If we specify ref+ syntax in a values file, run vals against that file.

Signed-off-by: Tom Duffield <tom@chef.io>
2019-10-31 08:48:30 +09:00
Yusuke Kuoka fc0a7b68a8 fix unexpectedly high concurrency since the dag support 2019-10-28 13:25:25 +09:00
Yusuke Kuoka 88caa7514f fix potential race in sync 2019-10-28 13:24:27 +09:00
KUOKA Yusuke 7666e95690
feat: Add `needs: [NS/NAME]` for controlling installation/deletion order declaratively (#914)
Introduces DAG-aware installation/deletion ordering to Helmfile.

`needs` controls the order of the installation/deletion of the release:

```yaml
relesaes:
- name: somerelease
  needs:
  - [TILLER_NAMESPACE/][NAMESPACE/]anotherelease
```

All the releases listed under `needs` are installed before(or deleted after) the release itself.

For the following example, `helmfile [sync|apply]` installs releases in this order:

1. logging
2. servicemesh
3. myapp1 and myapp2

```yaml
  - name: myapp1
    chart: charts/myapp
    needs:
    - servicemesh
    - logging
  - name: myapp2
    chart: charts/myapp
    needs:
    - servicemesh
    - logging
  - name: servicemesh
    chart: charts/istio
    needs:
    - logging
  - name: logging
    chart: charts/fluentd
```

Note that all the releases in a same group is installed concurrently. That is, myapp1 and myapp2 are installed concurrently.

On `helmdile [delete|destroy]`, deleations happen in the reverse order.

That is, `myapp1` and `myapp2` are deleted first, then `servicemesh`, and finally `logging`.

Resolves #715
2019-10-28 12:57:25 +09:00
Kyrylo Lebediev 4680010c60 Add integration with Hashicorp Vault, AWS SSM, SecretsManager (#906)
* feat: Add integration with Hashicorp Vault, AWS SSM, SecretsManager

Fields which are rendered: Release.Values, Release.SetValues.Value, Release.SetValues.Values

Example:
```
values:
- foo: ref+vault://mykv/foo?address=http://127.0.0.1:8200#/mykey
set:
- name: xyz
  values:
  - ref+vault://mykv/foo?address=http://127.0.0.1:8200#/mykey3
```

Resolves #881

* feat: Update integration with variantdev/vals

New ref+.\* secret formats are used:
6565695a03 (suported-backends)

Resolves #881
2019-10-25 22:55:26 +09:00
Jarryd Tilbrook 4294a5de06 feat: Enhance postsync event to include `.Error` (#882)
* Refactor postsync event to include success flag

* Change success boolean to error

Fixes #826
2019-10-17 08:27:12 +09:00
KUOKA Yusuke fdca10678b
fix(helm3): `Error: unknown flag: --purge` on deletion via `helmfile sync` (#890)
Fixes #888
2019-10-10 16:54:15 +09:00
KUOKA Yusuke 2e98e907b0
fix: invalid duration passed to helm 3 upgrade (#864)
Fixes #863
2019-09-19 08:30:29 +09:00
Mike Splain b762ab0b78 Fix delete/destroy (#859) 2019-09-17 15:04:04 +09:00
Theo Meneau 216c228c0b feat: `helm repo add --ca-file` via repositories definition (#856)
Resolves #855
2019-09-14 06:23:54 +02:00
KUOKA Yusuke ef63a05513
fix(helm3): delete/destroy/apply/sync unable to detect releases to be deleted (#857)
Fixes #853
2019-09-14 06:23:22 +02:00
KUOKA Yusuke f79db2ec8d
feat(diff,apply,lint,sync,template): `--set k=v` for setting adhoc chart values (#850)
Resolves #840
2019-09-12 19:24:43 +09:00
KUOKA Yusuke 94a6fcfb9f
feat(diff,apply): --context=N for limiting diff context (#849)
Resolves #787
2019-09-12 18:36:13 +09:00
KUOKA Yusuke fb2041555e
feat(diff,apply): --no-color for removing color from output (#848)
Resolves #788
2019-09-12 18:32:30 +09:00
Shane Starcher 5488198d6d fix: allow empty pattern matching and move on (#827)
Ref #778
2019-09-11 12:47:00 +09:00
KUOKA Yusuke 4bbd09ccb2
fix(cmd/deps): make `helmfile deps` to work w/ helm 3.0.0-beta.3 (#842)
Ref https://github.com/roboll/helmfile/issues/668#issuecomment-529054165
2019-09-07 22:06:29 +09:00
KUOKA Yusuke 4e4f1bee59
feat: Experimental Helm v3 mode (#841)
Set `HELMFILE_HELM3=1` and run `helmfile` like `HELMFILE_HELM3=1 helmfile ...`.

When `HELMFILE_HELM3` is set, `test`, `template`, `delete`, `destroy` behave differently so that it works with Helm 3.

Note that `helmfile diff` doesn't work as `helm-diff` called under the hood doesn't support Helm v3 yet.

Ref #668
2019-09-07 09:40:44 +09:00
KUOKA Yusuke 4bc99337b2
Make advanced templating backward-compatible (#833)
This is a follow-up for #823
Ref https://github.com/roboll/helmfile/pull/823#discussion_r319712283
2019-08-31 22:37:46 +09:00
astorath 11d0abba6e feat: Advanced Templating (#823)
1. Added `helmfile build` command to print final state
Motivation: useful for debugging purposes and some CI scenarios

Ref #780 

2. Template interpolation is now recursive (you can cross-reference release fields) like:
```yaml
templates:
  release:
    name: {{`app-{{ .Release.Namespace }}`}}
    namespace: {{`{{ .Release.Labels.ns }}`}}
    labels:
      ns: dev
```
3. Experimental: Added some boolean release fields interpolation in templates:
```yaml
templates:
  release:
    name: {{`app-{{ .Release.Namespace }}`}}
    namespace: dev
    installedTemplate: {{`{{ eq .Release.Namespace "dev" }}`}}
```

Resolves #818

4. Added more template interpolations: Labels, SetValues
5. Added template interpolation for inline Values
6. Added `helmfile list` command to print target releases in simple tabular form
7. Added release names in some `helm` output messages, e.g.: `Comparing release=%v, chart=%v`
2019-08-31 14:31:31 +09:00
Travis Groth a584aeab2e Share helmexec from State Creation (#804)
Closes #444 and #782 

This is the final PR to fully cache and parallelize helm secret decryption.  It threads the shared helmexec.Interface into the StateCreator and HelmState structs to be used during environment secret decryption.  This should effectively cache secrets for the duration of a helmfile run, regardless of where they are first decrypted.
2019-08-15 09:27:55 +09:00
OlivierB bce2f4728b fix: pass namespace to helm template command (#771)
Resolves #770
2019-07-30 10:44:42 +09:00
KUOKA Yusuke b2a6231dcf
fix: absolute chart path (#753)
Resolves #743
2019-07-12 22:37:54 +09:00
Marc Sutter 4166b418c9 feat: Adopt existing K8s resources as Helm release on install (#746)
Use with the helm-x support(#673)

This enhances config syntax to accept adopt: [NS/KIND/RESOURCE_NAME] at the release level so that helmfile calls helm-x to transparently import existing resources at the installation time.

Resolves #84
2019-07-11 09:13:34 +09:00
OlivierB 2f9f52033c feat: add --output-dir on template command (#693)
It generates templates in a subdirectory named "stateFileName-stateFileHash-releaseName"
2019-07-11 09:07:46 +09:00
KUOKA Yusuke 63b5040ec4
fix: `fatal error: concurrent map read and map write` on concurrency > 1 (#742)
This is a revised version of 41e44f74a3, which doesn't make CI angry and a more straight-forward(yet smelling) implementation

Fixes #737
2019-07-05 09:20:16 +09:00
KUOKA Yusuke 7dec948950
fix: helm chart referenced by http URL (#695)
We unintentionally broke this since #593.

Fixes #675
Fixes #687
2019-06-16 16:40:17 +09:00
KUOKA Yusuke 1bde201eae
feat: --concurrency for delete and destroy (#691)
Resolves #690
2019-06-13 23:14:51 +09:00
KUOKA Yusuke 1831d3375f
fix: `installed: false` not respecting TLS settings and tiller namespace (#683)
It was just missing the appendConnectionFlags call to compose flags passed to `helm delete` there. This fixes it.

Fixes #605
2019-06-12 19:07:31 +09:00
KUOKA Yusuke 2e38f42a40
fix: helmDefaults.kubeContext ignored in `helm diff` of `helmfile apply` (#682)
The root cause of this bug was due to that `--kube-context` and `kubeContext` had been treated specifically in code. So on the way I have made it consistent with other per-release settings - by adding `kubeContext` for each release and treating `helmDefaults.kubeContext` as just the default value for per-release setting.

Fixes #674
2019-06-12 16:49:19 +09:00
KUOKA Yusuke 1da3488599
feat: experimental integration with helm-x (#673)
This enhances helmfile so that it can:

- Treat K8s manifests directories and Kustomize projects as charts
- Add adhoc chart dependencies on sync/diff/template without forking or modifying chart(s) (#649)
- Add adhoc patches(JSON Patch or Strategic Merge Patch supported) to be applied to the K8s resources before sync/diff/template, without forking or modifyin chart(s) (#650)

The usage is as outlined in https://github.com/mumoshu/helm-x/tree/master/examples/helmfile.

Add any or all of `dependencies:`, `jsonPatches:` and `strategicMergePatches:` so that it adds additional flags to `helm` calls that is only supported by `helm x`.

```yaml
releases:
- name: kustomize
  chart: ../kustomize
- name: manifests
  chart: ../manifests
- name: foo
  chart: incubator/raw
  dependencies:
  - alias: bar
    chart: incubator/raw
  values:
  - values.yaml
  - bar:
      enabled: true
      resources:
      - apiVersion: v1
        kind: Pod
        metadata:
          name: bar
        spec:
          containers:
          - command:
            - sleep
            - 1000
            image: alpine:3.9.4
            imagePullPolicy: IfNotPresent
            name: bar
  jsonPatches:
  - target:
      version: v1
      kind: Pod
      name: foo
    patch:
    - op: replace
      path: /spec/containers/0/command
      value:
      - sleep
      - "123"
  strategicMergePatches:
  - apiVersion: v1
    kind: Pod
    metadata:
      name: bar
    spec:
      containers:
      - name: bar
        command:
        - sleep
        - "234"
```

You can alternatively provide `source: path/to/patch.yaml` for `jsonPatches` and `strategicMergePatches` items to externalize it. Add `.gotmpl` suffix like you would do for values files for templating.

When running `helmfile` you must point `--helm-binary` to the `helm-x` binary like below:

```
$ helmfile --helm-binary ~/.helm/plugins/helm-x/bin/helm-x --log-level debug apply
```

after installing the [helm-x](https://github.com/mumoshu/helm-x) plugin.

The integration should ideally be automatic. That is, it shouldn't force you to set `--helm-binary`. But I had no other way to not bloat helmfile's codebase to just add this experimental feature.

Resolves #649
Resolves #650
2019-06-12 16:11:34 +09:00
sgandon 56c27c2bd9 fix: fixes a regexp issue for release summary (#666)
There was an issue a the regexp reding the version from helm output.

Fixes #665
2019-06-10 09:18:41 +09:00
KUOKA Yusuke 820abbc06d
feat: remote state files (#648)
This change enhances helmfile to accept terraform-module-like URLs in nested state files a.k.a sub-helmfiles.

```yaml
helmfiles:
- # Terraform-module-like URL for importing a remote directory and use a file in it as a nested-state file
  # The nested-state file is locally checked-out along with the remote directory containing it.
  # Therefore all the local paths in the file are resolved relative to the file
  path: git::https://github.com/cloudposse/helmfiles.git@releases/kiam.yaml?ref=0.40.0
```

The URL isn't equivalent to terraform module sources. The difference is that we use `@` to distinguish between (1) the path to the repository and directory containing the state file and (2) the path to the state file being loaded. This distinction provides us enough fleibiity to instruct helmfile to check-out necessary and sufficient directory to make the state file works.

Under the hood, it uses [hashicorp/go-getter](https://github.com/hashicorp/go-getter), that is used for [terraform module sources](https://www.terraform.io/docs/modules/sources.html) as well.

Only the git provider without authentication like git-credentials helper is tested. But theoretically any go-getter providers should work. Please feel free to test the provider of your choice and contribute documentation or instruction to use it :)

Resolves #347
2019-06-04 22:59:54 +09:00
KUOKA Yusuke 3710f6233e
feat: state values (#647)
This adds `values` to state files as proposed in #640.

```yaml
values:
- key1: val1
- defaults.yaml

environments:
  default:
  - values:
    - environments/default.yaml
  production:
  - values:
    - environments/production.yaml

```

`{{ .Valuese.key1 }}` evaluates to `val1` if and only if it is not overrode via the production or the default env, or command-line args.

Resolves #640
2019-06-04 16:34:02 +09:00
KUOKA Yusuke e2d6dc4afa
feat: helmfile as a go library (#639)
* feat: helmfile as a go library

This removes almost all the dependencies from the helmfile core logic to urfave/cli. `main.go` is now a thin wrapper around the core logic implemented in `pkg/app`.
2019-06-04 09:12:00 +09:00
KUOKA Yusuke c68fc5bc50
chore: tidy up pkgs (#636)
for readability and towards potentially making helmfile usable as a go library
2019-06-01 13:36:05 +09:00