Skip to content

Allow bundle authors to ensure a namespace exists #33

@carolynvs

Description

@carolynvs

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:

  • Use the exec mixin to execute a helm install command with --create-namespace=true. Whenever a user has to use the exec mixin, it opens up security concerns for people evaluating the bundle, and it's an unnecessary hurdle for authors since supporting the extra flag is straightforward, so why make them switch to exec?
  • Use the kubernetes mixin and apply a namespace manifest. Again this is sub-par because it's a flag that helm supports, so having to switch to another tool (and increase the bundle size with another mixin) is unwarranted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions