feat(address-controller): update to v0.3.0

address-controller v0.3.0 gives IPAddressClass a status: the class's
provisioner reports the loadBalancerClass a Service consuming one of
its claims must carry in status.loadBalancerClass, and sets an
Accepted condition for the class's generation. The value means
something only while Accepted is True, and auto-claim waits for it.
metallb-iad v0.3.0 writes that status (its --lb-class, empty for the
cluster default), sets Accepted to False with reason PoolRefused when
the class's pool is unusable, and requires the v0.3.0 CRD, so the two
move together.

Cozystack runs metallb-iad with an empty --lb-class, and its classes
name a pool, so this upgrades in place. The driver's ClusterRole and
binding are named after the release namespace, which Helm handles on
upgrade.

Assisted-by: LLM
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
This commit is contained in:
Timofei Larkin committed 2026-11-27 08:33:47 +01:00
1 parent 9af6594342
commit b9bc88d053
12 files changed
+118 -20

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ include ../../../hack/package.mk
# main build as main-<short sha>, and the digest is in that job's log or from
# `crane digest`.
ADDRESS_CONTROLLER_REPO ?= https://github.com/cozystack/address-controller.git
ADDRESS_CONTROLLER_REF ?= 0ed4cc53de935ba108c012e43008fc456b806f79
ADDRESS_CONTROLLER_REF ?= 10c701bd74fd085cf50968c756a2b93fd028954f
test:
helm unittest .
@@ -2,8 +2,8 @@ apiVersion: v2
name: address-controller
description: Core controllers for IP addresses as a first-class resource — IPAddressClass, IPAddress, IPAddressClaim (local.sdn.cozystack.io)
type: application
version: 0.2.0
appVersion: "0.2.0"
version: 0.3.0
appVersion: "0.3.0"
# CEL validation rules on the CRDs (immutability, union exactness) need 1.29+.
kubeVersion: ">=1.29.0-0"
keywords:
@@ -21,6 +21,12 @@ spec:
- jsonPath: .spec.reclaimPolicy
name: ReclaimPolicy
type: string
- jsonPath: .status.loadBalancerClass
name: LoadBalancerClass
type: string
- jsonPath: .status.conditions[?(@.type=="Accepted")].status
name: Accepted
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
@@ -91,7 +97,84 @@ spec:
required:
- provisioner
type: object
status:
description: |-
IPAddressClassStatus is written by the provisioner that serves the class.
The core controller never writes it.
properties:
conditions:
description: conditions holds the provisioner's Accepted condition.
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
loadBalancerClass:
description: |-
loadBalancerClass is the spec.loadBalancerClass a Service consuming a
claim of this class must carry, so that the Service reaches the
load-balancer implementation the provisioner fronts. Empty means the
cluster's default implementation, and such a Service carries none. It
is meaningful only while the Accepted condition is True for the
class's current generation: before that, an empty value is not yet
reported rather than the default.
type: string
type: object
type: object
served: true
storage: true
subresources: {}
subresources:
status: {}
@@ -3,4 +3,4 @@ address-controller:
# running controller change with no change in this tree. Pinned here rather
# than in charts/, which `make update` regenerates. Bump in lockstep with
# ADDRESS_CONTROLLER_REF in the Makefile.
image: ghcr.io/cozystack/address-controller:main-90e65ca@sha256:74e4c7cf63f730ebe61527fdcd2b06e1bca2c383a66522dd4734aab9e66a9331
image: ghcr.io/cozystack/address-controller:0.3.0@sha256:c9d1a0a7b2ce74ae8abda4b5c6d67fdd65e4eb035b6ccec9f224e0efc1a47a24
+1 -1
View File
@@ -5,7 +5,7 @@ include ../../../hack/package.mk
# Same pinning story as packages/system/address-controller.
METALLB_IAD_REPO ?= https://github.com/cozystack/metallb-iad.git
METALLB_IAD_REF ?= 2f983b67ed6ab86d745922a6bff9d89f18fc681d
METALLB_IAD_REF ?= b4d2fdc4b879b96bfc423392e8aea0ee2cb5f029
update:
rm -rf charts tmp-repo
@@ -2,8 +2,8 @@ apiVersion: v2
name: metallb-iad
description: MetalLB IP Allocation Driver — the reference per-class driver for the address-controller core (local.sdn.cozystack.io)
type: application
version: 0.2.0
appVersion: "0.2.0"
version: 0.3.0
appVersion: "0.3.0"
kubeVersion: ">=1.29.0-0"
keywords:
- ipam
@@ -44,6 +44,15 @@ rules:
- get
- list
- watch
- apiGroups:
- local.sdn.cozystack.io
resources:
- ipaddressclasses/status
- ipaddresses/status
verbs:
- get
- patch
- update
- apiGroups:
- local.sdn.cozystack.io
resources:
@@ -56,14 +65,6 @@ rules:
- patch
- update
- watch
- apiGroups:
- local.sdn.cozystack.io
resources:
- ipaddresses/status
verbs:
- get
- patch
- update
- apiGroups:
- metallb.io
resources:
@@ -11,6 +11,11 @@ helm.sh/chart: {{ printf "metallb-iad-%s" .Chart.Version | replace "+" "_" | tru
{{- default .Release.Namespace .Values.placeholderNamespace -}}
{{- end -}}
{{/* Name of the cluster-scoped RBAC objects, after the release namespace. */}}
{{- define "metallb-iad.clusterRoleName" -}}
{{- printf "metallb-iad-%s" .Release.Namespace -}}
{{- end -}}
{{/* imagePullSecrets block, rendered only when set. Call with the root context. */}}
{{- define "metallb-iad.imagePullSecrets" -}}
{{- with .Values.imagePullSecrets }}
@@ -0,0 +1,6 @@
{{- /* files/role.yaml is controller-gen output (make manifests); only its
name and labels are set here. */ -}}
{{- $role := .Files.Get "files/role.yaml" | fromYaml }}
{{- $_ := set $role "metadata" (dict "name" (include "metallb-iad.clusterRoleName" .) "labels" (include "metallb-iad.labels" . | fromYaml)) }}
---
{{ toYaml $role }}
@@ -22,13 +22,13 @@ metadata:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: metallb-iad
name: {{ include "metallb-iad.clusterRoleName" . }}
labels:
{{- include "metallb-iad.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: metallb-iad
name: {{ include "metallb-iad.clusterRoleName" . }}
subjects:
- kind: ServiceAccount
name: metallb-iad
@@ -9,7 +9,10 @@ metallbNamespace: metallb-system
# The --lb-class of the MetalLB instance this driver fronts. Empty for a
# MetalLB that serves Services without a loadBalancerClass, the cluster
# default. Placeholders carry it as spec.loadBalancerClass.
# default. Placeholders carry it as spec.loadBalancerClass, the driver reports
# it as status.loadBalancerClass on every IPAddressClass it serves, and it
# pins only Services whose spec.loadBalancerClass equals it (unset when it is
# empty).
loadBalancerClass: ""
# Namespace the reservation placeholder Services live in. Empty means the
+1 -1
View File
@@ -4,7 +4,7 @@ metallb-iad:
metallbNamespace: cozy-metallb
# Same digest pin as packages/system/address-controller; bump in lockstep
# with METALLB_IAD_REF in the Makefile.
image: ghcr.io/cozystack/metallb-iad:main-1faf937@sha256:a2a8b05a887f9f28927d75f8b57e264be40e8770d0177798b4f06a0f69c3e793
image: ghcr.io/cozystack/metallb-iad:0.3.0@sha256:f4b2484b28432172ee5b1037805be4fd1ba4c6d80a9d21d7869f4cba7eae6530
# Reserve MetalLB's pool, pin and sharing inputs on tenant Services to the
# driver. A tenant that could set them could steer MetalLB at an address
# reserved for someone else. Every tenant namespace, tenant-root included,