Charm does not inject `nodeSelector` terms to the `speaker` pods
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MetalLB Operator |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
When using `--constraints` with `tags` for deployment, e.g.,
`juju deploy metallb --channel 1.28/stable --trust --constraints=
`nodeSelector` is only injected in the `operator` pod:
```
- apiVersion: apps/v1
blockOwnerD
controller: true
kind: StatefulSet
name: metallb
uid: 9f937c5d-
resourceVersion: "78864"
uid: 0d69bc57-
spec:
affinity:
nodeAffinity:
requiredD
- matchExpressions:
- key: kubeflowserver
values:
- "true"
```
for other pods spawned by the charm pod, it does not:
```
- apiVersion: apps/v1
blockOwnerD
controller: true
kind: DaemonSet
name: speaker
uid: 1ad60a90-
resourceVersion: "79003"
uid: d34dfaa9-
spec:
affinity:
nodeAffinity:
requiredD
- matchFields:
- key: metadata.name
values:
- vm-0
containers:
```
Note: `vm-0` is not the node with the label (`kubeflowserve
juju version: 2.9.43
kubernetes: v1.24.17
Changed in operator-metallb: | |
status: | New → Confirmed |
I tested this locally on microk8s.
Here's a breakdown of what I see:
* charm pod, metallb-0 in the app's model's namespace: Works. I see this as part of the spec:
spec: uringScheduling IgnoredDuringEx ecution:
nodeSelectorTe rms:
operator: In
affinity:
nodeAffinity:
requiredD
- matchExpressions:
- key: kubeflowserver
values:
- "true"
* metallb-system namespace, controller- $HASH-$ PODSUFFIX pod: no affinity rules, only a node selector:
nodeSelector: io/os: linux
kubernetes.
* metallb-system namespace, speaker-$PODSUFFIX pod: contains a daemonset-generated selector:
spec: uringScheduling IgnoredDuringEx ecution:
nodeSelectorTe rms:
operator: In
affinity:
nodeAffinity:
requiredD
- matchFields:
- key: metadata.name
values:
- rog2023
(rog2023 is the hostname of my single microk8s node, so this is correct)
* metallb-system namespace, replicaset controller-$HASH: no affinity rules, although it contained the "kubernetes.io/os: linux" nodeSelector nested within the template.
* metallb-system namespace, deployment controller: no affinity rules, contains the above replicaset.
* metallb-system namespace, daemonset speaker: no affinity rules, also contains the contains the "kubernetes.io/os: linux" nodeSelector nested within the template.
For the record: I see that the older metallb-speaker charm does seem to apply the nodeselector to the daemonset, unlike this version. I'm not sure what's changed.