Introduction
Disko is an open source tool, designed to manage and facilitate operations in disconnected (air-gapped) environments. It has three main features: Statistics of Images per Registry, Copy Images Between Registries and Migrate Images in Kubernetes.
For the full code, checkout Disko.
Prerequisites
- Python (Check out Python installation guide)
- Kubectl (Check out Kubectl installation guide)
- Docker (Check out Docker installation guide)
License
This project is licensed under the AGPL-3.0 License.
Installation
To use Disko, follow these steps:
- Clone this repository to your local machine:
$ git clone https://github.com/dpointk/disko
- Navigate to the project directory:
$ cd disko
- Install the required dependencies:
$ pip install -r requirements.txt
Getting Started with the Tool
- To run Disko, execute the following command in your terminal:
$ python3 disko.py
- Upon running the Disko application, you will encounter a window appearing on your screen the Images Registry Manager.
Images Registry Manager
Upon running the Disko application, you will encounter a window appearing on your screen the Images Registry Manager.
Statistics of Images per Registry
Once the cluster have been scanned, the main window will automatically update to display the following information for the scanned cluster:
- Registry Name
- Number of Images
- Percentage of Images
Note: As a result, you can view all the images in the cluster along with the timestamp of the scanning by clicking the Show Images Table button.
Copy Images Between Registries
This feature allows to take an image and copy it to the target registry.
- Click on the Change Registry button.
- A window will open for selecting an image to copy.
- Click on Confirm
- Another window will open where you can enter the target registry URL, Username, Password, and Tag.
- Then, click on Submit to execute the copy operation.
SHA256 Signature
Docker images are identified by tags by default, but tags can be mutable, meaning they can point to different images over time. Using a hash, ensures that the image is uniquely identified and immutable. Once an image is built and pushed to a registry, its hash remains constant, ensuring consistency and predictability in deployments.
Note: Finally, the hash file is created every copy, the data is saved in a file called sha256_hashes.txt.
Migrate Images in Kubernetes
This feature helps to move a cluster to a chosen registry. It does this by copying current images to the target registry, therefore, using these copies to run new pods. The migration process is happening by upgrading the helm chart with the new image.
- Click on Migrate Clusters button
- A cluster migration window will pop
- Enter target registry, tag, username, password, helm chart path
- Click the Submit button
Summary
In conclusion, this tool is very efficient for disconnected environments, enables several useful features, and helps you to manage and perform automated operations in your k8s cluster.