Shopify/krane
67.8
Adequate · 19 September 2026
5.4k
lines of production code
Ruby
primary language
1
measurement over time
What this system is
Krane is a command-line tool for deploying and managing Kubernetes resources, supporting both namespaced and global cluster configurations. It processes YAML and JSON templates with ERB bindings to generate manifests, then applies them to a cluster while handling rollout strategies, pruning, and secret provisioning. The system provides specific logic for monitoring the status of various resource types, such as Deployments, StatefulSets, and DaemonSets, and includes utilities for restarting workloads and running one-off tasks.
How it got here
2017 — Krane rebranding and CLI redesign
13 changes.
The project was renamed from kubernetes-deploy to Krane, introducing a redesigned CLI with new subcommands and breaking changes to the public API. This period involved updating dependencies, enforcing stricter Ruby and Kubernetes tooling requirements, and restructuring the test infrastructure to support the new architecture and integration testing workflows.
2018–2025 — CLI introduction and comprehensive test coverage
17 changes.
This period focused on establishing the Krane command-line interface and implementing detailed rollout logic for a wide range of Kubernetes resource types. Significant effort was dedicated to expanding test coverage, including unit tests for core components and integration tests for the new CLI commands and deployment metrics.
Features
Add Krane CLI executable
A new executable script named 'krane' has been added to the project, allowing users to invoke the Krane CLI directly from the command line. This script initializes the Ruby environment and starts the Krane::CLI::Krane application with provided arguments.
exe · high confidence
Introduce Krane CLI with deploy, render, restart, run, and global-deploy commands
The library now includes a new command-line interface built on Thor, exposing five distinct commands: \deploy\ for shipping resources to a namespace, \global-deploy\ for non-namespaced cluster resources, \render\ for processing templates with ERB bindings and partials, \restart\ for restarting deployments, statefulsets, and daemonsets, and \run\ for executing a pod that completes a task. The CLI supports options for selectors, timeouts, pruning, and verification, and handles errors with specific exit codes for timeouts and failures.
lib/krane/cli · high confidence
Krane 3.9.0 introduces new resource management and deployment capabilities
This release adds dynamic cluster resource discovery to automatically identify and prune resources, introduces a new BindingsParser to support JSON, YAML, and CSV input formats, and adds configurable container overrides for image tags, commands, and environment variables. It also includes a new EjsonSecretProvisioner for automated secret generation, a configurable log line limit for container logs, and a minimum supported Kubernetes version of 1.22.0.
lib/krane · high confidence
Removals
Removal of version constant definition
The file defining the KubernetesDeploy gem's version constant has been deleted, removing the hardcoded version string '0.1.0' from the library's source code.
lib/kubernetes-deploy · high confidence
Behavioural changes
Comprehensive rollout logic for Kubernetes resource types
The \lib/krane/kubernetes\_resource\ library now includes explicit resource handlers for ConfigMap, CronJob, CustomResource, CustomResourceDefinition, DaemonSet, Deployment, HorizontalPodAutoscaler, Ingress, Job, NetworkPolicy, PersistentVolumeClaim, Pod, PodDisruptionBudget, PodSetBase, PodTemplate, ReplicaSet, ResourceQuota, Role, RoleBinding, Secret, Service, ServiceAccount, and StatefulSet. This introduces specific deployment success, failure, and status logic for each type, such as validating CustomResource rollout conditions via CRD annotations, handling DaemonSet node readiness and eviction, enforcing Deployment required-rollout strategies (full, maxUnavailable, none), supporting StatefulSet OnDelete update strategies, and allowing Service endpoint validation to be skipped via annotation.
_lib/krane/kubernetes\resource · high confidence
New CI and test runner scripts with updated local setup requirements
The repository introduces new \bin/ci\ and \bin/test\ scripts to standardize test execution, with \bin/ci\ running tests inside a Docker container using Ruby 2.7.6 and \bin/test\ handling local test dispatching with automatic parallelism detection. The \bin/setup\ script has been updated to explicitly check for and display warnings if \minikube\ or \kubectl\ (requiring version 1.22.0 or higher) are missing, ensuring developers have the necessary Kubernetes tooling before running tests. The legacy \bin/console\ script has been removed.
bin · high confidence
Project renamed to krane with redesigned CLI and public API
The tool has been renamed from kubernetes-deploy to krane (version 1.0.0), introducing a redesigned command-line interface and breaking changes to the public API. The main executable is now \krane\, with subcommands like \krane deploy\, \krane render\, \krane run\, and \krane restart\ replacing the previous \kubernetes-deploy\ and \kubernetes-render\ commands. The public Ruby API namespace changed from \KubernetesDeploy\ to \Krane\, and task classes (DeployTask, RenderTask, etc.) now use updated argument names (e.g., \filenames\ instead of \template\_paths\, \global\_timeout\ instead of \max\_watch\_seconds\) and keyword arguments. The CLI no longer renders ERB templates by default; users must pipe output from \krane render\ to \krane deploy --stdin\ to reproduce previous functionality. A new \krane global-deploy\ command and \GlobalDeployTask\ class were added to support deploying global (non-namespaced) resources, which are no longer supported by the standard deploy task.
(repo-wide) · high confidence
Test coverage
Add ERB-based test fixtures for collection rendering; Added CLI integration tests for Krane commands; Added ejson-cloud test fixtures for secrets and web deployment; Added invalid test fixtures for error handling validation; Added script to generate flamegraphs from integration tests; Added serial integration tests for deployment and task execution metrics; Added test fixture for custom partials directory support; Added test fixtures for Kubernetes deployment templates and partials; Added test fixtures for YAML partials support; Added test fixtures for empty resources; Added test fixtures for invalid resource validation; Added test fixtures for missing partial scenarios; Added test fixtures for partial rendering scenarios; Added unit test fixtures for Kubernetes resources and configuration parsing; Added unit tests for Krane Kubernetes resource deployment logic; Added unit tests for Krane core components; Added unit tests for cluster resource discovery, container logs, resource caching, and task configuration; Expanded test assertions for Kubernetes resource types in fixture sets; Expanded test fixtures for hello-cloud; Integration test coverage for Krane global deploy, restart, run, and render tasks; New test helper modules for cluster resource discovery, fixture deployment, and assertions; Refactored test infrastructure for Krane integration testing.
Dependencies
Gem renamed to Krane with dependency and Ruby version updates
The gem has been renamed from 'kubernetes-deploy' to 'krane', updating the gemspec to reflect the new name and authorship. The project now requires Ruby 2.7.6 or higher (up from unspecified/older versions) and upgrades the 'activesupport' dependency to version 5.0 or greater. Several runtime dependencies have been added or updated, including 'kubeclient' (\~\> 4.9), 'googleauth' (\~\> 1.2), 'ejson' (\~\> 1.0), 'colorize' (\~\> 0.8), 'statsd-instrument' (\>= 2.8, \< 3.9), 'multi\_json', 'concurrent-ruby' (\~\> 1.1), 'jsonpath' (\~\> 1.0), and 'thor' (\>= 1.0, \< 2.0). Development dependencies have also been expanded to include testing tools like 'minitest' (\~\> 5.19), 'mocha' (\~\> 2.1), 'webmock' (\~\> 3.18), and debugging tools like 'pry' and 'rubocop'. Additionally, the Gemfile now explicitly includes the 'ruby-lsp' development gem.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 68.
Lenses
- Code Health 97
- Architecture 100
- Maturity 57
- Readiness 65
- Security 84
Changes since last survey
- 300 commits — 265 feature/other, 35 fixes
By area
- (root) — 92 commits
- (repo) — 82 commits
- lib/krane — 70 commits
- test/integration — 15 commits
- .github/workflows — 11 commits
- test/fixtures — 9 commits
- test/unit — 7 commits
- .github/CODEOWNERS — 4 commits
- .shopify-build/krane.yml — 3 commits
- test/exe — 2 commits
- .buildkite/pipeline.nightly.yml — 1 commit
- .github/dependabot.yml — 1 commit
- .github/probots.yml — 1 commit
- test/helpers — 1 commit
- test/integration-serial — 1 commit
Notable commits
- fix: Another compatibility fix for Psych 4
- fix: Attempt core/v1 group fix
- fix: Fix #783 - Adding override for EnvoyFilter to use v1alpha3 (#784)
- fix: Fix CI
- fix: Fix ERB.new deprecations (#828)
- fix: Fix StatefulSet#deploy_succeeded? for OnDelete
- fix: Fix replace-force deployment method override (#890)
- fix: Fix compatibility with Psych 4
- fix: Fix kube server version check in deploy test
- fix: Fix local (client) dry-runs with kubectl 1.23.0
- fix: Fix namespace assumptions in some tests
- fix: Fix pruning endpointslices in 1.19+ CI regression (#823)
- fix: Fix rubocop
- fix: Fix test for hpa v2
- fix: Fix the way environment variable is passed to ejson (#759)
- fix: Increase timeout tolerance to fix flaky test
- fix: Merge pull request #778 from Shopify/discover-fix
- fix: Merge pull request #849 from Shopify/revert-845-cve
- fix: Merge pull request #854 from arbourd/fix-kubectl-1.23.0
- fix: Merge pull request #881 from Shopify/daemonset-deploy-fix
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Shopify/krane was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 278ce517f7adf47fdc30048af61f8b80a39db1c9 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.