kubernetes-client
by fabric8io
A comprehensive Java client library providing fluent DSL access to Kubernetes and OpenShift REST APIs for container security and automation.
Java client for Kubernetes & OpenShift
Primary Use Case
This tool is primarily used by Java developers and DevOps engineers to interact programmatically with Kubernetes and OpenShift clusters, enabling cloud configuration scanning, container scanning, and security automation. It facilitates building custom integrations and automations around Kubernetes/OpenShift environments to enhance container security and operational workflows.
- Fluent DSL for Kubernetes and OpenShift REST APIs
- Supports full Kubernetes and OpenShift API access
- Modular architecture with extensions for Knative, Tekton, Chaos Mesh, Volume Snapshot, and Volcano
- Available via Maven Central with comprehensive Javadoc documentation
- Continuous integration with build, Sonar scanning, and end-to-end tests
- Active community support via Gitter chat
- Versioned releases with Maven and GitHub Actions integration
Installation
- Add the fabric8 Kubernetes client dependency to your Maven project:
- <dependency>
- <groupId>io.fabric8</groupId>
- <artifactId>kubernetes-client</artifactId>
- <version>[latest-version]</version>
- </dependency>
- For OpenShift support, add the openshift-client dependency similarly.
- Use Maven Central to resolve dependencies automatically.
- Refer to Javadoc for API usage and examples.
Usage
>_ new KubernetesClient()Instantiate a new Kubernetes client to interact with the cluster.
>_ client.pods().list()Retrieve a list of pods in the Kubernetes cluster.
>_ client.services().inNamespace("default").list()List all services in the 'default' namespace.
>_ client.resource(resource).create()Create a Kubernetes resource using the fluent DSL.
>_ client.extensions().knative()Access Knative resources via the Knative client extension.
- Leverage the fluent DSL to automate continuous cloud configuration and container security scanning within CI/CD pipelines.
- Integrate with custom security automation workflows to dynamically detect and remediate misconfigurations or vulnerabilities in Kubernetes/OpenShift clusters.
- Use the client to build bespoke detection tools that monitor API interactions for anomalous or suspicious activity indicative of attack.
- Combine with threat intelligence feeds to automate response actions such as isolating compromised pods or revoking access tokens.
- Enable purple team exercises by scripting attack simulations and defense validations directly against Kubernetes/OpenShift APIs.
Docs Take 2 Hours. AI Takes 10 Seconds.
Ask anything about kubernetes-client. Installation? Config? Troubleshooting? Get answers trained on real docs and GitHub issues—not generic ChatGPT fluff.
3 free chats per tool • Instant responses • No credit card
Related Tools

portainer
portainer/portainer
Making Docker and Kubernetes management easy.
slim
slimtoolkit/slim
Slim(toolkit): Don't change anything in your container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)
kubescape
kubescape/kubescape
Kubescape is an open-source Kubernetes security platform for your IDE, CI/CD pipelines, and clusters. It includes risk analysis, security, compliance, and misconfiguration scanning, saving Kubernetes users and administrators precious time, effort, and resources.
kube-bench
aquasecurity/kube-bench
Checks whether Kubernetes is deployed according to security best practices as defined in the CIS Kubernetes Benchmark
kubernetes-learning-path
techiescamp/kubernetes-learning-path
A roadmap to learn Kubernetes from scratch (Beginner to Advanced level)
kata-containers
kata-containers/kata-containers
Kata Containers is an open source project and community working to build a standard implementation of lightweight Virtual Machines (VMs) that feel and perform like containers, but provide the workload isolation and security advantages of VMs. https://katacontainers.io/
