Skip to main content

A CD tool for updating image tags in Kubernetes manifests

Project description

Nautikos

Nautikos is a CLI tool for updating image tags in Kubernetes manifests, as part of a GitOps CI/CD process.

Rationale

In a GitOps CI/CD process, a deployment repo contains Kubernetes manifests for multiple services and environments, that are tracked by a tool like Argo-CD or Flux. When a new image of an application is created, you want the tags for that image to be updated in the manifests. 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: 
# An environment is basically a collection of manifests that you want to 
# update simultaneously. 
- name: prod 
  manifests: 
  - path: path/to/prod-env-1-file.yaml  # Path relative to configuration file
    type: kubernetes  # Type can be 'kubernetes', 'kustomize' or 'helm'
  - path: path/to/prod-env-2-file.yaml 
    type: kustomize
    repositories:  # Optional specification of repositories to be modified for more granular control
      - repository-b
      - repository-c
- name: dev
  manifests: 
  - path: path/to/dev-env-file.yaml
    type: helm

Next, you can run Nautikos to update the image tags of specific images in different environments.

nautikos --env prod repository-a 1.2.3  # Updates all occurences of the image `repository-a` to `1.2.3` in `prod-env-1-file.yaml`
nautikos --env prod repository-b 1.2.3  # Updates all occurences of the image `repository-b` to `1.2.3` in `prod-env-1-file.yaml` and `prod-env-1-file.yaml`
nautikos --env dev repository-c dev-1.2.3  # Updates all occurences of the image `repository-c` to `dev-1.2.3` in `dev-env-file.yaml`

Supported tools

The tool works with standard Kubernetes manifests, Kustomize, and Helm. 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 

# Helm 
image: 
- repository: some-repository 
  tag: tag 

Advanced usage

Nautikos takes several options:

  • --dry-run: prints the lines that would be modified, 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 sed - 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 CLI
  • ruamel.yaml - for handling YAML files while maintaining ordering and comments

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

nautikos-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

nautikos-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file nautikos-0.1.0.tar.gz.

File metadata

  • Download URL: nautikos-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.9 Windows/10

File hashes

Hashes for nautikos-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b7dfc36e153fcb4ceca50de792e5d323b13f027e3052cb298aa804503b741298
MD5 1409ce124e3f2b60e81f77e6b14e7f13
BLAKE2b-256 99dba618fb4f7d1c340ad2d75a3d0b1a5abe58746bedee5c2481ad81e39598da

See more details on using hashes here.

Provenance

File details

Details for the file nautikos-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nautikos-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.9 Windows/10

File hashes

Hashes for nautikos-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 010e8b5688e1b4da9ad20eaabbc566ce6d6e70785ad7db4668bc501b16880cca
MD5 e2b042c6b0617d24f1d06b8b02f92b3c
BLAKE2b-256 6fcf0b10ad2e8a4d40e4500929f2b81d347417b6f7cb9eb865b1deadcd05c17b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page