File README.md of Package kea-container

# Kea DHCP server container

This container provides a Kea DHCP4/DHCP6 server inside a container.

# Usage

The container provides several labels that are intended to install everything
needed on the host and run the container(s) as a systemd service or manually.
The DHCP4 and DHCP6 servers are separate containers that can be run individually or at the same time.
Everything should be run as root!

## Pulling the container

As root run:
`podman pull registry.opensuse.org/suse/alp/workloads/tumbleweed_containerfiles/suse/alp/workloads/kea:latest`

## Installing

As root run:
`podman container runlabel install registry.opensuse.org/suse/alp/workloads/tumbleweed_containerfiles/suse/alp/workloads/kea:latest`
This installs:
* Default configs into `/etc/kea/`
* A keactrl wrapper into `/usr/local/bin/`
* Systemd service files for the dhcp4 and dhcp6 containers into `/etc/systemd/system/`

## Running the server(s)

### As a service

The service(s) can be started manually via:
`systemctl start kea-dhcp4.service` or `systemctl start kea-dhcp6.service`
or enabled to start them always at boot
`systemctl enable kea-dhcp4.service` or `systemctl enable kea-dhcp6.service`

### Manual

The containers can also be started without systemd via (run as root):
`podman container runlabel run registry.opensuse.org/suse/alp/workloads/tumbleweed_containerfiles/suse/alp/workloads/kea:latest` for dhcp4
`podman container runlabel run_dhcp6 registry.opensuse.org/suse/alp/workloads/tumbleweed_containerfiles/suse/alp/workloads/kea:latest` for dhcp6

## Configuring the server(s)

### Config files

The config files are located at `/etc/kea`. `kea-dhcp4.conf` for dhcp4 and `kea-dhcp6.conf` for dhcp6.
A default config is installed and further infos how to configure the server can be found
in the official documentation at https://kea.readthedocs.io/

### Using keactrl

A wrapper for the official `keactrl` tool is also installed that sends the commands to all existing containers.
The wrapper can be used like the official tool only that the `-s` option is replaced to work with the containers.
To send commands to the dhcp4 server use `-s dhcp4` and for dhcp6 `-s dhcp6`. If no `-s` is specified
it sends the commands to both the dhcp4 and dhcp6 containers, if they are started.
If changes are made to the config files mentioned above changes can be applied to the server via `keactrl reload`

## Uninstalling

As root run:
`podman container runlabel uninstall registry.opensuse.org/suse/alp/workloads/tumbleweed_containerfiles/suse/alp/workloads/kea:latest`
This uninstalls:
* The keactrl wrapper at `/usr/local/bin/`
* The systemd service files at `/etc/systemd/system/`
Note that it doesn't remove the configuration files. To remove these use the purge label.

## Purging the configuration files
As root run:
`podman container runlabel purge registry.opensuse.org/suse/alp/workloads/tumbleweed_containerfiles/suse/alp/workloads/kea:latest`
This removes:
* The whole `/etc/kea/` directory
Note that everything else installed is not removed by this label. To remove the other installed files use the uninstall label.
openSUSE Build Service is sponsored by