https://github.com/electrocucaracha/k8s-distroless-demo
Distress demo project
https://github.com/electrocucaracha/k8s-distroless-demo
distroless graalvm-native-image jdeps jlink kind registry
Last synced: about 2 months ago
JSON representation
Distress demo project
- Host: GitHub
- URL: https://github.com/electrocucaracha/k8s-distroless-demo
- Owner: electrocucaracha
- Created: 2024-10-31T19:12:53.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-04-04T01:17:18.000Z (about 2 months ago)
- Last Synced: 2025-04-04T02:24:28.715Z (about 2 months ago)
- Topics: distroless, graalvm-native-image, jdeps, jlink, kind, registry
- Language: Shell
- Homepage:
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Measuring the Benefits of Distroless Containers
[](https://opensource.org/licenses/Apache-2.0)
[](https://github.com/marketplace/actions/super-linter)
[](https://github.com/rubocop/rubocop)
[](https://github.com/boyter/scc/)
[](https://github.com/boyter/scc/)## Summary
This demo project highlights the advantages of using Distroless containers by evaluating key metrics such as image size, deployment time, and data transfer efficiency.
### Objectives
- **Image Size Reduction**: Compare the size of a standard container image with a Distroless version.
- **Deployment Time Improvement**: Measure the deployment time reduction achieved by using Distroless containers.
- **Data Transfer Efficiency**: Analyze the impact on network usage and costs when deploying to cloud environments.### Methodology
1. **Initial Setup**: Provision a Kubernetes cluster connected to a private Docker registry and create a standard container image, including build tools and a generic JRE.
1. **Implementation of Best Practices**: Utilize [Multi-stage builds][1] and [Distroless][2] best practices, along with tools like [jdeps][3] and [jlink][4] fro JRE optimization.
1. **Measurement**: Record metrics for image size, deployment time, and network usage during deployment to Kubernetes worker nodes.### Outcomes
- Successfully reduced image size from 863MB to just 22.3MB.
- Lowered deployment time significantly, from 67.506 seconds to 14.515 seconds.
- Achieved ~58x reduction in data transfer from the private local registry to the seven Kubernetes worker nodes.Using Distroless images can lead to monthly cost savings and minimize traffic congestion.
[1]: https://docs.docker.com/build/building/multi-stage/
[2]: https://github.com/GoogleContainerTools/distroless
[3]: https://dev.java/learn/jvm/tools/core/jdeps/
[4]: https://dev.java/learn/jvm/tools/core/jlink/