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.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.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67842fe960f1d14f19b23261f0ea082a4a15e78d65a2eaa9f470fa20e1a6ae70 |
|
MD5 | ce565639dd8adc689798202addae587c |
|
BLAKE2b-256 | 4df4d8e040c30449db92ae2e6e46787d433ea7b7b23efb7be0c740cc3055f16b |
Hashes for portforward-0.2.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b909f31b23def89764991232597ef3b696c1b05accd24c5493fdc566e049c7a |
|
MD5 | cea249e057ac361e479451a2f276037c |
|
BLAKE2b-256 | 039168c938ee3304e33d82688f30195f0dfa7503eb1006537f2bef0cb4e005a6 |
Hashes for portforward-0.2.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 581e4ec8d833a5cac762c66762989312d58b788dfe4a15262eb2b15e180f3d2e |
|
MD5 | 9d470ae843a446c8ea6ccb56d4f447e0 |
|
BLAKE2b-256 | 29ad5b2d669c0e0225c26718785591dbd1e29dc2adf11da272b56895f7dff610 |
Hashes for portforward-0.2.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a596e91756c254ca1310f39383bc868f0a738c6ef5ed928c07733efdd0b3c8f |
|
MD5 | f45e3969bd867ad1d959fdbcc0ebdb0a |
|
BLAKE2b-256 | 0850303f33014963acee051e42114459cbf2c7f29483b149341b2aecb5a58c57 |
Hashes for portforward-0.2.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dc8ae85bb7e4abcb28e4d8c40586c1046a5135303d6e83c3a2c206605124068 |
|
MD5 | ffd6fed0a09ee4368bea2510b0818c10 |
|
BLAKE2b-256 | eb2a5d12efd409e119f24fcea34cb35e0470a8d68076d9033173eb1a4403035a |
Hashes for portforward-0.2.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 668f9e3ed049b7ee162bced2fbaeebc2245ae553ae358fe841e07da8457cce65 |
|
MD5 | 7e72d40d351a32ab0ebf837c4552e74d |
|
BLAKE2b-256 | 38b359d3c94c1b4e5a704c391d212199584d1392a40eb414f1cb6247e55098ca |
Hashes for portforward-0.2.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec3eea2653cb231097ca772a260530d128a619b72326c101d7883589f0937382 |
|
MD5 | fa7fe6c97cd02cf4a10524ba5520015b |
|
BLAKE2b-256 | 0d4eca096b40d2f902cbbd74d262723271d7b6d8c73df142f2bf68bed8670d11 |
Hashes for portforward-0.2.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 495e7627f29b4a75ebdf9d39129bcbf02485248dceeaf1592c45223022924381 |
|
MD5 | 62c915df370014932c199f0b0794857e |
|
BLAKE2b-256 | ef9baecddb3b3a77ef1d0685c438b625356a95769d71b076f852cc93a18f61aa |
Hashes for portforward-0.2.2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b654353f04f8418dd62c4e2051ee0a6240b3d5689a17ec943c33814a2c7210b |
|
MD5 | 518e0a1a50c38945965aafe2f7cc4bd7 |
|
BLAKE2b-256 | d35de86518e936037ef10bdb24ccf649d18aab623ca05ca7a11091713935a2af |
Hashes for portforward-0.2.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00dee8c5b5c862eb9a7397c82caf54b32871756e3793c863df590aa559c69364 |
|
MD5 | f03c17d2581e6628e7968164fa4e5006 |
|
BLAKE2b-256 | a6c08c60b413e0bb6d6e8efb40ec6286d565f7cbfffb0253d9c1b5fbf49be347 |
Hashes for portforward-0.2.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5455a2c52b5172360e2f6804e5f758861ecf3072664ef6e4cfce625e2a3a2d0 |
|
MD5 | 3cfe7815c7286ee00d43ed82a4f7dd2f |
|
BLAKE2b-256 | e094136535afe7a3c85b172ed72053ae669f36c2c0a5ea5c962ba056522cbd94 |
Hashes for portforward-0.2.2-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ba02698d9f81724957cbae1f400d6d285801bef6ae1ac77b93401013b877ccf |
|
MD5 | 3121a8708b2e82d0e99e35cada4caa5c |
|
BLAKE2b-256 | 4d40cae834505dc4a496fc535e4ca2ff9e5bca694f35c2f785bbe04cc5bd456d |