定制 travisghansen/kubernetes-client-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

travisghansen/kubernetes-client-php

最新稳定版本:v0.4.5

Composer 安装命令:

composer require travisghansen/kubernetes-client-php

包简介

Kubernetes API client in PHP supporting REST operations and Watches

README 文档

README

No nonsense PHP client for the Kubernetes API. It supports standard REST calls along with watches for a continuous feed of data. Because no models are used it's usable with CRDs and other functionality/endpoints that may not be built-in.

Example

See sample.php

Watches

Watches can (will) stay connected indefinitely, automatically reconnecting after server-side timeout. The client will keep track of the most recent resourceVersion processed to automatically start where you left off.

Watch callback closures should have the following signature:

$callback = function($event, $watch)..

Receiving the watch allows access to the client (and any other details on the watch) and also provides an ability to stop the watch (break the loop) based off of event logic.

Other notes:

  • if using labelSelectors triggered events will fire with ADDED / DELETED types if the label is added/delete (ie: ADDED/DELETED do not necessarily equate to literally being added/deleted from k8s)

Development

Note on resourceVersion per the doc:

When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.

Note that it's only changes after the version.

TODO

  • Introduce threads for callbacks?
  • Do codegen on swagger docs to provide and OO interface to requests/responses?

Links

Async

统计信息

  • 总下载量: 22.38k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 37
  • 点击次数: 5
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 37
  • Watchers: 3
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 未知