Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions cmd/fleet-multiplane/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,6 @@ func phase(name, configPath string, once bool) error {
}[name]
last := ""
for {
// With synchronized lab DHCP, bind the boot address claims this phase
// is waiting on, in IPAM's place.
if r.IPAM != nil {
if bound, bindErr := r.IPAM.Bind(ctx); bindErr != nil {
fmt.Printf("%s: lab IPAM stand-in: %v\n", name, bindErr)
} else if bound > 0 {
fmt.Printf("%s: lab IPAM stand-in bound %d boot address claim(s)\n", name, bound)
}
}
err = action(ctx)
// Report each new reason a phase is waiting, so a phase that times
// out shows what it waited for.
Expand Down
98 changes: 98 additions & 0 deletions config/multiplane/clusters/platform-ipam/ipam.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Platform cluster, synchronized lab DHCP mode only (run.sh --synced-dhcp):
# the IPAM service (milo-os/ipam v0.6.0) beside the provider project's Milo
# API, which aggregates it as ipam.miloapis.com. IPAM's own published
# manifests, pinned by digest, as the platform's Flux consumes them; the lab
# patches below are the only changes. Bootstrap enrolls the credentials and
# registers the APIService in the provider Milo API.
apiVersion: source.toolkit.fluxcd.io/v1
kind: OCIRepository
metadata: {name: ipam-kustomize, namespace: flux-system}
spec:
interval: 1h
url: oci://ghcr.io/milo-os/ipam-kustomize
# v0.6.0 (revision v0.6.0@sha1:1f6f22938dd165e568bb0fb1e4c50167ab09d6ae).
ref:
digest: sha256:62305dde600b8efa10a68a786e60b2e826837897cd93378c9e94d7adbff3f647
---
# Namespace, IPAM's PostgreSQL and the NetworkPolicy toward Milo.
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata: {name: ipam-system, namespace: flux-system}
spec:
interval: 10m
retryInterval: 30s
timeout: 5m
prune: true
wait: true
sourceRef: {kind: OCIRepository, name: fleet-gitops, namespace: flux-system}
path: ./config/multiplane/ipam
---
# IPAM's published base: the apiserver Deployment, Service, PDB,
# NetworkPolicy and the host-cluster RBAC it ships with.
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata: {name: ipam-apiserver, namespace: flux-system}
spec:
interval: 10m
retryInterval: 30s
timeout: 5m
prune: true
wait: true
sourceRef: {kind: OCIRepository, name: ipam-kustomize, namespace: flux-system}
path: ./base
targetNamespace: ipam-system
dependsOn:
- {name: ipam-system, namespace: flux-system}
- {name: milo-provider, namespace: flux-system}
images:
# ghcr.io/milo-os/ipam:v0.6.0 (multi-arch index).
- name: ghcr.io/milo-os/ipam
digest: sha256:18d472179ddff8db77a812fd0f0874248dd08e5a2425197152cc4cc2e9a7ce0d
patches:
# No cert-manager CSI driver in the lab: the serving key is a Secret
# enrolled by bootstrap, whose certificate is the APIService caBundle.
- target: {kind: Deployment, name: ipam-apiserver}
patch: |-
- op: test
path: /spec/template/spec/volumes/0/name
value: tls-certs
- op: replace
path: /spec/template/spec/volumes/0
value: {name: tls-certs, secret: {secretName: ipam-apiserver-tls, defaultMode: 288}}
# Delegate TokenReview and SubjectAccessReview to the provider Milo API,
# as the platform does, through a kubeconfig bootstrap enrolls. The
# control-plane-ca ConfigMap the base mounts holds Milo's front-proxy CA.
# The lab Milo serves no quota API, so quota is off. One replica and
# smaller requests fit the single platform node. Mode 288 is 0440: IPAM
# runs as 65532 with that fsGroup.
- target: {kind: Deployment, name: ipam-apiserver}
patch: |-
apiVersion: apps/v1
kind: Deployment
metadata: {name: ipam-apiserver}
spec:
replicas: 1
template:
spec:
containers:
- name: apiserver
env:
- {name: KUBECONFIG, value: /etc/kubernetes/milo/kubeconfig}
- {name: AUTHENTICATION_KUBECONFIG, value: /etc/kubernetes/milo/kubeconfig}
- {name: AUTHORIZATION_KUBECONFIG, value: /etc/kubernetes/milo/kubeconfig}
- {name: ENABLE_QUOTA, value: "false"}
resources:
requests: {cpu: 50m, memory: 96Mi}
# IPAM publishes a 4Gi limit for production; the lab
# bounds it at 1Gi, well above its startup with five
# informers, so an OOM is not the first failure.
limits: {cpu: "1", memory: 1Gi}
volumeMounts:
- {name: milo-credentials, mountPath: /etc/kubernetes/milo, readOnly: true}
initContainers:
- name: migrate
resources:
requests: {cpu: 10m, memory: 32Mi}
volumes:
- name: milo-credentials
secret: {secretName: ipam-milo-credentials, defaultMode: 288}
4 changes: 4 additions & 0 deletions config/multiplane/clusters/platform-ipam/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ipam.yaml
11 changes: 11 additions & 0 deletions config/multiplane/ipam/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# IPAM's namespace and its own PostgreSQL, beside the provider project's Milo
# API (synchronized lab DHCP mode only). The IPAM apiserver itself comes from
# IPAM's published manifests (config/multiplane/clusters/platform-ipam).
# Bootstrap enrolls the database password, IPAM's serving key and its Milo
# credentials as Secrets; none is in the source.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- postgres.yaml
- networkpolicy.yaml
7 changes: 7 additions & 0 deletions config/multiplane/ipam/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: ipam-system
annotations:
# Holds IPAM's database volume. Never garbage-collect it.
kustomize.toolkit.fluxcd.io/prune: disabled
27 changes: 27 additions & 0 deletions config/multiplane/ipam/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Additive to the NetworkPolicy in IPAM's published base, which admits only
# kube-system and telemetry-system. Here the front proxy is the provider
# project's Milo API, and IPAM delegates authentication and authorization back
# to it, so both directions name that namespace.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata: {name: ipam-apiserver-milo, namespace: ipam-system}
spec:
podSelector:
matchLabels: {app: ipam-apiserver}
policyTypes: [Ingress, Egress]
ingress:
- from:
- namespaceSelector:
matchLabels: {kubernetes.io/metadata.name: milo-provider}
podSelector:
matchLabels: {app.kubernetes.io/name: milo-apiserver}
ports:
- {protocol: TCP, port: 8443}
egress:
- to:
- namespaceSelector:
matchLabels: {kubernetes.io/metadata.name: milo-provider}
podSelector:
matchLabels: {app.kubernetes.io/name: milo-apiserver}
ports:
- {protocol: TCP, port: 6443}
66 changes: 66 additions & 0 deletions config/multiplane/ipam/postgres.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# IPAM's own PostgreSQL. IPAM owns this storage; Fleet never connects to it.
# IPAM's postgres component floats its chart (16.x) and image, so the lab runs
# the official image pinned by digest instead. The postgres-credentials
# Secret (password, and the DSN IPAM reads) is written by bootstrap.
apiVersion: v1
kind: Service
metadata: {name: ipam-postgres, namespace: ipam-system}
spec:
clusterIP: None
selector: {app.kubernetes.io/name: ipam-postgres}
ports:
- {name: postgres, port: 5432, targetPort: 5432}
---
apiVersion: apps/v1
kind: StatefulSet
metadata: {name: ipam-postgres, namespace: ipam-system}
spec:
serviceName: ipam-postgres
replicas: 1
# The database outlives the Pod and the StatefulSet.
persistentVolumeClaimRetentionPolicy: {whenDeleted: Retain, whenScaled: Retain}
selector:
matchLabels: {app.kubernetes.io/name: ipam-postgres}
template:
metadata:
labels: {app.kubernetes.io/name: ipam-postgres}
spec:
automountServiceAccountToken: false
enableServiceLinks: false
securityContext:
runAsNonRoot: true
runAsUser: 70
runAsGroup: 70
fsGroup: 70
seccompProfile: {type: RuntimeDefault}
containers:
- name: postgres
# PostgreSQL 17.10, official Alpine image (multi-arch index).
image: postgres:17.10-alpine@sha256:742f40ea20b9ff2ff31db5458d127452988a2164df9e17441e191f3b72252193
args: [-c, shared_buffers=32MB, -c, max_connections=50]
env:
- {name: POSTGRES_USER, value: ipam}
- {name: POSTGRES_DB, value: ipam}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef: {name: postgres-credentials, key: password}
- {name: PGDATA, value: /var/lib/postgresql/data/pgdata}
ports:
- {name: postgres, containerPort: 5432}
readinessProbe:
exec:
command: [pg_isready, -U, ipam, -d, ipam, -h, 127.0.0.1]
periodSeconds: 5
securityContext:
allowPrivilegeEscalation: false
capabilities: {drop: [ALL]}
resources:
requests: {cpu: 25m, memory: 64Mi}
limits: {memory: 256Mi}
volumeMounts:
- {name: data, mountPath: /var/lib/postgresql/data}
volumeClaimTemplates:
- metadata: {name: data}
spec:
accessModes: [ReadWriteOnce]
resources: {requests: {storage: 1Gi}}
18 changes: 18 additions & 0 deletions config/multiplane/milo/provider/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,21 @@ patches:
- op: replace
path: /spec/ports/0/nodePort
value: 30441
# The aggregation layer, as the platform's Milo runs it: Milo proxies
# aggregated APIs (IPAM, in synchronized lab DHCP mode) with a front-proxy
# client certificate, and the APIs trust its CA for the X-Remote-* identity
# headers, project extras included. Bootstrap enrolls the CA and client key
# in milo-apiserver-private; they are never in the source.
- target: {kind: Deployment, name: milo-apiserver}
patch: |-
- op: test
path: /spec/template/spec/containers/0/name
value: apiserver
- {op: add, path: /spec/template/spec/containers/0/args/-, value: --proxy-client-cert-file=/private/front-proxy-client.crt}
- {op: add, path: /spec/template/spec/containers/0/args/-, value: --proxy-client-key-file=/private/front-proxy-client.key}
- {op: add, path: /spec/template/spec/containers/0/args/-, value: --requestheader-client-ca-file=/private/front-proxy-ca.crt}
- {op: add, path: /spec/template/spec/containers/0/args/-, value: --requestheader-allowed-names=fleet-front-proxy-client}
- {op: add, path: /spec/template/spec/containers/0/args/-, value: --requestheader-username-headers=X-Remote-User}
- {op: add, path: /spec/template/spec/containers/0/args/-, value: --requestheader-uid-headers=X-Remote-Uid}
- {op: add, path: /spec/template/spec/containers/0/args/-, value: --requestheader-group-headers=X-Remote-Group}
- {op: add, path: /spec/template/spec/containers/0/args/-, value: --requestheader-extra-headers-prefix=X-Remote-Extra-}
13 changes: 11 additions & 2 deletions docs/operations/boot-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,20 @@ socket, where the central Kea answers relays on a UDP socket. It has no VLAN, no
switch and no firmware, so it proves none of the network operations
requirements.

The synced Redfish acceptance (`run.sh --redfish --synced-dhcp`) goes further.
Its boot addresses come from the real IPAM service (`milo-os/ipam` v0.6.0),
which runs with its own PostgreSQL and with quota off, and which the provider
project's Milo API aggregates. A lab pool hands out only 192.168.77.100–199.
The acceptance asserts that every address Kea leased was allocated by IPAM to
that operation's own claim during its boot, and that no claim or allocation
remains afterwards. It does not prove quota, Milo's production IAM, or pool
exhaustion through IPAM. See [IPAM in the lab](redfish-lab.md#ipam-in-the-lab).

## Implemented versus proposed

| Behavior | Status |
| --- | --- |
| Boot addresses claimed from IPAM per operation, checked at admission, and released only after the operation ended unheld | Implemented; tested against a real API server with a stand-in for IPAM's claim API. Only the lab's synchronized DHCP mode sets a class, against a stand-in, and IPAM itself is not exercised |
| Boot addresses claimed from IPAM per operation, checked at admission, and released only after the operation ended unheld | Implemented; tested against a real API server with a stand-in for IPAM's claim API. The synced Redfish lab claims from real IPAM, but no synced run has passed yet |
| Boot NIC from Device inventory through the admission snapshot; enrollment without MACs or addresses | Implemented; unit tested |
| Reservation feed, authenticated applied reports, served and withdrawn gates over every reservation of the Device | Implemented; unit tested with a fake BMC and synchronizer |
| Reports bound to feeds the feed served, and refreshed reports of an unchanged feed | Implemented; unit tested, including a forged issue time, another instance's feed, a feed restart and an instance that never fetched the reservation |
Expand All @@ -442,6 +451,6 @@ requirements.
| Relay, provisioning VLAN, isolation and LACP fallback at a site | Network operations; see the [server networking enhancement][server-networking] |
| Telling firmware what to boot in synced mode (Redfish `HttpBootUri` for UEFI HTTP boot, or the DHCP boot-file option above) | Proposed; the Redfish worker still arms `Pxe`, and the base configuration's HTTP boot class names a loader the boot service does not serve yet |
| DHCPv6 reservations | Proposed; the feed accepts IPv6, the Kea DHCPv4 synchronizer and the claim reject it |
| Lab acceptance in synced mode | Implemented as `run.sh --redfish --synced-dhcp`, with a synthetic IPAM stand-in; not yet run. See the [Redfish lab](redfish-lab.md#synchronized-dhcp-mode) |
| Lab acceptance in synced mode | Implemented as `run.sh --redfish --synced-dhcp`, with IPAM v0.6.0 (its own PostgreSQL, quota off) aggregated by the provider Milo API; not yet run. See [IPAM in the lab](redfish-lab.md#ipam-in-the-lab) |

[server-networking]: https://github.com/datum-cloud/fleet/pull/186
7 changes: 7 additions & 0 deletions docs/operations/gitops.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ under [what is not production](#what-is-not-production).
RoleBinding and worker Job only
```

In synchronized lab DHCP mode (`run.sh --redfish --synced-dhcp`), the platform
cluster also reconciles `ipam-system` (IPAM's namespace, its PostgreSQL and a
NetworkPolicy toward the provider Milo API, from `config/multiplane/ipam`) and
`ipam-apiserver` (IPAM's published `ipam-kustomize` bundle, pinned by digest,
from its own OCIRepository). See
[IPAM in the lab](redfish-lab.md#ipam-in-the-lab).

| Surface | Writer | Never written by |
| --- | --- | --- |
| Flux controllers and sync objects (`flux-system`) | Bootstrap once, then each cluster's own Flux (`fleet-cluster` reconciles `environment/<cluster>/flux-system`) | — |
Expand Down
Loading
Loading