All Projects → obmarg → Kazan

obmarg / Kazan

Licence: mit
Kubernetes API client for Elixir

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Kazan

Kubernetes Pfsense Controller
Integrate Kubernetes and pfSense
Stars: ✭ 100 (-22.48%)
Mutual labels:  k8s
Clearml Agent
ClearML Agent - ML-Ops made easy. ML-Ops scheduler & orchestration solution
Stars: ✭ 117 (-9.3%)
Mutual labels:  k8s
Elasticctr
ElasticCTR,即飞桨弹性计算推荐系统,是基于Kubernetes的企业级推荐系统开源解决方案。该方案融合了百度业务场景下持续打磨的高精度CTR模型、飞桨开源框架的大规模分布式训练能力、工业级稀疏参数弹性调度服务,帮助用户在Kubernetes环境中一键完成推荐系统部署,具备高性能、工业级部署、端到端体验的特点,并且作为开源套件,满足二次深度开发的需求。
Stars: ✭ 123 (-4.65%)
Mutual labels:  k8s
Libvirt K8s Provisioner
Automate your k8s installation
Stars: ✭ 106 (-17.83%)
Mutual labels:  k8s
K8gb
A cloud native Kubernetes Global Balancer
Stars: ✭ 113 (-12.4%)
Mutual labels:  k8s
Carvel Kwt
Kubernetes Workstation Tools CLI
Stars: ✭ 119 (-7.75%)
Mutual labels:  k8s
K8s Series
深入浅出 K8s:概念与部署 工作载荷 服务负载 存储 权限 网络 生态扩展
Stars: ✭ 99 (-23.26%)
Mutual labels:  k8s
Fx
A Function as a Service tool makes a function as a container-based service in seconds.
Stars: ✭ 1,679 (+1201.55%)
Mutual labels:  k8s
Owasp Workshop
owasp-workshop: Orchetraing containers with Kubernetes
Stars: ✭ 116 (-10.08%)
Mutual labels:  k8s
Training
Container, Monitoring & Logging, Cloud & DevOps Tutorials and Labs
Stars: ✭ 121 (-6.2%)
Mutual labels:  k8s
Php K8s
PHP K8s is a PHP handler for the Kubernetes Cluster API, helping you handling the individual Kubernetes resources directly from PHP, like viewing, creating, updating or deleting resources.
Stars: ✭ 111 (-13.95%)
Mutual labels:  k8s
Nghttpx Ingress Lb
nghttpx ingress controller for Kubernetes
Stars: ✭ 115 (-10.85%)
Mutual labels:  k8s
K8s Istio Observe Backend
Go-based microservices reference platform for demo of k8s observability with Istio
Stars: ✭ 121 (-6.2%)
Mutual labels:  k8s
Fusionauth Containers
Container definitions for docker, kubernetes, helm, and whatever containers come next!
Stars: ✭ 101 (-21.71%)
Mutual labels:  k8s
Ingress Merge
Merge Ingress Controller for Kubernetes
Stars: ✭ 124 (-3.88%)
Mutual labels:  k8s
Quiz
Example real time quiz application with .NET Core, React, DDD, Event Sourcing, Docker and built-in infrastructure for CI/CD with k8s, jenkins and helm
Stars: ✭ 100 (-22.48%)
Mutual labels:  k8s
Democratic Csi
csi storage for container orchestration systems
Stars: ✭ 120 (-6.98%)
Mutual labels:  k8s
K8s
Kubernetes Helm Charts for the ORY ecosystem.
Stars: ✭ 127 (-1.55%)
Mutual labels:  k8s
K8s
Deploying Kubernetes High Availability Cluster with Ansible Playbook
Stars: ✭ 125 (-3.1%)
Mutual labels:  k8s
Gitwebhookproxy
A proxy to let webhooks reach running services behind a firewall – [✩Star] if you're using it!
Stars: ✭ 123 (-4.65%)
Mutual labels:  k8s

