Skip to main content

Httpx transport that port-forwards into Kubernetes cluster

Project description

Httpx transport for Kubernetes

This is a plugin for the next generation HTTP client for Python that makes it possible to easily connect to local ports on pods in kubernetes, similar to kubectl port-forward.

Example:

import httpx
from httpx_kubernetes import KubernetesPortForwardTransport

mounts = {'kube://': KubernetesPortForwardTransport(context='mycontext')
# alternatively, create the CoreV1Api and pass it as 'api' keyword argument

async with httpx.AsyncClient(mounts=mounts) as c:
    response = await c.get('kube://podname.namespace:80/index.html')

Feel free to copy this code in your project to avoid dependency.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

httpx_kubernetes-0.1.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

httpx_kubernetes-0.1.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file httpx_kubernetes-0.1.0.tar.gz.

File metadata

  • Download URL: httpx_kubernetes-0.1.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Darwin/24.1.0

File hashes

Hashes for httpx_kubernetes-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f795876eea217e479de25538ac897a162f24a4bfaed842d2f6e0b0e8578f3ee
MD5 a6875dcc92e79a632135a48475d1c928
BLAKE2b-256 fa892e73c385b0a706d252b3e3796707f1d959dd714ab3ce649036c8df668441

See more details on using hashes here.

File details

Details for the file httpx_kubernetes-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: httpx_kubernetes-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Darwin/24.1.0

File hashes

Hashes for httpx_kubernetes-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f286950ff19ca26abfdb228769a25c4dcbd2301d596cbf5e641bf2cf7771c67b
MD5 8236ed3b5bfa68e55a47de7291cf8e79
BLAKE2b-256 1c4b59e6bee986a8c3a26ce0c0a5b755a642c4e0e22888a581af5b06bea55ada

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page