We are trying to template below toggles under the kots-app config with no success,
requireMinimalRBACPrivileges
additionalNamespaces
We need to be able to let our customer to control these toggle on deployment, and specify the namespace accordingly for minimal RBAC permissions
Put another way, at least as I understand it, this comes down to “My customer only wants to give me access to one or more specific namespaces, and I want to make this customizable for them”
As far as I know, those flags cannot be templated - my recommendations for this are below:
requireMinimalRBACPrivileges
Instead of requireMinimalRBAC, use supportsMinimalRBAC, and then instruct your customer to use the kots install --use-minimal-rbac flag at runtime: supportsMinimalRBAC docs
For the namespace side of things the answer here at it’s core comes down to following best practices when it comes to architecting an application for delivery into heterogenous customer environments, especially when you’re going to be a single tenant in a larger cluster.
Minimize specificity / requirement when deploying the app
Deploy everything into a single namespace, admin console, application, everything
Don’t deploy things that need cluster wide access like Ingress Controllers, Service Meshes, etc.
a. For example, don’t architect your app to rely on a specific ingress controller functionality if plain Service objects will solve the problem
If you need to pass a namespace as a parameter into a Helm chart or something, you can pass it in with {{repl Namespace}} which will return the namespace that the KOTS App Manager is already installed into.