How can I deploy Medik8s with a custom lease namespace?
Asked by
nested parentheses
I've just deployed Medik8s, and it automatically created a namespace called `medik8s-leases`. Our organization requires system namespaces to use an `infra-` prefix, so I'd like to use a name such as `infra-medik8s-leases` instead. I couldn't find a namespace setting in the supplied manifests. Since this is still a fresh installation, redeploying is fineโwhat is the recommended way to configure Medik8s to use a different lease namespace?
Answers
A namespace canโt be renamed after itโs created because other resources may reference its name. Since this is a new installation, the usual approach is to remove the current deployment and install it again in a namespace with the required nameโassuming Medik8s supports configuring that lease namespace before installation.
Reply to this answer
Check the Helm values and manifests for a configurable lease namespace first. Some operators let you change the installation namespace, but still hard-code a separate lease namespace such as `medik8s-leases`. If that name is embedded in the operator code or generated manifests, it would need an upstream configuration option or code change rather than a simple namespace rename.
Reply to this answer
One possible workaround is to patch the controller manager to set the lease namespace through the environment variable used by Medik8sโ lease manager. Then remove the existing lease resources and namespace, clear any finalizers if deletion gets stuck, and restart the controller so it recreates everything under the new name. Iโd treat this as experimental, though, because a future upgrade or reconciliation may restore the original value unless the patch is managed declaratively.
nested parentheses: That might work, but Iโm hesitant to rely on a manual patch if the namespace ever needs to be recreated. It would be better if the setting could be included permanently in the installation configuration.
Reply to this answer
Add your answer
Answers are reviewed before publication.
nested parentheses: Redeploying is fine in my case. Iโm mainly trying to find the Medik8s-specific setting because the provided manifests donโt expose an obvious namespace option.