The OpenShift Python Wrapper provides a simple and intuitive interface for interacting with OpenShift and Kubernetes clusters. It standardizes resource CRUD operations and offers additional capabilities that simplify cluster management.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/RedHatQE/openshift-python-wrapper/llms.txt
Use this file to discover all available pages before exploring further.
Requirements
The library requires Python 3.10 or higher.
Installation Methods
Install from PyPI (Recommended)
Install the latest stable version from PyPI using your preferred package manager:
uv is a fast Python package installer and is the recommended tool for managing dependencies.
Install from Source
For development or to use the latest features, install directly from the source repository:To use the local installation in another project:
Dependencies
The library automatically installs the following key dependencies:- kubernetes (>=31.0.0) - Official Kubernetes Python client
- timeout-sampler - Utilities for waiting and polling resources
- python-simple-logger - Logging utilities
- deepdiff - Deep comparison of resource states
- jsonschema - Schema validation for resources
- requests - HTTP library for API calls
Authentication Setup
The wrapper supports multiple authentication methods. Configure your cluster access using one of the following:Using kubeconfig (Default)
Using kubeconfig (Default)
The library automatically reads from your kubeconfig file:
Using Bearer Token
Using Bearer Token
Authenticate using an API token:
Using Username and Password
Using Username and Password
Authenticate with basic credentials (uses OAuth flow):
Using Configuration Dictionary
Using Configuration Dictionary
Pass kubeconfig as a dictionary:
Environment Configuration
Logging
Control the logging level for the wrapper:Proxy Configuration
Route traffic through a proxy server:Additional Features
Fake Kubernetes Client
For testing without a real cluster, use the built-in fake client:Command-Line Tools
The library includes command-line utilities:- class-generator - Generate resource classes from OpenShift API schemas
- openshift-mcp-server - MCP server for exposing OpenShift functionality
Next Steps
Quickstart Guide
Get started with basic operations and examples
Core Concepts
Learn about resources, clients, and patterns