Nautikos
A lightweight CI/CD tool for updating image tags in Kubernetes manifests.
Rationale
A GitOps CI/CD process often uses a deployment or ops repo containing Kubernetes manifests for multiple services and environments. Tools like Argo-CD or Flux then track these repo's, and apply any changes to the cluster. When a new image of an application is created, you want the corresponding tags to be updated in the manifests housed in the deployment repo. Doing this manually is error prone. Having to write logic in every repo or pipeline to perform this is tedious.
This is where Nautikos comes in.
Installation
pip install nautikos
Basic usage
Nautikos is configured through a YAML-file (./nautikos.yaml), that specifies where the manifests for the different images and environments can be found:
environments:
- name: prod
manifests:
- path: prod/app1/deployment.yaml # Path relative to configuration file
type: kubernetes # Type can be 'kubernetes' or 'kustomize'
labels: # Optional specification of labels for more granular control
- app1
- refs/heads/main
- path: prod/app2/kustomize.yaml
type: kustomize
- name: dev
manifests:
- path: dev/app1/deployment.yaml
type: kubernetes
labels:
- app1
- refs/heads/dev
- path: dev/app3/feature-A/deployment.yaml
type: kubernetes
labels:
- app1
- refs/heads/feature-A
Next, you can run Nautikos to update the image tags of specific images in different environments.
nautikos my-repo 1.2.3 # Updates all occurences of `my-repo` to `1.2.3` in all manifests
nautikos --env prod my-repo 2.3.4 # Updates all occurences of `my-repo` to `2.3.4` in `prod/app1/deployment.yaml` and `prod/app2/deployment`
nautikos --env dev --labels app1 my-repo 4.5.6 # Updates all occurences of `my-repo` to `4.5.6` in `dev/app1/deployment.yaml`
nautikos --labels 'app1,refs/heads/main' my-repo 5.6.7 # Updates all occurences of `my-repo` to `5.6.7` in `prod/app1/deployment.yaml`
Supported tools
The tool works with standard Kubernetes manifests and Kustomize - Helm might be added later. Each have their own format for defining image tags.
# Kubernetes manifests
spec:
template:
spec:
containers:
- image: some-repository:tag
# Kustomize
images:
- name: some-repository
newTag: tag
Advanced usage
Nautikos takes several options:
--dry-run: prints the modified files to stdout, but doesn't edit in place--config config-file.yaml: path to config YAML, default is./nautikos.yaml
Alternatives
There are basically three alternatives to do the same thing:
- Update manifests manually - of course this works, but this is not really proper CD
- Write your own bash scripts in a pipeline using a tool like
sedoryq- This works, but having to write this logic for every project is tedious. - Use a tool like Argo-CD Image updater - very nice, but a bit heavy-weight, not very actively developed, and doesn't seem to support Azure Container Registry.
Notes
Multiple YAML docs in one file is not yet supported.
Dependencies
typer- for creating a CLIruamel.yaml- for handling YAML files while maintaining ordering and comments
Metadata
Release files for nautikos 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nautikos-0.3.4.tar.gz | 5.3 kB | Without provenance | Details for nautikos-0.3.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nautikos-0.3.4-py3-none-any.whl | Python 3 | none | any | Details for nautikos-0.3.4-py3-none-any.whl |
Total release size: 11.6 kB
Release files / nautikos-0.3.4.tar.gz
| Download URL | nautikos-0.3.4.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9bb0b89fca0b5c704b02fe02b184f12973c210c6b41953a3b7f9f5b92bd5d1ff
|
|
BLAKE2b-256 checksum How to use checksums |
0b59a4a2ddf2baf5270ad7ec092c8aeef5b1732c3b3454c8d3fd4d2663c5ebd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / nautikos-0.3.4-py3-none-any.whl
| Download URL | nautikos-0.3.4-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4bc34d3814f82c6b70b67b373156e79098a804bd6264e1283be1ea3383e64b4
|
|
BLAKE2b-256 checksum How to use checksums |
191dd228dbe3432aa95c8886c644fb775447973f142c3fbd65d4904fdb985fb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for nautikos 0.3.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.