# `Tank.Pod`
[🔗](https://github.com/oshlabs/tank/blob/v0.2.0/lib/tank/pod.ex#L1)

A pod's desired state: one or more containers sharing a single network
namespace, the pod-level network and volumes, and a restart policy. The pod
`name` is the unique key (the Khepri path leaf under `[:tank, :pods, name]`).

  * `containers` — 1+ `Tank.Container`s, unique by name, sharing the netns.
  * `network` — a `Tank.Pod.Network` (the netns is the pod), or the shortcuts
    `:host` (share the host netns) / `:none` (isolated, loopback only).
  * `volumes` — pod-level `Tank.Volume`s; every container `Tank.Mount` must
    reference one by name.
  * `restart` — `:always` | `:on_failure` | `:never` (the reconciler owns
    backoff).

`new/1` accepts plain maps/keywords for the nested structs and normalises the
whole tree, so a hand-authored `runtime.exs` pod spec validates in one call.

# `network`

```elixir
@type network() :: Tank.Pod.Network.t() | :host | :none
```

# `t`

```elixir
@type t() :: %Tank.Pod{
  containers: [Tank.Container.t()],
  name: String.t(),
  network: network(),
  restart: :always | :on_failure | :never,
  volumes: [Tank.Volume.t()]
}
```

# `new`

```elixir
@spec new(map() | keyword()) :: {:ok, t()} | {:error, term()}
```

Build a validated pod (and its whole nested tree) from a map or keyword list.

# `new!`

```elixir
@spec new!(map() | keyword()) :: t()
```

Like `new/1` but raises `ArgumentError` on invalid input.

---

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