{"id":13507576,"url":"https://github.com/obmarg/kazan","last_synced_at":"2025-04-05T02:10:01.918Z","repository":{"id":15216460,"uuid":"77708567","full_name":"obmarg/kazan","owner":"obmarg","description":"Kubernetes API client for Elixir","archived":false,"fork":false,"pushed_at":"2023-03-17T13:30:01.000Z","size":844,"stargazers_count":139,"open_issues_count":18,"forks_count":35,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-02T19:59:15.443Z","etag":null,"topics":["elixir","k8s","kube","kubernetes"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/kazan","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obmarg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-12-30T20:25:10.000Z","updated_at":"2025-02-16T06:25:26.000Z","dependencies_parsed_at":"2023-01-14T00:45:07.646Z","dependency_job_id":"f9effa4c-02a4-43c8-a2a2-746b28bcd079","html_url":"https://github.com/obmarg/kazan","commit_stats":{"total_commits":150,"total_committers":16,"mean_commits":9.375,"dds":"0.19333333333333336","last_synced_commit":"50aceb99c4d1c9bdf2170454cb85b3b1964b5187"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obmarg%2Fkazan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obmarg%2Fkazan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obmarg%2Fkazan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obmarg%2Fkazan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obmarg","download_url":"https://codeload.github.com/obmarg/kazan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276189,"owners_count":20912288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","k8s","kube","kubernetes"],"created_at":"2024-08-01T02:00:36.418Z","updated_at":"2025-04-05T02:10:01.901Z","avatar_url":"https://github.com/obmarg.png","language":"Elixir","funding_links":[],"categories":["Cloud Infrastructure and Management"],"sub_categories":[],"readme":"# Kazan\n\nKazan is a Kubernetes API client for Elixir. It uses the OpenAPI specifications\nprovided by kube to generate most of it's functions and datastructures. This\nallows the whole kube API to be supported with relatively little effort.\n\nKazan should mostly work though it's not thoroughly tested against the actual\nkubernetes API.  If you find a bug in the library please file an issue (or\nsubmit a PR) and I'll try and get it fixed.\n\nI'm reasonably happy with the API at the moment so I don't expect to change it\ntoo drastically.  However I can't speak for the k8s API specifications that\nthe kazan code is generated from.  Also the library is still pre-1.0 so if I\nfind a better way to put it together I may end up changing things.\n\nLooking for some help? Check out `kazan`'s Gitter [chatroom](https://gitter.im/kazan-k8s/Lobby).\n\n### Features\n\n- Support for most Kubernetes API calls.\n- Structs for most Kubernetes API structures.\n- [Documentation of all models \u0026 calls](https://hexdocs.pm/kazan/Kazan.html).\n- Client certificate, token and auth provider based authentication.\n- Loading config from kubeconfig files.\n- Support for watch requests.\n- Typespecs for functions and structs (though dialyzer outputs a lot of\n  warnings when run on Kazan)\n- Limited support for custom resources.  See the `Kazan.Model` documentation\n  for more details.\n\n### Not Implemented\n\n- Other forms of authentication\n- Patching with `application/json-patch+json` or\n  `application/strategic-merge-patch+json` content types.\n- Removing fields when patching with `application/merge-patch+json`.\n- Comprehensive tests.\n- Validation of requests.\n- Probably some other things.\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed as:\n\n  1. Add `kazan` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:kazan, \"~\u003e 0.11\"}]\nend\n```\n\n  2. Ensure `kazan` is started before your application:\n\n```elixir\ndef application do\n  [applications: [:kazan]]\nend\n```\n\n## Configuration\n\nKazan uses the `Kazan.Server` struct to contain server \u0026 authentication\nconfiguration details. `Kazan.Server` also provides some convenience functions\nto create a `Kazan.Server` from external sources such as a kube config file, or\na kube service account.\n\nIf your application is only going to be talking to a single kubernetes cluster,\nthen it's recommended to configure that cluster in your mix config. This makes\nworking with kazan slightly easier, as you can call `Kazan.run` without\nproviding a server every time.\n\n### In Cluster Authentication\n\nIf your code is going to be running on a kubernetes cluster and you wish to use\nthe kubernetes service account that can be configured like this:\n\n```elixir\nconfig :kazan, :server, :in_cluster\n```\n\nAlternatively, the `Kazan.Server.in_cluster` function can be used to create a\nserver for passing straight into `Kazan.run`\n\n### Configuration via kube config file.\n\nIf you have a kube config file that contains the cluster \u0026 auth details you wish\nto use, kazan can use that:\n\n```elixir\nconfig :kazan, :server, {:kubeconfig, \"path/to/file\"}\n```\n\nAlternatively, the `Kazan.Server.from_kubeconfig` function can be used to create a\nserver for passing straight into `Kazan.run`\n\n### Configuring server details directly\n\nIf you wish to configure the server details manually, kazan can also accept a\nmap of server parameters:\n\n```elixir\nconfig :kazan, :server, %{url: \"kubernetes.default\" auth: %{token: \"your_token\"}}\n```\n\nSee the [`Kazan.Server`\ndocumentation](https://hexdocs.pm/kazan/Kazan.Server.html) to see what fields\nthis supports.\n\n### Google Kubernetes Engine Config via gcloud\n\nIf developing against GKE, gcloud can create a kube config file that Kazan can\nunderstand. However, in this case you will need to call\n`Kazan.Server.resolve_auth/2` in order to query gcloud for a valid token. See\nthe docs for `Kazan.Server.resolve_auth/2` for more details.\n\n## Usage\n\nMaking a request with Kazan is done in two stages.\n\n1. Build the request object using one of the functions in `Kazan.Api.*`.\n2. Run that request using [`Kazan.run`](https://hexdocs.pm/kazan/Kazan.html#run/1).\n\nFor example, to get all of the pods from the server configured in the mix config:\n\n```elixir\nKazan.Apis.Core.V1.list_pod_for_all_namespaces!()\n|\u003e Kazan.run!()\n# %Kazan.Models.V1.PodList{...}\n```\n\nAlternatively, you might want to specify the server to send the request to:\n\n```elixir\nserver = Kazan.Server.in_cluster()\n\nKazan.Apis.Core.V1.list_pod_for_all_namespaces!()\n|\u003e Kazan.run!(server: server)\n# %Kazan.Apis.Core.V1.PodList{...}\n```\n\nMore details on building requests can be found in the [documentation for\n`Kazan.Apis`](https://hexdocs.pm/kazan/Kazan.Apis.html#content).\n\nDetails on creating watch requests can be found in the [documentation for\n`Kazan.Watcher`](https://hexdocs.pm/kazan/Kazan.Watcher.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobmarg%2Fkazan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobmarg%2Fkazan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobmarg%2Fkazan/lists"}