# `Bonny.Config`
[🔗](https://github.com/coryodaniel/bonny/blob/v1.5.0/lib/bonny/config.ex#L1)

Operator configuration interface

# `api_version`

```elixir
@spec api_version() :: binary()
```

Kubernetes APIVersion used. Defaults to `apiextensions.k8s.io/v1`

# `conn`

```elixir
@spec conn() :: K8s.Conn.t()
```

`K8s.Conn` name used for this operator.

# `controllers`

```elixir
@spec controllers() :: [atom()]
```

List of all controller modules to watch.

This *must* be set in config.exs:

```
config :bonny, controllers: [MyController1, MyController2]
```

# `group`

```elixir
@spec group() :: binary()
```

Kubernetes API Group of this operator

# `instance_name`

```elixir
@spec instance_name() :: binary()
```

The name of the operator instance.

This is set via environment variable `BONNY_POD_NAME`

# `labels`

```elixir
@spec labels() :: map()
```

Labels to apply to all operator resources.

*Note:* These are only applied to the resources that compose the operator itself,
not the resources created by the operator.

This can be set in config.exs:

```
config :bonny, labels: %{foo: "bar", quz: "baz"}
```

# `name`

```elixir
@spec name() :: binary()
```

The name of the operator.

Name must consist of only lowercase letters and hyphens.

Defaults to hyphenated mix project app name. E.g.: `:hello_operator` becomes `hello-operator`

# `namespace`

```elixir
@spec namespace() :: binary()
```

The namespace to watch for `Namespaced` CRDs.

Defaults to `default`

This can be set via environment variable:

```shell
BONNY_POD_NAMESPACE=prod # specific namespace
# or
BONNY_POD_NAMESPACE=__ALL__ # all namespaces
iex -S mix
```

Or via config.exs:
```
config :bonny, namespace: "mynamespace" # specific namespace
# or
config :bonny; namespace: :all # all namespaces
```

Configuration via environment variable always takes precedence over config.exs.

Bonny sets `BONNY_POD_NAMESPACE` on all Kubernetes deployments to the namespace the operator is deployed in.

# `service_account`

```elixir
@spec service_account() :: binary()
```

Kubernetes service account name to run operator as.

*Note:* if a kube config file is provided, this service account will still be created
and assigned to pods, but the *config file auth will be used* when making requests to the Kube API.

Name must consist of only lowercase letters and hyphens.

Defaults to hyphenated mix project app name. E.g.: `:hello_operator` becomes `hello-operator`

# `versions`

```elixir
@spec versions() :: binary()
```

Kubernetes API Versions of this operator

---

*Consult [api-reference.md](api-reference.md) for complete listing*
