Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
.. image:: https://img.shields.io/pypi/v/portforward.svg :target: https://pypi.python.org/pypi/portforward
.. image:: https://img.shields.io/pypi/status/portforward.svg :target: https://pypi.python.org/pypi/portforward
.. image:: https://img.shields.io/pypi/dm/portforward :alt: PyPI - Downloads
.. image:: https://readthedocs.org/projects/portforward/badge/?version=latest :target: https://portforward.readthedocs.io/en/latest/?version=latest :alt: Documentation Status
.. image:: https://github.com/pytogo/portforward/actions/workflows/python-app.yml/badge.svg :target: https://github.com/pytogo/portforward/actions :alt: Build status
Easy Kubernetes Port-Forward For Python
Wheels are available for:
with Python versions:
Requirements for installation from source
The following things are required when there is no wheel available for the target system.
Rust
installed and available in the path (https://www.rust-lang.org/tools/install)Python
(at least v3.7 - below was never tested but might work)Pip knows how to install portforward
.
.. code-block::
pip install portforward
.. code-block:: Python
import requests
import portforward
def main():
namespace = "test"
pod_name = "web" # You can also use a service name instead
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()
.kube/config
from the home dir
or any other path to config.In case you want to develop on this library itself please take a look at the CONTRIBUTING page.
This project is enabled by PyO3_.
.. _PyO3: https://pyo3.rs
FAQs
Easy Kubernetes Port-Forward For Python
We found that portforward demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.