Kazan

Kazan is a Kubernetes API client for Elixir. It uses the OpenAPI specifications provided by kube to generate most of it's functions and datastructures. This allows the whole kube API to be supported with relatively little effort.

Kazan should mostly work though it's not thoroughly tested against the actual kubernetes API. If you find a bug in the library please file an issue (or submit a PR) and I'll try and get it fixed.

I'm reasonably happy with the API at the moment so I don't expect to change it too drastically. However I can't speak for the k8s API specifications that the kazan code is generated from. Also the library is still pre-1.0 so if I find a better way to put it together I may end up changing things.

Looking for some help? Check out kazan's Gitter chatroom.

Features

  • Support for most Kubernetes API calls.
  • Structs for most Kubernetes API structures.
  • Documentation of all models & calls.
  • Client certificate, token and auth provider based authentication.
  • Loading config from kubeconfig files.
  • Support for watch requests.
  • Typespecs for functions and structs (though dialyzer outputs a lot of warnings when run on Kazan)
  • Limited support for custom resources. See the Kazan.Model documentation for more details.

Not Implemented

  • Other forms of authentication
  • Patching with application/json-patch+json or application/strategic-merge-patch+json content types.
  • Removing fields when patching with application/merge-patch+json.
  • Comprehensive tests.
  • Validation of requests.
  • Probably some other things.

Installation

If available in Hex, the package can be installed as:

  1. Add kazan to your list of dependencies in mix.exs:
def deps do
  [{:kazan, "~> 0.11"}]
end
  1. Ensure kazan is started before your application:
def application do
  [applications: [:kazan]]
end

Configuration

Kazan uses the Kazan.Server struct to contain server & authentication configuration details. Kazan.Server also provides some convenience functions to create a Kazan.Server from external sources such as a kube config file, or a kube service account.

If your application is only going to be talking to a single kubernetes cluster, then it's recommended to configure that cluster in your mix config. This makes working with kazan slightly easier, as you can call Kazan.run without providing a server every time.

In Cluster Authentication

If your code is going to be running on a kubernetes cluster and you wish to use the kubernetes service account that can be configured like this:

config :kazan, :server, :in_cluster

Alternatively, the Kazan.Server.in_cluster function can be used to create a server for passing straight into Kazan.run

Configuration via kube config file.

If you have a kube config file that contains the cluster & auth details you wish to use, kazan can use that:

config :kazan, :server, {:kubeconfig, "path/to/file"}

Alternatively, the Kazan.Server.from_kubeconfig function can be used to create a server for passing straight into Kazan.run

Configuring server details directly

If you wish to configure the server details manually, kazan can also accept a map of server parameters:

config :kazan, :server, %{url: "kubernetes.default" auth: %{token: "your_token"}}

See the Kazan.Server documentation to see what fields this supports.

Google Kubernetes Engine Config via gcloud

If developing against GKE, gcloud can create a kube config file that Kazan can understand. However, in this case you will need to call Kazan.Server.resolve_auth/2 in order to query gcloud for a valid token. See the docs for Kazan.Server.resolve_auth/2 for more details.

Usage

Making a request with Kazan is done in two stages.

  1. Build the request object using one of the functions in Kazan.Api.*.
  2. Run that request using Kazan.run.

For example, to get all of the pods from the server configured in the mix config:

Kazan.Apis.Core.V1.list_pod_for_all_namespaces!()
|> Kazan.run!()
# %Kazan.Models.V1.PodList{...}

Alternatively, you might want to specify the server to send the request to:

server = Kazan.Server.in_cluster()

Kazan.Apis.Core.V1.list_pod_for_all_namespaces!()
|> Kazan.run!(server: server)
# %Kazan.Apis.Core.V1.PodList{...}

More details on building requests can be found in the documentation for Kazan.Apis.

Details on creating watch requests can be found in the documentation for Kazan.Watcher.

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].