SAP-archive / karydia

Kubernetes Security Walnut
Other
77 stars 10 forks source link

Helm chart installs in the namespace where the context is set but karydia is installed in the karydia namespace #224

Closed linuxbsdfreak closed 4 years ago

linuxbsdfreak commented 4 years ago

Description

Helm chart installs in the namespace where the context is set but karydia is installed in the karydia namespace

Steps to reproduce

helm upgrade --install karydia-setup ./charts -f values.yaml

Expected behavior

helm list
NAME                            REVISION        UPDATED                         STATUS          CHART                                   APP VERSION     NAMESPACE
karydia-setup                   1               Tue Oct  8 09:51:48 2019        DEPLOYED        karydia-0.1.0                                           karydia

Default behaviour

helm list
NAME                            REVISION        UPDATED                         STATUS          CHART                                   APP VERSION     NAMESPACE
karydia-setup                   1               Tue Oct  8 09:51:48 2019        DEPLOYED        karydia-0.1.0                                           abapadmin

The behaviour is quite confusing with the chart. Helm tries to take the current namespace which it is configured for.

Ideally it should install as follows for the above to work.

helm upgrade --namespace karydia --install karydia-setup ./charts -f values.yaml

Logs / console output / screenshots / affected lines of code

Environment

Neumann-Nils commented 4 years ago

Currently, karydia installs the namespace "karydia" by itself. This is explicitly implemented in karydia_namespace.yaml.

This approach has multiple advantages:

On the other hand, as stated by @linuxbsdfreak, the namespace of karydia as displayed by helm will always be the one of the current context. This might be confusing for users.

A downside of this approach is that for changing the namespace one need to change the corresponding value in the values.yaml and in the CLI flag --namespace. This is due to the installation process of karydia, which does not solely rely on a simple Helm installation process, but implements pre-install and post-install hooks as well as init-containers for certain functionalities in the installation process. Currently, I don't see any other way for the installation process (that would allow to only change the CLI flag).

I already implemented a fix for this issue and will shift the discussion to the regarding pull request #227.