Skip to content

About

Monorepo for the Livepatch server charms

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

Canonical Livepatch Server Operators

Description

This repository contains the Canonical Livepatch Server Juju charms for Kubernetes and machines. Livepatch Server serves kernel patches and their metadata to clients, allowing administrators to control patch rollout across their infrastructure.

For an on-prem deployment including the server's dependencies, use the Livepatch on-prem bundle instead of deploying a server charm on its own.

Usage

Deploy the charm appropriate for your Juju model:

# In a Kubernetes model
juju deploy canonical-livepatch-server-k8s
# In a machine model
juju deploy canonical-livepatch-server-vm

Database integration

The server requires PostgreSQL. The Kubernetes and machine charms use different endpoint names:

# In a Kubernetes model
juju deploy postgresql-k8s --trust
juju integrate canonical-livepatch-server-k8s:postgresql postgresql-k8s:database
# In a machine model
juju deploy postgresql
juju integrate canonical-livepatch-server-vm:database postgresql:database

See the Kubernetes and machine charm READMEs for other integrations.

Development

The charms share Python modules in shared/livepatch_common/ and Grafana dashboards in shared/grafana_dashboards/. Charmcraft builds within each charm directory, so these sources must be staged inside the charm trees before packing or running per-charm tests:

make sync

The copies in livepatch-k8s-operator/src/livepatch_common/, livepatch-machine-operator/src/livepatch_common/, and the charms' dashboard directories are generated. Edit shared/, not the copies, and rerun make sync after changes.

Building the charms

Build both charms with opcli (preferred), or pack them with Charmcraft:

make opcli-build
# Or:
make pack

Both targets run make sync automatically. Every Make target that packs or tests a charm now runs make sync first — including the per-charm targets (make operator-prod-k8s for Kubernetes, make build-machine-charm, make unit-test, and make integration-test for machine) — so the staged copies can't go stale. You only need to run make sync by hand if you invoke charmcraft pack or tox directly instead of through a Make target. The artifacts are:

  • livepatch-k8s-operator/canonical-livepatch-server-k8s_amd64.charm
  • livepatch-machine-operator/canonical-livepatch-server_ubuntu@22.04-amd64.charm

Running tests

Run every unit test suite from the repository root:

make unit-test

That runs the shared-module tests plus each charm's unit tests, syncing the shared sources into the charm trees first. To run a single suite:

make unit-test-shared    # shared/tests against shared/livepatch_common
make unit-test-k8s       # livepatch-k8s-operator
make unit-test-machine   # livepatch-machine-operator

License

These charms are distributed under the Apache License, Version 2.0. See LICENSE for details.

About

Monorepo for the Livepatch server charms

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages