ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - coryodaniel/k8s: Kubernetes API Client for Elixir
Kubernetes API Client for Elixir. Contribute to coryodaniel/k8s development by creating an account on GitHub.
Visit Site

GitHub - coryodaniel/k8s: Kubernetes API Client for Elixir

GitHub - coryodaniel/k8s: Kubernetes API Client for Elixir

K8s

Module Version Coverage Status Last Updated

Build Status CI Build Status Elixir Build Status K8s

Hex Docs Total Download License

K8s - Kubernetes API Client for Elixir

Features

  • A client API for humans ๐Ÿ‘ฉ๐Ÿผ๐Ÿง‘๐Ÿ‘ฉ๐Ÿป๐Ÿ‘ฉ๐Ÿฝ๐Ÿ‘ฉ๐Ÿพ๐Ÿง‘๐Ÿป๐Ÿง‘๐Ÿฝ๐Ÿง‘๐Ÿง‘๐Ÿพ๐Ÿ‘จ๐Ÿผ๐Ÿ‘จ๐Ÿพ๐Ÿ‘จ๐Ÿฟ
  • ๐Ÿ”ฎ Kubernetes resources, groups, and CRDs are autodiscovered at boot time. No swagger file to include or override.
  • Client supports standard HTTP calls, async batches, wait on status โฒ๏ธ, and watchers ๐Ÿ‘€
  • โš™๏ธ HTTP Request middleware
  • Multiple clusters โš“ โš“ โš“
  • ๐Ÿ” Multiple authentication credentials
    • ๐Ÿค– serviceaccount
    • token
    • ๐Ÿ“œ certificate
    • auth-provider
    • Pluggable auth providers!
  • ๐Ÿ†— Tested against Kubernetes versions 1.10+ and master
  • ๐Ÿ› ๏ธ CRD support
  • ๐Ÿ“ˆ Integrated with :telemetry
  • โ„น๏ธ Kubernetes resource and version helper functions
  • ๐Ÿงฐ Kube config file parsing
  • ๐ŸŽ๏ธ Macro free; fast compile & fast startup

Installation

The package can be installed by adding :k8s to your list of dependencies in mix.exs:

def deps do
  [
    {:k8s, "~> 2.0"}
  ]
end

Usage

Check out the Usage Guide for in-depth examples. If you like learning with Livebook, check out kino_k8s. It comes with nice smart cells to help you generate your first working code.

Most functions are also written using doctests.

If you are interested in building Kubernetes Operators or Schedulers, check out Bonny.

tl;dr Examples

Configure a cluster connection

Cluster connections can be created using the K8s.Conn module.

K8s.Conn.from_file/1 will use the current context in your kubeconfig.

{:ok, conn} = K8s.Conn.from_file("path/to/kubeconfig.yaml")

K8s.Conn.from_file/2 accepts a keyword list to set the :user, :cluster, and/or :context

Connections can also be created in-cluster from a service account.

{:ok, conn} = K8s.Conn.from_service_account("/path/to/service-account/directory")

Check out the connection guide for additional details.

Creating a deployment

{:ok, conn} = K8s.Conn.from_file("path/to/kubeconfig.yaml")

opts = [namespace: "default", name: "nginx", image: "nginx:nginx:1.7.9"]
{:ok, resource} = K8s.Resource.from_file("priv/deployment.yaml", opts)

operation = K8s.Client.create(resource)
{:ok, deployment} = K8s.Client.run(conn, operation)

Listing deployments

In a namespace:

{:ok, conn} = K8s.Conn.from_file("path/to/kubeconfig.yaml")

operation = K8s.Client.list("apps/v1", "Deployment", namespace: "prod")
{:ok, deployments} = K8s.Client.run(conn, operation)

Across all namespaces:

{:ok, conn} = K8s.Conn.from_file("path/to/kubeconfig.yaml")

operation = K8s.Client.list("apps/v1", "Deployment", namespace: :all)
{:ok, deployments} = K8s.Client.run(conn, operation)

Getting a deployment

{:ok, conn} = K8s.Conn.from_file("path/to/kubeconfig.yaml")

operation = K8s.Client.get("apps/v1", :deployment, [namespace: "default", name: "nginx-deployment"])
{:ok, deployment} = K8s.Client.run(conn, operation)

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory