-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
187 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,65 @@ | ||
# Kubegen | ||
|
||
Generate resource scoped Kubernetes clients with `Kubegen`. | ||
Generate resource based Kubernetes clients with `Kubegen`. | ||
|
||
[![Module Version](https://img.shields.io/hexpm/v/kubegen.svg)](https://hex.pm/packages/kubegen) | ||
[![Last Updated](https://img.shields.io/github/last-commit/mruoss/kubegen.svg)](https://github.com/mruoss/kubegen/commits/main) | ||
|
||
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/kubegen/) | ||
[![Total Download](https://img.shields.io/hexpm/dt/kubegen.svg)](https://hex.pm/packages/kubegen) | ||
[![License](https://img.shields.io/hexpm/l/kubegen.svg)](https://github.com/mruoss/kubegen/blob/main/LICENSE) | ||
[![License](https://img.shields.io/hexpm/l/kubegen.svg)](https://github.com/mruoss/kubegen/blob/main/LICENSE.md) | ||
|
||
## Installation | ||
|
||
`kubegen` is a code generator. Add the package as dev dependency: | ||
`kubegen` is a code generator. Add the package as dev dependency. Make sure to | ||
add `kubereq` to your list of dependencies as well: | ||
|
||
```elixir | ||
def deps do | ||
[ | ||
{:kubegen, "~> 0.1.0", only: :dev, runtime: false} | ||
{:kubegen, "~> 0.1.0", only: :dev, runtime: false}, | ||
{:kubereq, "~> 0.1.0"} | ||
] | ||
end | ||
``` | ||
|
||
The docs can be found at <https://hexdocs.pm/kubegen>. | ||
|
||
## Usage | ||
## Configuration | ||
|
||
### Configuration | ||
Before you can generate clients, you need to create a configuration in your | ||
`config.exs` under `config :kubegen, :default` or `config :kubegen, :mycluster`. | ||
where a custom `:mycluster` identifier is passed as argument | ||
(`mix kubegen -c mycluster`) | ||
|
||
- `:module_prefix` - The prefix of the generated modules (e.g. `MyApp.K8sClient`) | ||
- `:kubeconfig_pipeline` - The `Pluggable` pipeline responsible for loading the Kubernetes config. (e.g. `Kubereq.Kubeconfig.Default`) | ||
- `:resources` - List of resources for which clients are generated. | ||
|
||
The entries of `:resources` can be in the form of | ||
|
||
- Group-Version-Kind in the case of Kubernetes core resources. | ||
- Path to a local CRD YAML (multiple CRDs in one file are supported) | ||
- URL to a public remote CRD Yaml (multiple CRDs in one file are supported) | ||
|
||
### Example | ||
|
||
```ex | ||
config :kubegen, :default, | ||
module_prefix: MyApp.K8sClient, | ||
kubeconfig_pipeline: Kubereq.Kubeconfig.Default, | ||
resources: [ | ||
"v1/ConfigMap", | ||
"rbac.authorization.k8s.io/v1/ClusterRole", | ||
"test/support/foos.example.com.yaml", # local CRD | ||
"https://raw.githubusercontent.com/mruoss/kompost/main/priv/manifest/postgresdatabase.crd.yaml" # public remote CRD | ||
] | ||
``` | ||
|
||
### How to find the correct Group-Version-Kind identifier | ||
|
||
Use `mix kubegen.search` to search for GVKs (e.g. `mix.kubegen.search Pod`) | ||
|
||
### Generate Resource Clients | ||
|
||
Now you can (re-)generate clients using `mix kubegen` or `mix kubegen -c mycluster` |
Submodule kubernetes
updated
4 files
+139 −28 | CHANGELOG/CHANGELOG-1.30.md | |
+1 −1 | pkg/kubelet/volumemanager/cache/actual_state_of_world.go | |
+484 −3 | staging/publishing/rules.yaml | |
+31 −0 | test/e2e_node/oomkiller_linux_test.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.