Kubernetes Port-Forward Go-Edition For Python
Project description
portforward
Kubernetes Port-Forward Go-Edition For Python
Free software: MIT license
Documentation: https://portforward.readthedocs.io.
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.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for portforward-0.2.6-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 938cb569ddc37bb6ccf5e39eaa6d1592c9e63d1a173124baa4119806ea7e83ed |
|
MD5 | 42dcbd1d3215f687bb50131832d1416e |
|
BLAKE2b-256 | 69d4ed659f1cccbaa3a98b35dce15e16736b278922614f8771e247c1a979dab7 |
Hashes for portforward-0.2.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c725c6d8fd7844b97a9b1f2f59fba652289d11f56c22299b7a29b8b8571fd412 |
|
MD5 | 34d7a7356dace01882036774e02bc05e |
|
BLAKE2b-256 | 13356cfe102b5854134693518cef20bc3d1b40e35c00d018fad9bfbe588dc660 |
Hashes for portforward-0.2.6-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9cca6a3486314c73b732b0927276548ec7126f62026a97be0aab0ac8cfa4afc |
|
MD5 | f1ed87631609d7877c2c492e41eca556 |
|
BLAKE2b-256 | 377a8f68231f44d1990e1959ccafcf87d3522f484b5905e405a3723da6ddb60f |
Hashes for portforward-0.2.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a1e22e5a3647d37f5dbe70615ec69a3eb97dc44332a22aca7d41e3a25223b57 |
|
MD5 | f3b2e8269ae1c4cfa12b5cddc6fd7a5f |
|
BLAKE2b-256 | a19a3168d2836af9e80b8df147d09a20f06130e085cf713f41c17cd291d1d9a3 |
Hashes for portforward-0.2.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a0d53f580fa15689cd0cb0502c9fbb859876ecf7574b7ede2af0241b1805a37 |
|
MD5 | c53ecf5940b5215962e713f4024e5a38 |
|
BLAKE2b-256 | 633b09c9bddceef82d12e754a32cd15d7007a67d518c35dc7bf12a6a90d3a3df |
Hashes for portforward-0.2.6-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0481c125cc8c024af372aa432e07a549b3b1f21a53d41ac263d638b7c4870a1 |
|
MD5 | 70dc66ed522f5474456b5079f527f043 |
|
BLAKE2b-256 | f89080cd88e37c423d4a19c7560c09c6a67b2dedc6158aeeae52b12417c93445 |
Hashes for portforward-0.2.6-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa0d3602ca6b145a019ddac249b9f8ac251f503b546f633486c7120761e3da50 |
|
MD5 | f6b09390d17cf77b35490ad578623d5e |
|
BLAKE2b-256 | 25aece978f5136ade02b45426456a8042ba298f30aa68d7f8bc202a54109e1d6 |
Hashes for portforward-0.2.6-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05bd740ceb0c931841cd5fb43a37f16b0c1daa3ed0e6f18893102f08cef76dc2 |
|
MD5 | 4b6d38192158bc11c37f6ed62ad1dc7d |
|
BLAKE2b-256 | 9835530ad507cc7254a785ba31217bbf0ba353dcf16aa6ceb73f40561ab9619a |
Hashes for portforward-0.2.6-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 495ed94aa18fa49335d46f3b730b2b465a70ff46b53fa91aea2c39f59e1f892a |
|
MD5 | 4b6bc7c4220bb60aa8da4a0071193251 |
|
BLAKE2b-256 | 0fb890d77a03e57e52694e731ff510fca9916359538c7979da97821ffe2ca768 |
Hashes for portforward-0.2.6-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d54568ae7e42571315a578df7e863a6cc8196a1aeaf85f601762d20d75e9d010 |
|
MD5 | fe21d6f03e461d91e85cf167d3714649 |
|
BLAKE2b-256 | 2a6d26099b2fb2f842867b81cfcfc80a32cb2dcc7bf80e2ed00a09992a426ee4 |
Hashes for portforward-0.2.6-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5123f855168b6c76207a5e25692db0bc364be8780043bfb445d3ed640236e73 |
|
MD5 | ae6d0529def24929a0141695f9f972c8 |
|
BLAKE2b-256 | 335aec68aa5436939dcf4b3dc679b9b073540c9dbb909a662ad6778ee1d97dbd |
Hashes for portforward-0.2.6-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66c24a5d00a1f10afbf7a92df236d66d5351e689d1d79bb5df963c5ced0f6033 |
|
MD5 | 74d66eb48f3f60bd8929e2ef20eb7d5f |
|
BLAKE2b-256 | 289b76b60542c865cf282386e99f0d9e6f32673dda5602f9de22ede06028e569 |