-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1858 from SUSE/kea-dhcp
BCI image added for KEA DHCP
- Loading branch information
Showing
4 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"""KEA DHCP Server BCI container""" | ||
|
||
from bci_build.os_version import OsVersion | ||
from bci_build.package import ApplicationStackContainer | ||
from bci_build.package.versions import get_pkg_version | ||
|
||
_BASE_PODMAN_KEA_CMD = "podman run --replace -it --privileged --network=host" | ||
_KEA_DHCP4_CONFIG_PATH = "/etc/kea/kea-dhcp4.conf" | ||
_KEA_DHCP6_CONFIG_PATH = "/etc/kea/kea-dhcp6.conf" | ||
|
||
KEA_DHCP_CONTAINERS = [] | ||
KEA_SUPPORTED_OS_VERSIONS = [ | ||
OsVersion.SP7, | ||
OsVersion.TUMBLEWEED, | ||
] | ||
|
||
for os_version in KEA_SUPPORTED_OS_VERSIONS: | ||
KEA_DHCP_CONTAINERS.append( | ||
ApplicationStackContainer( | ||
name="kea", | ||
os_version=os_version, | ||
version=get_pkg_version("kea", os_version), | ||
license="MPL-2.0", | ||
is_latest=True, | ||
pretty_name="Kea DHCP Server", | ||
package_list=["kea", "util-linux"], | ||
custom_end=""" | ||
RUN mkdir -p /var/run/kea | ||
""", | ||
extra_labels={ | ||
"run": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp4 -v /etc/kea:/etc/kea IMAGE kea-dhcp4 -c {_KEA_DHCP4_CONFIG_PATH}", | ||
"runcwd": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp4 -v .:/etc/kea IMAGE kea-dhcp4 -c {_KEA_DHCP4_CONFIG_PATH}", | ||
"run_dhcp6": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp6 -v /etc/kea:/etc/kea IMAGE kea-dhcp6 -c {_KEA_DHCP6_CONFIG_PATH}", | ||
"runcwd_dhcp6": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp6 -v .:/etc/kea IMAGE kea-dhcp6 -c {_KEA_DHCP6_CONFIG_PATH}", | ||
}, | ||
exposes_ports=["67", "67/udp"], | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# {{ image.pretty_name }} Container Image | ||
|
||
{% include 'badges.j2' %} | ||
|
||
Kea is an open-source DHCP server developed by the [Internet Systems | ||
Consortium](https://www.isc.org/) and the successor of the now deprecated | ||
DHCPd. The Kea distribution includes a DHCPv4 server, a DHCPv6 server, and a | ||
Dynamic DNS (DDNS) server. Significant features include: support for IPv6 prefix | ||
delegation, host reservations (which may be optionally stored in a separate back | ||
end database), Preboot Execution Environment (PXE) boot, client classification, | ||
shared networks, and high-availability (failover pairs). Kea can store leases | ||
locally in a memfile, or in a PostgreSQL or MySQL database. Kea has a supported | ||
API for writing optional extensions, using 'hooks'. | ||
|
||
## How to use this Container Image | ||
|
||
|
||
The container image expects configuration file in the directory `/etc/kea`. | ||
Execute the following command to run DHCP using the configuration provided in the directory `/etc/kea`: | ||
|
||
```ShellSession | ||
podman container runlabel run \ | ||
{{ image.pretty_reference }} | ||
``` | ||
To run a DHCP6 server using the configuration file supplied in the directory `/etc/kea`, execute the following command: | ||
|
||
```ShellSession | ||
podman container runlabel run_dhcp6 \ | ||
{{ image.pretty_reference }} | ||
``` | ||
|
||
The Kea configuration file can also be provided in the current working directory. | ||
To run a DHCP or a DHCP6 server using the configuration file in the current working directory, execute the following commands: | ||
|
||
```ShellSession | ||
$ # for DHCP | ||
$ podman container runlabel runcwd \ | ||
{{ image.pretty_reference }} | ||
$ # for DHCP6 | ||
$ podman container runlabel runcwd_dhcp6 \ | ||
{{ image.pretty_reference }} | ||
``` | ||
|
||
{% include 'licensing_and_eula.j2' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters