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.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
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.7-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74c634fca05f2ff27901a11ab4745c603e9535ed391d05912f3f2b49b2b46dd8 |
|
MD5 | 27e08048fa5b7f4476dbfcfda4f54f6e |
|
BLAKE2b-256 | 1b36c90c8a54f7ef61e333897aa0164723ec240f1b02d77e540667e2a9992933 |
Hashes for portforward-0.2.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e838a5a9d4be2658940a96b731c953f81f347e970c9ea4482c07b15c7ee3cd59 |
|
MD5 | 149a1519a66108f6fdf3e8e194517f79 |
|
BLAKE2b-256 | 441d7ff586b386123d1c88c97af344054d65f66cf36457ca517ce3c076be1ced |
Hashes for portforward-0.2.7-cp310-cp310-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d94e14905a597f3ab657730db3606a3178f95a51017543dd29a696ca5421afc1 |
|
MD5 | 523d8b11f26ec773319935dde6d87adc |
|
BLAKE2b-256 | 2d66af96d6115529e10ed310c5d65f2739f618072d443c3acc51b9196f5cf928 |
Hashes for portforward-0.2.7-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a5e51122ab52eb88d1c59141b1734f8344fcd5772a090f3357d859065ef19f1 |
|
MD5 | 7df7ce8055e5f5b6a5d88dd2ad7541ac |
|
BLAKE2b-256 | f8bc8f9e6e67f6ba62f421570ee76d7d27b5f68ef0cb3e6d9e1c72f9251e9b71 |
Hashes for portforward-0.2.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f81aba1a27e5d1499cb4b075cf2767e633b242ebcf6082dc29f3406f7bfed08b |
|
MD5 | 103e0aadbb5012a68e97d38666dfb299 |
|
BLAKE2b-256 | c2ec2b8d291a35a32ba7b8af099c4941e55d735975ce05178939e048fc8910a6 |
Hashes for portforward-0.2.7-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e41ff4639c9ec2060f9addc57d7d7934eb899954f593ed35031b1943c60964f |
|
MD5 | 13c5bed68853ae8c7ce844363f66feb1 |
|
BLAKE2b-256 | 803d9a28e1b86d9dac8cd4777547c07ccf4348ca3ec34582201e7d986c0ebadc |
Hashes for portforward-0.2.7-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba9b361f5247151be327e85019602811a779c8b90f5ef8ef503a5a3b637686e2 |
|
MD5 | a84412457012455ece2b0fb9cbaa2a34 |
|
BLAKE2b-256 | 81b2aa079309442ddc721b735518dcf56e0b244e4ce824abef64fc718934338b |
Hashes for portforward-0.2.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e63feee6535cb6b61e8bc2cfa6a7ae544eb3c44eb39b52f6806470b0d2a6f381 |
|
MD5 | 3d0d5dcb34007fd5238f52f06e0abf3c |
|
BLAKE2b-256 | ed49d38c14c9596a05911e66637838d152bfd7ae2d2df467e0d82e2c840b2228 |
Hashes for portforward-0.2.7-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 102385b62fa5cdfee42011cd315fbebbe734106140981c3c6b9ea5849a45fd33 |
|
MD5 | d212092b0af1d93b7b106cd9294c9dc0 |
|
BLAKE2b-256 | 7bfc38c63c8ef12ea3fb572936d1e3b3344092fd897fd9611b01330de66584c3 |
Hashes for portforward-0.2.7-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26fd7c68b8c9da4dfa670c836ac9354dfd14e6597d4303f7396186deb8f85dc4 |
|
MD5 | aae68e9d40ebb686b41684673c9b8559 |
|
BLAKE2b-256 | 560fde6ea5fdc1ced3055d2dfab8c4e2bd39efc8f4ceb0e33d112061ec6b53fc |
Hashes for portforward-0.2.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41fc32c726f47e18c9a5f9512bfa7df3bc7560214cfa9e7430cac9d05d736a02 |
|
MD5 | 6ff512a6fedf2cd8739b8a3a56f47fd7 |
|
BLAKE2b-256 | 663f9f8dfc27cba5a621ade5d015f972a2bf5ee93cff3a2056b974314faec5e5 |
Hashes for portforward-0.2.7-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1b727f9c4c53ba98342295cc4e52fddb110b34efcbc54033bf4070156862d79 |
|
MD5 | d447dc9318f54695a047c91617a996e4 |
|
BLAKE2b-256 | f09c838a7fdb5471bdd236f78e1090d93ed7c4740baefb4dfe92a3ff75b351d3 |
Hashes for portforward-0.2.7-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5a2ec9b38b2877b8da100d13c4f8a287cb2b168dfc27d09239a046f6e28b0cd |
|
MD5 | c2a5dc052c456de56174d85178dd244e |
|
BLAKE2b-256 | 8bb2bdcd1a17820b9d7f602a56a41fe6e2843988743a5e44c34330ce1c298584 |
Hashes for portforward-0.2.7-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 368a41539539c2d69448079b44ae0ef05f6b8741b306d7d791d1ef4989c54b1c |
|
MD5 | d44e0fda0f3d0792fd378e2b4cb1bc97 |
|
BLAKE2b-256 | d2bc4d9d1c116201f7e0682007a8b3adcb43726ef540e5f3132126dd3bfedcf5 |
Hashes for portforward-0.2.7-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e182401baa7f047b10b2e829fe9bbba0598d58b6cefa8308a075db7e45c6a820 |
|
MD5 | 71300b6a658832a08db40c209c6d706a |
|
BLAKE2b-256 | ca8f63bce7f2164bab2f337172ac0cdd5bec2c9410bb464039c2f83ac4fc7032 |