Simple k8s yaml generator for CTF challenges
Project description
Different wrapping
Basically a glorified YAML converter aimed at CTFs. The goal is that tasks can be written using docker-compose
, such that they can be easily quality tested. The docker-compose
files are then converted to k8s manifests using kompose, organized neatly in folders by challenge type and challenge name.
Metadata files are also generated:
image_buildlist.json
is a list of what containers need to be builtchallenge_container_metadata.json
explains what challenges have what kind of containers, so the frontend can show this to the user. It also contains information on what challenges have dynamic containers.
The intention of this tool is to run it in CI to generate metadata files to inform the rest of the platform. You can also run it locally, even just as a challenge linter. Run different_wrapping --help
for more info.
Different wrapping
is a component in an approach we are taking where instead of writing an elaborate system for deploying dynamic challenges, we try to re-use as much infrastructure between static and dynamic challenges as possible. We do this by creating "argocd-ready" kustomize projects - with the static project being actually hosted by argo and the dynamic ones being managed by a custom daemon.
Design goals
- Use standard k8s manifests where practical
- KISS
Requirements
- Python
- The requirements in pyproject.toml (
pip install -e .
to install the system and all dependencies so you can run it usingpython -m
) - Kompose, if you are building yaml
- Note that running
different_wrapping lint <directory>
is possible without installing kompose
- Note that running
Configuration
CLI
See different_wrapping --help
. Here is a possible out of date output:
$ different_wrapping convert --help
INFO:different_wrapping.cli:Different wrapping starting
usage: different_wrapping convert [-h] [--dry] [--dns_host DNS_HOST] folder destdir
positional arguments:
folder
destdir
options:
-h, --help show this help message and exit
--dry Does not write anything to the destination directory. Note that it will write to a
temporary directory, in order to test out running kustomize
--dns_host DNS_HOST
--docker_image_repo DOCKER_IMAGE_REPO
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file different_wrapping-1.0.25.tar.gz
.
File metadata
- Download URL: different_wrapping-1.0.25.tar.gz
- Upload date:
- Size: 26.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac4f42555859bc9ca5441176d93518b514aefe780ab979619b9b771eeb2330ec |
|
MD5 | ca107ad28aed2160147e03beea6d73ce |
|
BLAKE2b-256 | 3a474c2b3376859a57c055ead7ae3c0a81a55551f5ec66334afcde778e6b5f26 |
File details
Details for the file different_wrapping-1.0.25-py3-none-any.whl
.
File metadata
- Download URL: different_wrapping-1.0.25-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e21dbb5b5f2af70d74d8a64ee0dea4f4e6d926a365a3bdab46b3141cb645983e |
|
MD5 | f9c951f65000f2cdf0ad1aeb782c12a2 |
|
BLAKE2b-256 | db4dd6539870c417a3f3334d167595510d4d43c31994fb44778a8256fa3bbc6d |