Expose JUJU_AVAILABILITY_ZONE as a node label

Bug #1951427 reported by Nobuto Murata
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kubernetes Worker Charm
New
Undecided
Unassigned

Bug Description

By default, the charmed deployment will add labels like the following for worker nodes:

$ kubectl get nodes --show-labels
NAME STATUS ROLES AGE VERSION LABELS
calm-alien Ready <none> 3m48s v1.22.4 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,juju-application=kubernetes-worker,kubernetes.io/arch=amd64,kubernetes.io/hostname=calm-alien,kubernetes.io/os=linux
...

MAAS and OpenStack in mind as Juju providers set JUJU_AVAILABILITY_ZONE in a charm env with underlying zone/AZ information. It would make sense to expose those information to users as node labels so they can ensure anti-affinity of their workload based on failure domains.

This namespace could be used for that.
https://kubernetes.io/docs/reference/labels-annotations-taints/#topologykubernetesiozone

Here is an example from other charms:
https://jaas.ai/ceph-osd#charm-config-customize-failure-domain

A current workaround is to use a charm option as "labels":
https://jaas.ai/u/containers/kubernetes-worker#charm-config-labels
However, it requires an application in each zone so it's cumbersome from an operational point of view. i.e.,

juju config kubernetes-worker-zone1 labels=topology.kubernetes.io/zone=zone1
juju config kubernetes-worker-zone2 labels=topology.kubernetes.io/zone=zone2
juju config kubernetes-worker-zone3 labels=topology.kubernetes.io/zone=zone3
...

could be something simpler like the following or even with zero option:

juju config kubernetes-worker expose-zone=true

Nobuto Murata (nobuto)
tags: added: good-first-bug
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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