Swiss army knife toolbox for a devops engineer.
Project description
tkdp-toolbox
Swiss army knife toolbox for a devops engineer.
Installation
pip install tkdp-toolbox
After installation the tkdptoolbox (and tkdp-toolbox) commands will be available on your PATH.
Commands
mirror — Mirror images and Helm charts to a private registry
Reads a sources.yaml file and mirrors container images and Helm charts from public registries into your private registry.
Prerequisites
- Docker must be installed and you must already be logged in to your target Docker registry before running this command (
docker login <registry>). The tool does not handle Docker authentication. - Helm must be installed and available on your PATH.
- Helm chart uploads are supported for Nexus3 hosted Helm repositories only. You will be prompted for credentials at runtime if any charts are present in the sources file.
Usage
# Run from the directory containing sources.yaml
tkdptoolbox mirror
# Specify a sources file explicitly
tkdptoolbox mirror --sources /path/to/sources.yaml
# Preview what would happen without executing anything
tkdptoolbox mirror --dry-run
sources.yaml format
groups:
<group-name>:
images:
- source: <registry>/<image>:<tag>
charts:
- chart: <chart-name>
repo: <helm-repo-url>
version: <version>
target-repo:
docker: <target-docker-registry> # e.g. ctr.local
helm: <nexus3-host>/<repository-name> # e.g. repo.local/helm
Multiple groups can be defined; they are processed in order.
Example sources.yaml
groups:
monitoring:
images:
- source: docker.io/grafana/grafana:12.3.0
- source: ghcr.io/grafana/grafana-operator:v5.21.4
- source: quay.io/prometheus/prometheus:v3.9.1
charts:
- chart: kube-prometheus-stack
repo: https://prometheus-community.github.io/helm-charts
version: 80.13.3
- chart: grafana-operator
repo: https://grafana.github.io/helm-charts
version: 5.21.4
target-repo:
docker: ctr.local
helm: repo.local/helm
How images are mirrored
Each image is pulled from its source, retagged, and pushed with the target registry prepended:
docker.io/grafana/grafana:12.3.0 → ctr.local/docker.io/grafana/grafana:12.3.0
ghcr.io/grafana/grafana-operator:v5.21.4 → ctr.local/ghcr.io/grafana/grafana-operator:v5.21.4
This preserves the full original path under the target registry, making it easy to see the origin of each image.
How Helm charts are mirrored
Charts are pulled from their source Helm repository using helm pull and uploaded to the Nexus3 hosted Helm repository via the Nexus3 REST API (POST /service/rest/v1/components?repository=<name>).
Note: Only Nexus3 hosted Helm repositories are supported as the chart upload target. Credentials are prompted once at startup if any charts are present.
The helm value in target-repo must be in the form <host>/<repository-name>, where <repository-name> matches the name of the hosted Helm repository in Nexus3.
Options reference
| Command | Option | Description |
|---|---|---|
mirror |
--sources FILE |
Path to sources.yaml. Defaults to ./sources.yaml. |
mirror |
--dry-run |
Print all commands and API calls without executing them. |
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tkdp_toolbox-0.2.0.tar.gz.
File metadata
- Download URL: tkdp_toolbox-0.2.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f829f5cc53ce2f080e7a51cee60cfae11e688e6e01227f667b5dfc3c37121e58
|
|
| MD5 |
dc1948a3cdfdfb9147c3abe2a8a2901c
|
|
| BLAKE2b-256 |
d6aec3a25e3b0558b7879de307c495e750f21a754b7c244e318848dbbdda619d
|
Provenance
The following attestation bundles were made for tkdp_toolbox-0.2.0.tar.gz:
Publisher:
publish.yml on tkdpython/tkdp-toolbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tkdp_toolbox-0.2.0.tar.gz -
Subject digest:
f829f5cc53ce2f080e7a51cee60cfae11e688e6e01227f667b5dfc3c37121e58 - Sigstore transparency entry: 1008949233
- Sigstore integration time:
-
Permalink:
tkdpython/tkdp-toolbox@c0d77bce496ed99deb5d5a5ab7e4803f29aeab18 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/tkdpython
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c0d77bce496ed99deb5d5a5ab7e4803f29aeab18 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tkdp_toolbox-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tkdp_toolbox-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddb69ee72807f221c36f7f934590ab67b3df427940df88a36b962a7a58e97726
|
|
| MD5 |
080c61247a0d4ba25ac2560cbdd4178e
|
|
| BLAKE2b-256 |
1a65d6291f98b13beab24d7f7f8ca3ed9e506fdcf489b393b529240e89d28d8f
|
Provenance
The following attestation bundles were made for tkdp_toolbox-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on tkdpython/tkdp-toolbox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tkdp_toolbox-0.2.0-py3-none-any.whl -
Subject digest:
ddb69ee72807f221c36f7f934590ab67b3df427940df88a36b962a7a58e97726 - Sigstore transparency entry: 1008949381
- Sigstore integration time:
-
Permalink:
tkdpython/tkdp-toolbox@c0d77bce496ed99deb5d5a5ab7e4803f29aeab18 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/tkdpython
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c0d77bce496ed99deb5d5a5ab7e4803f29aeab18 -
Trigger Event:
release
-
Statement type: