Add: Location metadata for clusters - #112
Conversation
piontec
left a comment
There was a problem hiding this comment.
I like the idea, but using the standard k8s label, not our own
|
Thanks @piontec for the review! FYI: I made some substantial changes after your review, mainly regarding the default location ID system for provide for on-prem. |
|
That makes sense to me. Although would we use generic characters if we want to specify the city but not the subdivision? Otherwise the |
It's not really intended to be able to resolve the code again, semantically. So if there happens to be a code The reason I'd like to keep this open is to avoid overcomplication, as some countries might now have meaningful subdivisions, and in many cases there might just not be the need for the entire possible depth (especially if a customer has only one location in the entire country). |
| For our default system, here is a synopsis of the format: | ||
|
|
||
| ``` | ||
| <CONTINENT_CODE>-<COUNTRY_CODE>[-<SUBDIVISION_CODE>[-<CITY_NAME>]] |
There was a problem hiding this comment.
This looks fine to me. I agree with Xav that there could be ambiguity about the meaning of the optional parts, but if we need to rely on that for some reason, that use case probably warrants its own proper support.
Requiring the country to be indicated for all clusters will help with compliance stories. Borders might change, but the label can follow.
I'd offer a preemptive suggestion that there should probably be a required, incrementing number for each location path. The first time a customer has two locations in a given city, we'll have ab-cd-ef-gh (which is the first location) and ab-cd-ef-gh-1 which is, counterintuitively, the second location. It' easy now to start with -1 and increment.
There was a problem hiding this comment.
Bumping the numbering suggestion here -- does anyone have thoughts for/against?
There was a problem hiding this comment.
The only downside I see is that the number isn't self-explanatory. But that's what labels are for.
When writing the proposal, I had in mind that the system would have to grow with the customer's needs. To use your example scenario, given eu-fr-cityname, they would have to change that to eu-fr-cityname-foo and add eu-fr-cityname-bar. But of course it would be less complicated if changing wasn't necessary.
There was a problem hiding this comment.
It makes sense to me to have a trailing numeric ID, it certainly won't hurt at least.
In that case do we need the subdivision code? It's starting to be quite a long string.
|
|
||
| - Instead of `topology.kubernetes.io/region`, we could specify our own label in the `giantswarm.io` namespace. The latter would make sense in case we wanted to mark that there would be some logical difference between these labels. | ||
|
|
||
| - Instead of strings, we could introduce a system that provides geo coordinates. (Since the cloud providers already work with string identifiers, this draft opts for a solution that extends this paradigm to on-prem.) |
There was a problem hiding this comment.
Something like what 3 words could also work and maybe be human-friendlier.
However, the exact locations of some sites are secret, so we would definitely have some opt-outs from this approach.
|
I think this makes a lot of sense since I've seen the same pattern in terms of how customers think about their clusters and it will only grow once we have more smart factory installations.
|
I agree that it would be nice to allow customers to assign "friendly names" regardless of the provider, but I feel like that should be a separate field from "where is this infrastructure physically located?" I wonder if by allowing total flexibility for friendly naming, we limit the usefulness of the field for our own purposes |
To me, friendly naming should happen on the UI level, if the customer is interested. Like this: If they use our default system, where e. g. That said, if a customer insisted in setting |
Those two solutions sound good to me. :) |
|
With the recent commit a9d86ca I added content related to populating the I would welcome feedback on this especially from @giantswarm/team-atlas . |
|
|
||
| ### Key assumptions | ||
|
|
||
| This RFC assumes that each cluster exists in one location only, and nodes of the same cluster are not distributed geographically. |
There was a problem hiding this comment.
Did we not just talk about scale to the cloud in the engineering workshop @JosephSalisbury ?
There was a problem hiding this comment.
yeah, i'm not 100% sure this is going to be true forever
however, even if we do start with some sort of "scale-to-the-cloud" solution in future, i think it's still reasonable to consider the cluster as being housed in one place (i.e: the control plane would still be colocated somewhere)
There was a problem hiding this comment.
That's true. This just made me think that maybe we should show the node labels but that would bé for later I guess
|
|
||
| #### Consistent metadata on clusters | ||
|
|
||
| We should set the [`topology.kubernetes.io/region`](https://kubernetes.io/docs/reference/labels-annotations-taints/#topologykubernetesioregion) label on the main cluster resource of all clusters. Currently (as of February 2025) this resource is of kind `Cluster`, group=`cluster.x-k8s.io/v1beta1`. |
There was a problem hiding this comment.
Was this not supposed to be a node label used for scheduling? I am not sure if the topology label makes sense here
There was a problem hiding this comment.
The linked docs page states that it's used on Node, PersistentVolume. So far it seems it's not used on Cluster.
If we are uncertain about this, we can decide for a custom (giantswarm.io) label instead.
There was a problem hiding this comment.
I would rather we use well known labels tbh, i'm wondering if there are not some in the CAPI or kcp work that would fit better but it's still okay as is
JosephSalisbury
left a comment
There was a problem hiding this comment.
overall, like the direction, some questions, no blocking
|
|
||
| ### Key assumptions | ||
|
|
||
| This RFC assumes that each cluster exists in one location only, and nodes of the same cluster are not distributed geographically. |
There was a problem hiding this comment.
yeah, i'm not 100% sure this is going to be true forever
however, even if we do start with some sort of "scale-to-the-cloud" solution in future, i think it's still reasonable to consider the cluster as being housed in one place (i.e: the control plane would still be colocated somewhere)
|
Update:
|
|
Thanks for incorporating the number suffix 👍 I'll mull over the missing TOPIC. Also, maybe we should include consideration of clusters that aren't on earth 😛 |
Towards