Reboot coordinator for Fedora CoreOS nodes using the Zincati FleetLock protocol
  • Go 93.5%
  • Makefile 4.9%
  • Dockerfile 1.6%
Find a file
dghubble-renovate[bot] 8e398efe5e
Bump k8s.io packages from v0.35.4 to v0.36.0 (#420)
Co-authored-by: dghubble-renovate[bot] <119624128+dghubble-renovate[bot]@users.noreply.github.com>
2026-04-23 06:43:59 +00:00
.github Bump actions/checkout action from v5 to v6 2025-12-22 00:08:38 -05:00
cmd/fleetlock Move fleetlock components to internal package 2020-08-31 22:18:26 -07:00
examples Update image version shown in examples (#114) 2022-07-19 18:40:17 -07:00
internal Identify Kubelet nodes via MachineID instead of SystemUUID 2022-04-12 08:41:42 -07:00
.gitignore Initial fleetlock server implementation 2020-08-23 16:45:07 -07:00
CHANGES.md Update CHANGES for v0.4.0 release 2022-05-04 08:36:07 -07:00
CONTRIBUTING.md Initial fleetlock server implementation 2020-08-23 16:45:07 -07:00
DCO Initial fleetlock server implementation 2020-08-23 16:45:07 -07:00
Dockerfile Bump docker.io/alpine image from 3.23.3 to v3.23.4 (#417) 2026-04-16 11:43:51 +00:00
go.mod Bump k8s.io packages from v0.35.4 to v0.36.0 (#420) 2026-04-23 06:43:59 +00:00
go.sum Bump k8s.io packages from v0.35.4 to v0.36.0 (#420) 2026-04-23 06:43:59 +00:00
LICENSE Initial fleetlock server implementation 2020-08-23 16:45:07 -07:00
Makefile Add missing Makefile targets for push and manifest 2023-05-18 08:25:20 -07:00
README.md Rename the test.yaml workflow to build.yaml 2023-05-17 22:08:48 -07:00

fleetlock

GoDoc Quay Workflow Sponsors Mastodon

fleetlock is a reboot coordinator for Fedora CoreOS nodes in Kubernetes clusters. It implements the FleetLock protocol for use as a Zincati lock strategy backend.

Usage

Zincati runs on-host (zincati.service). Declare a Zincati fleet_lock strategy when provisioning Fedora CoreOS nodes. Set base_url for host nodes to access the in-cluster fleetlock Service (e.g. known ClusterIP).

variant: fcos
version: 1.4.0
storage:
  files:
    - path: /etc/zincati/config.d/55-update-strategy.toml
      contents:
        inline: |
          [updates]
          strategy = "fleet_lock"
          [updates.fleet_lock]
          base_url = "http://10.3.0.15/"

Apply the fleetlock Deployment, Service (with ClusterIP), and ServiceAccount.

kubectl apply -f examples/k8s

Inspect the fleetlock Lease object.

$ kubectl get leases -n default
NAME                HOLDER                             AGE
fleetlock-default   049ad0f57ade4723a48692b7b692c318   4m50s

Configuration

Configure the server via flags.

flag description default
-address HTTP listen address 0.0.0.0:8080
-log-level Logger level info
-version Show version NA
-help Show help NA

Or via environment variables.

variable description default
NAMESPACE Kubernetes Namespace "default"
KUBECONFIG Development Kubeconfig NA

Typhoon

For Typhoon clusters, add the Zincati config a snippet.

module "nemo" {
  ...
  controller_snippets = [
    file("./snippets/zincati-strategy.yaml"),
  ]
  worker_snippets = [
    file("./snippets/zincati-strategy.yaml"),
  ]
}

Manual Intervention

fleetlock coordinates OS auto-updates to avoid concurrent node updates or a potential bad auto-update continuing. Zincati obtains a reboot lease lock before finalization (i.e reboot).

If an auto-update fails, the lease continues to be held by design. An admin should investigate the node failure and decide whether it is safe to remove the lease.

$ kubectl get leases
$ kubectl delete lease fleetlock-default

Metrics

fleetlock serves Prometheus /metrics from Go, process, and custom collectors.

name description
fleetlock_lock_state State of the fleetlock lease (0 unlocked, 1 locked)
fleetlock_lock_transition_count Number of fleetlock lease transitions
fleetlock_lock_request_count Number of lock requests
fleetlock_unlock_request_count Number of unlock requests

Development

To develop locally, build and run the executable.

Static Binary

Build the static binary.

make build

Container Image

Build the container image.

make image

Run

Run the executable.

export KUBECONFIG=some-dev-kubeconfig
./bin/fleetlock

Use curl to emulate a Zincati FleetLock client.

{
  "client_params": {
    "id": "c988d2509fdf5cdcbed39037c56406fb",
    "group": "default"
  }
}

Request a reboot lock.

curl -H "fleet-lock-protocol: true" -d @examples/body.json http://127.0.0.1:8080/v1/pre-reboot

Release a reboot lock.

curl -H "fleet-lock-protocol: true" -d @examples/body.json http://127.0.0.1:8080/v1/steady-state