• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

JuliaComputing/Kuber.jl: Julia Kubernetes Client

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

JuliaComputing/Kuber.jl

开源软件地址:

https://github.com/JuliaComputing/Kuber.jl

开源编程语言:

Julia 100.0%

开源软件介绍:

Kuber

Build Status

A Julia Kubernetes Client.

An easy to use API to access Kubernetes clusters from Julia. The Kuber.ApiImpl.Kubernetes submodule has the complete set of low level APIs and entities.

Most of the low level APIs fit into a common usage pattern. Kuber.jl makes it possible to use all of them with only a few intuitive verb based APIs. Verbs act on entities. Entities can be identified by names or selector patterns, or otherwise can apply to all entities of that class. Verbs can take additional parameters, e.g. when creating or updating entities.

API and Entity naming convention follows the standard Kubernetes API and Model naming conventions.

Here are a few helpful resources:

  • Tutorial on using Kuber.jl.
  • Article on using metrics and custom metrics with Kuber.jl

Entities:

Any Kubernetes entity supported. APIs identify an entity by symbol named as per Kubernetes naming convention.

  • :Namespace
  • :Pod
  • :ReplicationController
  • :Service
  • :PersistentVolume
  • :Job
  • ...

Methods/Verbs:

Kubernetes APIs are mapped to these easy to use verbs, familiar to Julia users.

  • get: list or fetch entities
  • list: list entities
  • put!: create entities
  • update!: update existing entities
  • delete!: delete existing entities
  • sel: creates a label selector to use with other verbs

All verbs have the signature:

verb(ctx::KuberContext, T::Symbol, args...; kwargs...)

Kubernetes also provides efficient change notifications on resources via "watches". Certain entities have the special watch APIs defined for them and that can be invoked with the watch verb. The watch API accepts a Channel through which it streams events.

watch(ctx::KuberContext, T::Symbol, outstream::Channel, args...; kwargs...)

In addition, verbs like get and list also support watches, and those can be invoked as:

watch(ctx, verb, args...; kwargs...) do stream
    for event in stream
        # process event
    end
end

E.g.:

watch(ctx, list, :Pod; resourceVersion=19451) do stream
    for event in stream
        @info("got event", event)
    end
end

Helper methods:

A Kubernetes context can be manipulated with:

  • set_server: Set the API server location ("http://localhost:8001" if not set)
  • set_ns: Set the namespace to deal with (default namespace is not set)
  • set_retries: Set the number of times an API call should be retried on a retriable error (5 if not set) and whether all APIs should be retried (only non mutating APIs are retried by default)

Other convenience methods:

  • kuber_type: identify the Julia object corresponding to the Kubernetes specification
  • kuber_obj: instantiate a Julia object from for the supplied Kubernetes specification
  • Helper methods for accessing metrics

References:




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Algocircle/Cascadia.jl: A CSS Selector library in Julia发布时间:2022-07-09
下一篇:
compressed/BackpropNeuralNet.jl: A neural network in Julia发布时间:2022-07-09
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap