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.
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.
IOC Execution: Run IOC configurations directly using the epik8s-run tool.
epicsConfiguration.iocs is a map keyed by IOC name (the key is used as name when the entry does not define one). The legacy list form (- name: ...) is still accepted by all the tools.
Per-template defaults from iocDefaults are merged into every IOC; IOC-specific values always win.
Generating OPI Panels
To generate OPI panels from beamline YAML configuration files, you can use the epik8s-opigen tool. This tool reads a beamline configuration and produces a Phoebus project with a generated launcher and a local copy or link to the reusable epik8s-opi widget library. Generation of settings.ini is optional and disabled by default.
This command will generate the OPI panel files based on the configurations specified in the YAML file and save them in the specified output directory.
The generated Launcher.bob uses a dashboard layout rather than nested tabs:
Header banner with beamline name, IOC count, and namespace
Device-group sections (Motors, Cameras, Vacuum, etc.) each showing:
A section header with device count
One row per device with an embedded compact display (e.g., mot_channel.bob for motors) showing live status inline
An "Open ⬈" button per device that opens the full detail screen (e.g., Motor_Main.bob, Camera_Main.bob) in an independent Phoebus window
Services section showing gateways and load balancer IPs
This design replaces the previous tab-locked layout, allowing operators to simultaneously view and control devices of different types (e.g., motors and cameras) in separate windows.
Detailed Launcher
To generate a super-detailed per-IOC interface that includes PV monitoring and control panels, use the --detailed flag together with --pvlist-dir pointing to a directory containing runtime-generated PV lists:
The --pvlist-dir directory is expected to contain one subdirectory per IOC name, each with a pvlist.txt file (e.g., test-compose/iocs/motorsim/pvlist.txt).
This produces a Launcher_detailed.bob (customizable via --detailed-output) organized as:
Overview tab — beamline summary identical to the normal launcher.
Per-IOC tabs (one tab per IOC), each containing:
Info — static IOC metadata from the YAML (prefix, template, devices, parameters).
Per-device sub-tabs — PV readback (TextUpdate) and setpoint (TextEntry) widgets for every PV, automatically categorized by subsystem (e.g., Main, Roi1, Stats1, Proc1).
Other PVs — PVs that could not be matched to a known device.
All PVs — flat list of every PV published by the IOC.
PVs ending in _RBV are rendered as read-only TextUpdate widgets; all others are rendered as editable TextEntry widgets.
Specifying CA and PVA Gateway IPs
For projects that require external access to Channel Access (CA) and PV Access (PVA) gateways, you can specify the IP addresses for the respective load balancers using the --cagatewayip and --pvagatewayip options.
Generated notebook services are treated specially when --platform remains the default linux/amd64: epik8s-compose emits platform: ${NOTEBOOK_PLATFORM:-linux/arm64} for the notebook container. This avoids dead Jupyter kernels on Apple Silicon hosts while preserving amd64 as the default for the rest of the stack. Set NOTEBOOK_PLATFORM=linux/amd64 if you explicitly want the notebook container to use amd64 as well.
To keep notebook files persistent in compose, set epicsConfiguration.services.notebook.dataVolume.hostPath in the beamline YAML. Relative paths are resolved from the beamline config directory, so a config like this mounts a project folder into Jupyter workdir:
epik8s-compose will bind-mount that directory into /home/jovyan/work instead of generating the default notebook-work folder under the compose output.
If your site needs an HTTP proxy for runtime package installs, define top-level proxy keys in the beamline YAML and epik8s-compose will propagate them to generated container environments:
This is especially relevant for compose services that install Python packages at container startup, such as custom Python soft IOCs and the notebook service.
GitHub Actions
This repository includes GitHub workflows for CI, tag creation, and PyPI publishing.
Compose CI
Workflow: .github/workflows/compose-ci.yml
Runs on push and pull request to main
Tests epik8s-compose generation on sample configurations
Uploads generated compose artifacts for inspection