Kruby Client
Ruby client for the kubernetes API.
Project Background
- Fork source: kubernetes-client/ruby.
- This project is forked from the original Kubernetes Ruby client codebase after official maintenance had effectively stalled.
- It is now maintained as a community-driven fork to keep pace with current Kubernetes API versions.
- This fork includes community-maintained modifications (packaging, compatibility fixes, CI/runtime requirements, and docs) in addition to OpenAPI-generated code.
Generation Policy
- Like other official Kubernetes clients, this client is generated from Kubernetes OpenAPI specifications.
- Code generation is performed with OpenAPI Generator, and the generated client is versioned to the target Kubernetes OpenAPI release.
Compatibility Matrix
| Kubernetes version | Kubernetes API (OpenAPI) | Client gem version |
|---|---|---|
| 1.31 | release-1.35 | 1.35.0.3 |
| 1.32 | release-1.35 | 1.35.0.3 |
| 1.33 | release-1.35 | 1.35.0.3 |
| 1.34 | release-1.35 | 1.35.0.3 |
| 1.35 | release-1.35 | 1.35.0.3 |
Requirements
- Ruby 3.3.0+
Installation
Add this gem to your Gemfile:
gem "kruby", "~> 1.35"Usage
require 'kruby'
require 'pp'
kube_config = Kubernetes::KubeConfig.new("#{ENV['HOME']}/.kube/config")
config = Kubernetes::Configuration.new()
kube_config.configure(config)
client = Kubernetes::CoreV1Api.new(Kubernetes::ApiClient.new(config))
pp client.list_namespaced_pod('default')For backward compatibility, require 'kubernetes' is also supported.
Contribute
Please see CONTRIBUTING.md for instructions on how to contribute.
Code of conduct
Participation in this repository is governed by the Code of Conduct.
Development
Update client
to update the client clone the gen repo and run this command at the root of the client repo:
${GEN_REPO_BASE}/openapi/ruby.sh kubernetes settingsFor a full, repeatable upgrade workflow (including verification and troubleshooting), see:
License
This program follows the Apache License version 2.0 (http://www.apache.org/licenses/ ). See LICENSE file included with the distribution for details.