The Livepatch K8s charm is the easiest and the recommended way to deploy the Livepatch server on K8s. This charm configures and runs the Livepatch server, which serves Livepatch-es and metadata attached to them to the clients. Canonical Livepatch patches high and critical linux kernel vulnerabilities, removing the immediate need to reboot to upgrade the kernel, instead allowing the downtime to be scheduled. It is a part of the Ubuntu Pro offering.
k8s/stable channel of the bundle made for this purpose. For more detailed steps on using the bundle, please see the tutorials on the Livepatch website.
The Livepatch server may be deployed using the Juju command line as follows:
juju deploy canonical-livepatch-server-k8sLivepatch server requires integration with a PostgreSQL charm via the database endpoint. As an example, users can deploy a PostgreSQL database and integrate it with Livepatch as follows:
juju deploy postgresql-k8s --trust
juju integrate canonical-livepatch-server-k8s:database postgresql-k8s:databaseThere is also an endpoint, named database-legacy, which can be used with PostgreSQL charm's legacy endpoint, db . But it is strongly recommended that users integrate with the database endpoint mentioned earlier.
Livepatch provides an endpoint, named nginx-route, which can be integrated with the nginx-ingress-integrator charm to expose the Livepatch server via an Nginx-controlled cluster ingress. As an example, users can integrate with this endpoint by using Juju as follows:
juju integrate canonical-livepatch-server-k8s:nginx-route nginx-ingress-integrator:nginx-routeLivepatch can be optionally integrated with Loki via the logging endpoint (Juju >= 3.4) or the log-proxy endpoint (Juju < 3.4). Users can integrate using Juju as follows:
# Juju >= 3.4 (recommended, uses Pebble log forwarding)
juju integrate canonical-livepatch-server-k8s:logging loki-k8s:logging
# Juju < 3.4 (legacy, uses Promtail sidecar)
juju integrate canonical-livepatch-server-k8s:log-proxy loki-k8s:loggingLivepatch provides observability dashboards on Grafana. Users can monitor the status of the running Livepatch server via many metrics, including (but not limited to):
- Rate of HTTP response status codes (e.g., 200, 404, or 403) for a range of percentile values.
- Rate of incoming HTTP requests per second.
- Database metrics (i.e., errors and response times).
For this purpose, there is an endpoint, named grafana-dashboard, which implements the grafana_dashboard interface and can be integrated with Grafana. Users can integrate other applications with this endpoint by using Juju as follows:
juju integrate canonical-livepatch-server-k8s:grafana-dashboard grafana-k8s:grafana-dashboardUsers can integrate Livepatch server with Prometheus to have it scrape the metrics. For this purpose, there is an endpoint, named metrics-endpoint, which implements the prometheus_scrape interface and can be integrated with Prometheus. Users can integrate other applications with this endpoint by using Juju as follows:
juju integrate canonical-livepatch-server-k8s:metrics-endpoint prometheus-k8s:metrics-endpointLivepatch can be optionally integrated with pro-airgapped-server via the pro-airgapped-server endpoint. Note that since the pro-airgapped-server is a machine charm, a cross-model relation is needed. Assuming there is a SaaS named pro-airgapped-server in the model, the integration can be done by using this command:
juju integrate canonical-livepatch-server-k8s:pro-airgapped-server pro-airgapped-serverLivepatch can be optionally integrated with Livepatch CVE service via the cve-catalog endpoint. This integration provides the Livepatch server with the information about CVEs fixed in Ubuntu kernels. The integration can be done by using this command:
juju integrate canonical-livepatch-server-k8s:cve-catalog canonical-livepatch-cve-k8sLivepatch provides an endpoint, named ingress, which can be integrated with the traefik-k8s charm (or any charm implementing the ingress interface) to expose the Livepatch server. To use this endpoint, set the ingress-interface config option to ingress:
juju config canonical-livepatch-server-k8s ingress-interface=ingress
juju integrate canonical-livepatch-server-k8s:ingress traefik-k8s:ingressNote: Only one ingress method can be active at a time. Set
ingress-interfaceto eitherlegacy-nginx-route(default) oringress. Thelegacy-nginx-routeoption exists for backward compatibility with existing deployments that already use thenginx-ingress-integratorcharm; new deployments should preferingressfor a more portable, Gateway API–aligned approach.
Livepatch can be optionally integrated with Tempo via the send-traces endpoint for OpenTelemetry distributed tracing. The charm supports both otlp_grpc and otlp_http protocols. Users can integrate using Juju as follows:
juju integrate canonical-livepatch-server-k8s:send-traces tempo-coordinator-k8s:tracingNote: The
tracing.enabledconfig option must also be set totrueto enable trace export.
Livepatch can export OpenTelemetry metrics via the send-otlp endpoint. This supports both gRPC and HTTP protocols. Users can integrate using Juju as follows:
juju integrate canonical-livepatch-server-k8s:send-otlp opentelemetry-collector-k8s:receive-otlpNote: The
otel-metrics.enabledconfig option must also be set totrueto enable OTLP metrics export.
Livepatch can be optionally integrated with a separate PostgreSQL (TimescaleDB) instance for time-series metrics storage via the metrics-db endpoint:
juju integrate canonical-livepatch-server-k8s:metrics-db postgresql-k8s:databaseNote: The
timescale_db.enabledconfig option must be set totrueto enable metrics database usage.
This charm uses an OCI image, built as a ROCK and published on GitHub Container Registry (GHCR) as ghcr.io/canonical/livepatch-server.
For more detailed instructions on deploying Livepatch server, please see the documentation for this service, available on the Livepatch website.
Please see the Juju SDK documentation for more information about developing and improving charms and Contributing for developer guidance.
The Livepatch K8s charm is free software, distributed under the Apache Software License, version 2.0. See License for more details.