Incompatibility between region name and kubernetes namespace rules

Bug #1842991 reported by Tim McNamara
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Nam Nguyen

Bug Description

The bootstrap process into a k8s cloud fails when that k8s cloud has been defined with a region name that includes capital letters. Kubernetes attempts to create a namespace that includes those capitals (via the controller name?) and then aborts with an error relating to DNS.

See original thread https://discourse.jujucharms.com/t/2032

Tags: k8s
Revision history for this message
Ian Booth (wallyworld) wrote :

The default controller name is composed from <cloud>-<region>, if not specified.

For VM clouds it's just a label so it doesn't matter.
For k8s clouds, a namespace is created from the controller name to contain the controller artefacts. So the name matters.

A workaround is to explicitly name the controller when bootstrapping.

summary: - Incompatibility between region name roles and kubernetes name rules
+ Incompatibility between region name and kubernetes namespace rules
Nam Nguyen (nammn)
Changed in juju:
assignee: nobody → Nam Nguyen (nammn)
Revision history for this message
Nam Nguyen (nammn) wrote :

AFAICT cloud and region names can only be a problem if they contain special chars and/or caps.
Additionally I think that the cloud provider and it's region usually don't contain special chars outside of "-".
Therefore my suggestion would be to:

1. lower-case the name used for creating the namespace

Additionally one could add more sophisticated checking and replacing of invalid special chars (which are not -) and just replace them. But this can and could lead to other unexpected things.

Revision history for this message
Richard Harding (rharding) wrote : Re: [Bug 1842991] Re: Incompatibility between region name and kubernetes namespace rules

I think we're +1 with lowercasing the names by default.

On Fri, Oct 4, 2019 at 8:21 AM Nam Nguyen <email address hidden>
wrote:

> AFAICT cloud and region names can only be a problem if they contain
> special chars and/or caps.
> Additionally I think that the cloud provider and it's region usually don't
> contain special chars outside of "-".
> Therefore my suggestion would be to:
>
> 1. lower-case the name used for creating the namespace
>
> Additionally one could add more sophisticated checking and replacing of
> invalid special chars (which are not -) and just replace them. But this
> can and could lead to other unexpected things.
>
> --
> You received this bug notification because you are subscribed to juju.
> https://bugs.launchpad.net/bugs/1842991
>
> Title:
> Incompatibility between region name and kubernetes namespace rules
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1842991/+subscriptions
>

Revision history for this message
Nam Nguyen (nammn) wrote :
Changed in juju:
status: Confirmed → In Progress
Nam Nguyen (nammn)
Changed in juju:
status: In Progress → Fix Committed
milestone: none → 2.7-beta1
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.