Skip to main content

Kubernetes Port-Forward Go-Edition For Python

Project description

portforward

https://img.shields.io/pypi/v/portforward.svg https://img.shields.io/pypi/status/portforward.svg Documentation Status Build status

Kubernetes Port-Forward Go-Edition For Python

Quickstart

import requests

import portforward


def main():
    namespace = "test"
    pod_name = "web"
    local_port = 9000  # from port
    pod_port = 80  # to port

    # No path to kube config provided - will use default from $HOME/.kube/config
    with portforward.forward(namespace, pod_name, local_port, pod_port):
        response = requests.get("http://localhost:9000")
        print(f"Done: \n'{response.status_code}'\n'{response.text[:20]}...'")


if __name__ == "__main__":
    main()

Features

  • Go native Kubernetes port-forwarding with the .kube/config from the home dir or any other path to config.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

This project is enabled by setuptools-golang.

History

0.2.7 (2021-10-05)

  • Added missing import
  • Added type hint

0.2.6 (2021-10-05)

  • Fixed type hint

0.2.5 (2021-09-09)

  • Moved the actual portforward to own module

0.2.4 (2021-08-23)

  • Added adal import for Azure AD
  • Fixed host IPs with paths
  • Made timeout flexible

0.2.3 (2021-08-23)

  • Fixed case when hostIP contains a path
  • Added common and cloud provider auth plugins

0.2.2 (2021-08-23)

  • Fixed missing module portforward

0.2.1 (2021-08-19)

  • Decrease binary size if pre-compile wheels (Improvement of setuptools-golang)

0.2.0 (2021-08-14)

  • First Release on PyPI.
  • Made path to kube config variable.
  • Port-forwarding became non-blocking.
  • Fixed verification bug when port was None.
  • Added throwing own error.

0.1.0 (2021-08-09)

  • First release on Test PyPI.
  • Blocking port-forward with fixed path for kube config.

Project details


Download files

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

Files for portforward, version 0.2.7
Filename, size File type Python version Upload date Hashes
Filename, size portforward-0.2.7-cp36-cp36m-macosx_10_14_x86_64.whl (9.3 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size portforward-0.2.7-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (10.0 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size portforward-0.2.7-cp36-cp36m-win_amd64.whl (8.9 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size portforward-0.2.7-cp37-cp37m-macosx_10_14_x86_64.whl (9.3 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size portforward-0.2.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (10.0 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size portforward-0.2.7-cp37-cp37m-win_amd64.whl (8.9 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size portforward-0.2.7-cp38-cp38-macosx_10_14_x86_64.whl (9.3 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size portforward-0.2.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (10.0 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size portforward-0.2.7-cp38-cp38-win_amd64.whl (8.9 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size portforward-0.2.7-cp39-cp39-macosx_10_14_x86_64.whl (9.3 MB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size portforward-0.2.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (10.0 MB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size portforward-0.2.7-cp39-cp39-win_amd64.whl (8.9 MB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size portforward-0.2.7.tar.gz (39.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page