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.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.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75ef8a2720b65006ad9e112e9ed18d86d7628111e831a13233df9f77b53455da |
|
MD5 | b558d0bb3d72eac4653e8d3e9eb25446 |
|
BLAKE2b-256 | 0cd845093e7ae10eef91edebc0769825b9a0436080c2578071f2906bff83e4d1 |
Hashes for portforward-0.2.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e8f27719aa3e384e0b7a8feb6f3f977ec6f47aef32757db5f9d91db96182c81 |
|
MD5 | fd9eea3cc37e18cc7a75c69990385be2 |
|
BLAKE2b-256 | b09d3f2cc1e465b0b41b1d64e9a1e8a75b96caa1c698d9b548f7c833219c55ca |
Hashes for portforward-0.2.4-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d2892cf68126040be41759ac17150bd917a04aed2caa49434c4b94e8546bfb7 |
|
MD5 | 2f4457d8127f367bc29017f987d345a0 |
|
BLAKE2b-256 | 081161d629745779402685ba9d306bacae235ee6c8ed88ca2eff260e2e1dbdef |
Hashes for portforward-0.2.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62e2e461c3064d3cae68012e3a6e1739e632c387734f93e1065c8b393965c386 |
|
MD5 | c01f84863b33ea7a0466d6669a8eeee7 |
|
BLAKE2b-256 | 090b6f0dd3bd1a8ccd6a01183def86810e98ed96bb8edd0cce5f1e8fbfdc80c7 |
Hashes for portforward-0.2.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c149d38d39014bfcc1154c7fc3e10b5ef20e141ffd481c40817a8784ed2f6f4e |
|
MD5 | 264cddc2c89ebb8d1441479c3ba44938 |
|
BLAKE2b-256 | 0209c839a0055c722a8b037123fd5f24f34fa497b050853d3b501d8778550c14 |
Hashes for portforward-0.2.4-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cbf9116509bcbc59e2f2adc3c8fb1d6d981635ae1954f221f0fcaf58bb7e8bd |
|
MD5 | c171241b28efb2615dd8755a145dd7db |
|
BLAKE2b-256 | 543653c328a58e70226f533f752a9c2d8bfedf9eab1c797cfc6638be6521c1d7 |
Hashes for portforward-0.2.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b7f7ba9edb8262f6a75616bbb9d9a2338606262d9a4b11fbae97ae6060a42f2 |
|
MD5 | fd06c7b545512b4c988b36a44e048168 |
|
BLAKE2b-256 | 5d4065158d82f5812ae5368b76692a7593c22c02872a0f177561f99e384eabfc |
Hashes for portforward-0.2.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 232db042d14b70a636882d777038deed67ac20cbaeb011b907a1bce6d46914d5 |
|
MD5 | a0340ae4ed501241f412986cc82d7862 |
|
BLAKE2b-256 | d8e7c32e4db832faad1836c91917f44396d4498b6f56eb65d37ca1ed49d87bde |
Hashes for portforward-0.2.4-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebebb59b4b7ba88e36907507c4bc9acee7bc52f5b5f4ceb23547070affebb98b |
|
MD5 | bf6194e1b8255fa5c1edfbea3dcf8fed |
|
BLAKE2b-256 | e719d0eba4ada816ffd0f24c8470a8cf7bb41c0c63cf9b24f38f1aaf0e7b8a20 |
Hashes for portforward-0.2.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b4f63c4618549df66c6d2c8753df6d783625a6be835c878eff66a0859b793be |
|
MD5 | 30648356e176b40d8cc06686954c77c1 |
|
BLAKE2b-256 | de835aed5c94a87b1d36855c68027043dfd3545b724a77cd843ee64be0cc8f41 |
Hashes for portforward-0.2.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f67a160fddf259ac9f6f21997904a45cb5fa298a2108976e52476a8dec137872 |
|
MD5 | 9c7642db7e1bf03ca5d532f01fe0bb8c |
|
BLAKE2b-256 | 5577f1beb38f538df6c365fce8297297743656829833fa1f99fcd54174577c3d |
Hashes for portforward-0.2.4-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2b0e3efb2644ae371af198f518486ea73274908bec74a872ba82955c07a8669 |
|
MD5 | 32e668bf56b97026cf4b7f963d927f5a |
|
BLAKE2b-256 | 21c215515de263b8c8aed72c491b61df7998d9bd2d54a0211f0881a14dc9c529 |