MChorfa / porter-helm3

porter-helm3
Apache License 2.0
8 stars 10 forks source link

Allow bundle authors to ensure a namespace exists #33

Open carolynvs opened 3 years ago

carolynvs commented 3 years ago

Helm has re-added the --create-namespace flag, which checks if the namespace does not exist and creates it if needed. We should expose this flag as a field for the install and upgrade actions:

helm:
  chart: mychart
  namespace: "{{ installation.name }}"
  createNamespace: true

I suggest that createNamespace default to true, for the same reason that I proposed that upsert should be set by default (#30) or go even further with #17 for an idempotent install: mixins should default to idempotent commands for install/upgrade/uninstall. Re-running install or upgrade should not result in errors about resources already existing. We do not want to get people into situations where the bundle isn't runnable anymore and they have to fall back to using the tools manually to "fix" a stuck bundle.

Current workarounds for the lack of namespace support are:

MChorfa commented 3 years ago

Yes, I spot that command 2 weeks ago and using it right now on my deployments. works well. I Will work on this over this weekend

carolynvs commented 3 years ago

Oh great! I just updated porter's main branch to use your helm3 mixin and the build is failing because the namespace doesn't exist.

https://github.com/getporter/porter/pull/1772/checks?check_run_id=3668928358

If you end up not having time to add this, just let me know and I can help out.

MChorfa commented 3 years ago

Fixed in v0.1.14