diff --git a/packages/system/address-controller/Makefile b/packages/system/address-controller/Makefile index 7b0907acc..b3c5defad 100644 --- a/packages/system/address-controller/Makefile +++ b/packages/system/address-controller/Makefile @@ -9,7 +9,7 @@ include ../../../hack/package.mk # main build as main-, 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 . diff --git a/packages/system/address-controller/charts/address-controller/Chart.yaml b/packages/system/address-controller/charts/address-controller/Chart.yaml index 820993b98..64f07d1f5 100644 --- a/packages/system/address-controller/charts/address-controller/Chart.yaml +++ b/packages/system/address-controller/charts/address-controller/Chart.yaml @@ -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: diff --git a/packages/system/address-controller/charts/address-controller/crds/local.sdn.cozystack.io_ipaddressclasses.yaml b/packages/system/address-controller/charts/address-controller/crds/local.sdn.cozystack.io_ipaddressclasses.yaml index 792d220ae..35d5e1d8a 100644 --- a/packages/system/address-controller/charts/address-controller/crds/local.sdn.cozystack.io_ipaddressclasses.yaml +++ b/packages/system/address-controller/charts/address-controller/crds/local.sdn.cozystack.io_ipaddressclasses.yaml @@ -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: {} diff --git a/packages/system/address-controller/values.yaml b/packages/system/address-controller/values.yaml index c1027c5ad..1c1d1e41c 100644 --- a/packages/system/address-controller/values.yaml +++ b/packages/system/address-controller/values.yaml @@ -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 diff --git a/packages/system/metallb-iad/Makefile b/packages/system/metallb-iad/Makefile index 3b4aee657..113c5e390 100644 --- a/packages/system/metallb-iad/Makefile +++ b/packages/system/metallb-iad/Makefile @@ -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 diff --git a/packages/system/metallb-iad/charts/metallb-iad/Chart.yaml b/packages/system/metallb-iad/charts/metallb-iad/Chart.yaml index 7021025da..67f8c7a59 100644 --- a/packages/system/metallb-iad/charts/metallb-iad/Chart.yaml +++ b/packages/system/metallb-iad/charts/metallb-iad/Chart.yaml @@ -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 diff --git a/packages/system/metallb-iad/charts/metallb-iad/templates/role.yaml b/packages/system/metallb-iad/charts/metallb-iad/files/role.yaml similarity index 97% rename from packages/system/metallb-iad/charts/metallb-iad/templates/role.yaml rename to packages/system/metallb-iad/charts/metallb-iad/files/role.yaml index b0bf1d8ac..242ce4cbe 100644 --- a/packages/system/metallb-iad/charts/metallb-iad/templates/role.yaml +++ b/packages/system/metallb-iad/charts/metallb-iad/files/role.yaml @@ -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: diff --git a/packages/system/metallb-iad/charts/metallb-iad/templates/_helpers.tpl b/packages/system/metallb-iad/charts/metallb-iad/templates/_helpers.tpl index 79eb62a99..3ad0d6c11 100644 --- a/packages/system/metallb-iad/charts/metallb-iad/templates/_helpers.tpl +++ b/packages/system/metallb-iad/charts/metallb-iad/templates/_helpers.tpl @@ -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 }} diff --git a/packages/system/metallb-iad/charts/metallb-iad/templates/clusterrole.yaml b/packages/system/metallb-iad/charts/metallb-iad/templates/clusterrole.yaml new file mode 100644 index 000000000..4fe840acc --- /dev/null +++ b/packages/system/metallb-iad/charts/metallb-iad/templates/clusterrole.yaml @@ -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 }} diff --git a/packages/system/metallb-iad/charts/metallb-iad/templates/controller.yaml b/packages/system/metallb-iad/charts/metallb-iad/templates/controller.yaml index 8b99c6f68..b153f1526 100644 --- a/packages/system/metallb-iad/charts/metallb-iad/templates/controller.yaml +++ b/packages/system/metallb-iad/charts/metallb-iad/templates/controller.yaml @@ -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 diff --git a/packages/system/metallb-iad/charts/metallb-iad/values.yaml b/packages/system/metallb-iad/charts/metallb-iad/values.yaml index b9fd39280..ca8fd29b3 100644 --- a/packages/system/metallb-iad/charts/metallb-iad/values.yaml +++ b/packages/system/metallb-iad/charts/metallb-iad/values.yaml @@ -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 diff --git a/packages/system/metallb-iad/values.yaml b/packages/system/metallb-iad/values.yaml index 0b12f6ecc..58eda1f87 100644 --- a/packages/system/metallb-iad/values.yaml +++ b/packages/system/metallb-iad/values.yaml @@ -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,