epik8s-tools
is a Python-based toolset for automating project structure generation, Helm chart creation, and deployment for EPICS (Experimental Physics and Industrial Control System) applications in Kubernetes environments EPIK8s. Designed to simplify complex deployment configurations, this package includes a command-line interface for rendering templates based on YAML configurations, making it easy to manage beamline and IOC (Input/Output Controller) configurations with a consistent structure. A simple guide to bring up a k8s single node cluster (extensible) is microk8s.
Features
- Project Structure Generation: Automatically create directories and files needed for EPICS-based projects.
- Helm Chart Creation: Generate Helm charts for Kubernetes deployments with custom values and templates.
- Docker compose Creation: Generate a docker compose file to run locally, iocs and services of a given epik8s configuration
- OPI Generation: Configure OPI (Operator Interface) panels for each beamline, including macros and settings.
- Support for Ingress and Load Balancers: Configurable settings for CA and PVA gateway IPs and ingress classes.
- Customizable Options: Extensive CLI options to adapt configurations to specific project needs.
Install EPIK8S tools
Code Block |
---|
language | bash |
---|
title | install epik8s tools |
---|
|
## create an environment
python3 -m venv epik8s
source epik8s/bin/activate
pip3 install epik8s-tools |
epik8s-gen
Create your beamline i.e e testbeamline
Code Block |
---|
language | bash |
---|
title | create test beamline |
---|
|
epik8s-gen epik8s-testbeamline --namespace testbeamline --beamlinerepogit https://baltig.infn.it/lnf-da-control/epik8s-testbeamline.git --iocbaseip "10.96.0.0/12" --cagatewayip 10.10.6.109 --pvagatewayip 10.10.6.110 --dnsnamespace "apps.k8s-da.lnf.infn.it" |
...
pvagatewayip = second unused IP from metallb metallb
epik8s-opigen
Create your beamline opi from a beamline yaml configuration
Code Block |
---|
language | shell |
---|
title | create opi for a beamline |
---|
|
epik8s-opigen --yaml tests/eli_values.yaml --projectdir eli-test-opi --controls polrev-icpdas01 polrev-icpdas02 |
epik8s-compose
Test your beamline yaml configuration in docker-compose.
You should first generate a docker file configuration with the tool.
Usage
Code Block |
---|
language | shell |
---|
title | create docker compose configuration |
---|
|
usage: epik8s-compose [-h] --config CONFIG --host-dir HOST_DIR [--output OUTPUT] [--services SERVICES [SERVICES ...]]
[--exclude EXCLUDE [EXCLUDE ...]] [--caport CAPORT] [--pvaport PVAPORT] [--htmlport HTMLPORT]
Generate docker-compose.yaml and config.yaml for EPICS IOC.
optional arguments:
-h, --help show this help message and exit
--config CONFIG Path to the configuration file (YAML).
--host-dir HOST_DIR Base directory on the host.
--output OUTPUT Output file for docker-compose.yaml.
--services SERVICES [SERVICES ...]
List of services to include in the output (default ALL).
--exclude EXCLUDE [EXCLUDE ...]
List of services to exclude in the output
--caport CAPORT Start CA access port to map on host
--pvaport PVAPORT Start PVA port to map on host
--htmlport HTMLPORT Start ingress (http) port on host
## example
epik8s-compose --config tests/eli_values.yaml --host-dir ./tests/eli_config --output docker-compose-eli.yaml --pvaport 5175 --exclude archiver |
Then you should run it using docker compose command.
Code Block |
---|
language | shell |
---|
title | run docker compose |
---|
|
docker compose -f docker-compose-eli.yaml up |