All Projects → tomplus → Kubernetes_asyncio

tomplus / Kubernetes_asyncio

Licence: apache-2.0
Python asynchronous client library for Kubernetes http://kubernetes.io/

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Kubernetes asyncio

Tornado Celery
Non-blocking Celery client for Tornado
Stars: ✭ 561 (+281.63%)
Mutual labels:  async, asyncio, asynchronous
Fooproxy
稳健高效的评分制-针对性- IP代理池 + API服务,可以自己插入采集器进行代理IP的爬取,针对你的爬虫的一个或多个目标网站分别生成有效的IP代理数据库,支持MongoDB 4.0 使用 Python3.7(Scored IP proxy pool ,customise proxy data crawler can be added anytime)
Stars: ✭ 195 (+32.65%)
Mutual labels:  async, asyncio, aiohttp
Peony Twitter
An asynchronous Twitter API client for Python 3.5+
Stars: ✭ 62 (-57.82%)
Mutual labels:  async, asyncio, asynchronous
Arsenic
Async WebDriver implementation for asyncio and asyncio-compatible frameworks
Stars: ✭ 209 (+42.18%)
Mutual labels:  async, asyncio, aiohttp
Aiohttp
Asynchronous HTTP client/server framework for asyncio and Python
Stars: ✭ 11,972 (+8044.22%)
Mutual labels:  async, asyncio, aiohttp
Chili
Chili: HTTP Served Hot
Stars: ✭ 7 (-95.24%)
Mutual labels:  async, asyncio, asynchronous
Aiormq
Pure python AMQP 0.9.1 asynchronous client library
Stars: ✭ 112 (-23.81%)
Mutual labels:  async, asyncio, asynchronous
Sketal
Бот для ВКонтакте. Беседы / группы / развлечения.
Stars: ✭ 119 (-19.05%)
Mutual labels:  async, asyncio
Purerpc
Asynchronous pure Python gRPC client and server implementation supporting asyncio, uvloop, curio and trio
Stars: ✭ 125 (-14.97%)
Mutual labels:  asyncio, asynchronous
Mioco
[no longer maintained] Scalable, coroutine-based, fibers/green-threads for Rust. (aka MIO COroutines).
Stars: ✭ 125 (-14.97%)
Mutual labels:  async, asynchronous
Kitchen Async
A Promise library for ClojureScript, or a poor man's core.async
Stars: ✭ 128 (-12.93%)
Mutual labels:  async, asynchronous
Edgedb Python
EdgeDB Python Driver
Stars: ✭ 113 (-23.13%)
Mutual labels:  asyncio, asynchronous
Drone
CLI utility for Drone, an Embedded Operating System.
Stars: ✭ 114 (-22.45%)
Mutual labels:  async, asynchronous
Aioinflux
Asynchronous Python client for InfluxDB
Stars: ✭ 142 (-3.4%)
Mutual labels:  asyncio, aiohttp
Tgfilestream
A Telegram bot that can stream Telegram files to users over HTTP.
Stars: ✭ 113 (-23.13%)
Mutual labels:  asyncio, aiohttp
Aioelasticsearch
aioelasticsearch-py wrapper for asyncio
Stars: ✭ 127 (-13.61%)
Mutual labels:  asyncio, aiohttp
Tornado Sqlalchemy
SQLAlchemy support for Tornado
Stars: ✭ 112 (-23.81%)
Mutual labels:  asyncio, asynchronous
Aiohttp Sse
Server-sent events support for aiohttp
Stars: ✭ 125 (-14.97%)
Mutual labels:  asyncio, aiohttp
Backendschool2019
Приложение для практического руководства по разработке бекенд-сервисов на Python (на основе вступительного испытания в Школу бэкенд‑разработки Яндекса)
Stars: ✭ 129 (-12.24%)
Mutual labels:  asyncio, aiohttp
Rubico
[a]synchronous functional programming
Stars: ✭ 133 (-9.52%)
Mutual labels:  async, asynchronous

Kubernetes Python Client

Build status PyPI version codecov pypi supported versions Client Capabilities Client Support Level

Asynchronous (AsyncIO) client library for the Kubernetes API.

This library is created in the same way as official https://github.com/kubernetes-client/python but uses asynchronous version of OpenAPI Generator. My motivation is described here: https://github.com/kubernetes-client/python/pull/324

Installation

From PyPi directly:

pip install kubernetes_asyncio

It requires Python 3.6+

OpenAPI generator

Starting from v9.0.0 OpenAPI generator is used to generate code instead of swagger-codegen. This change should be transparent from the client point of view.

Example

To list all pods:

import asyncio
from kubernetes_asyncio import client, config
from kubernetes_asyncio.client.api_client import ApiClient


async def main():
    # Configs can be set in Configuration class directly or using helper
    # utility. If no argument provided, the config will be loaded from
    # default location.
    await config.load_kube_config()

    # use the context manager to close http sessions automatically
    async with ApiClient() as api:

        v1 = client.CoreV1Api(api)
        print("Listing pods with their IPs:")
        ret = await v1.list_pod_for_all_namespaces()

        for i in ret.items:
            print(i.status.pod_ip, i.metadata.namespace, i.metadata.name)


if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
    loop.close()

More complicated examples, like asynchronous multiple watch or tail logs from pods, you can find in examples/ folder.

Compatibility

This library is generated in the same way as the official Kubernetes Python Library. It uses swagger-codegen and the same concepts like streaming, watching or reading configuration. Because of an early stage of this library some differences still exist:

synchronous library kubernetes-client/python this library
authentication method gcp-token, azure-token, user-token, oidc-token, user-password, in-cluster gcp-token (only via gcloud command), user-token, oidc-token, user-password, in-cluster
python 2.7 3.4 3.5 3.6 3.7 3.8 3.6 3.7 3.8
streaming data via websocket from PODs bidirectional read-only is already implemented

Versions

This library is versioned in the same way as the synchronous library. The first stable version is 7.0.0 and next major versions are comparable. This compatibility table describes this library too.

Development

Install the development packages:

pip install -r requirements.txt
pip install -r test-requirements.txt

You can run the style checks and tests with

flake8 kubernetes_asyncio/
isort --diff kubernetes_asyncio/
nosetests
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].