Giter Club home page Giter Club logo

kubernetes-client-php's Introduction

Intro

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

kubernetes-client-php's People

Contributors

travisghansen avatar willnewby avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.