How can I deploy Medik8s with a custom lease namespace?

August 2, 2026 3 answers
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

rule.of.thirds
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.

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.

Reply to this answer
!do birds migrate here
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
!brakeTest7
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.

Related Discussions