# Namespace and ResourceGroup spec

URL: /docs/develop/tenancy-and-limits/namespaces/spec

Every field of Namespace and ResourceGroup: its type, its limits and its description.

This page lists the spec and status fields of Namespace and ResourceGroup, each with its type, its limits and its description. The [Platform page](/docs/platform/tenancy-and-limits/namespaces.md) explains the concept, and the `metadata` of every kind is [the same](/docs/develop/common-definitions.md#objectmeta).

## Namespace [#namespace]

```yaml
apiVersion: funcd.io/v1alpha1
kind: Namespace
metadata:
  name: shop
spec:
  defaultExposure: explicit
```

| apiVersion | kind |
| --- | --- |
| `funcd.io/v1alpha1` | `Namespace` |

### `Namespace.spec` [#namespacespec]

| Field | Type and limits | Description |
| --- | --- | --- |
| `defaultExposure` | string, one of `""`, `implicit`, `explicit` | Whether the namespace's Functions and Sites answer at their own address, such as /function/&lt;name&gt;, while their spec.ingress.enabled is unset: implicit, or empty, turns it on, and explicit turns it off. The namespace's other Routes, an App's included, stay on, though in the default namespace explicit refuses one with no host (HostRequired). |
| `edgeDefaults` | object, [`Namespace.spec.edgeDefaults`](#namespacespecedgedefaults) | The namespace's edge defaults, which apply where a Route or a Function's or Site's spec.ingress sets no value of its own. |
| `volumeBudget` | string, a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB) | The most volume space the namespace's Functions may reserve: each local volume's size from apply until the volume is removed, and each worker's emptyDir while the worker exists. Apply refuses a local volume that does not fit (VolumeBudget), and a worker whose emptyDir does not fit is not created. Set volumeBudget or volumeBudgetBytes, not both; neither, or 0, means no budget. |
| `volumeBudgetBytes` | integer, at least 0 | The same budget as volumeBudget, as a number of bytes. Set volumeBudget or volumeBudgetBytes, not both; 0 means no budget. |

### `Namespace.spec.edgeDefaults` [#namespacespecedgedefaults]

| Field | Type and limits | Description |
| --- | --- | --- |
| `auth` | object, [`Namespace.spec.edgeDefaults.auth`](#namespacespecedgedefaultsauth) | The default edge authentication of the namespace's Routes and of its Functions' and Sites' own addresses, used where a rule, its Route and spec.ingress.auth set none; unset is open. It is a default, not a floor: a rule or a Route that sets open stays open. |

### `Namespace.spec.edgeDefaults.auth` [#namespacespecedgedefaultsauth]

| Field | Type and limits | Description |
| --- | --- | --- |
| `mode` | string, one of `""`, `authenticated`, `open`, `oidc` | authenticated admits only a caller whose token, sent as Authorization: Bearer or X-Api-Key, may get the namespace's Functions; others get 401 or 403, and every caller gets 401 while server.auth.edge is off. oidc signs callers in with the OIDCProvider that provider names. open, or empty, admits anyone. It reaches no Lake's or add-on object's address. |
| `provider` | string, a DNS-1123 label | With mode oidc, the OIDCProvider of the namespace that signs callers in; required with oidc and refused with another mode. The namespace shows a ProviderNotFound condition while it names no OIDCProvider. |
| `unauthenticated` | string, one of `""`, `redirect`, `401`, `allow` | With mode oidc, what a call that is not signed in gets: redirect, the default, 401 or allow, as on a Route's auth. Refused with another mode. |

### `Namespace.status` [#namespacestatus]

| Field | Type and limits | Description |
| --- | --- | --- |
| `conditions` | array of [Condition](/docs/develop/common-definitions.md#condition) | The conditions that explain the phase. |
| `observedGeneration` | integer | The generation of the spec that funcd last acted on. |
| `phase` | string, one of `Pending`, `Deploying`, `Ready`, `Idle`, `Degraded`, `Failed`, `Terminating` | Where the object is in its lifecycle. |

## ResourceGroup [#resourcegroup]

```yaml
apiVersion: funcd.io/v1alpha1
kind: ResourceGroup
metadata:
  name: rg1
  namespace: default
  resourceGroup: rg1
spec:
  description: The resources of the guide's examples
```

| apiVersion | kind |
| --- | --- |
| `funcd.io/v1alpha1` | `ResourceGroup` |

### `ResourceGroup.spec` [#resourcegroupspec]

| Field | Type and limits | Description |
| --- | --- | --- |
| `description` | string | Free text about the group; funcd does not read it. |

### `ResourceGroup.status` [#resourcegroupstatus]

| Field | Type and limits | Description |
| --- | --- | --- |
| `conditions` | array of [Condition](/docs/develop/common-definitions.md#condition) | The conditions that explain the phase. |
| `observedGeneration` | integer | The generation of the spec that funcd last acted on. |
| `phase` | string, one of `Pending`, `Deploying`, `Ready`, `Idle`, `Degraded`, `Failed`, `Terminating` | Where the object is in its lifecycle. |

## HTTP API [#http-api]

The table lists each described operation of these kinds, with its method and path. The operation's page in the API reference gives its parameters, its body, its authentication and every answer, with when it happens and what to do.

| Method | Path | Operation |
| --- | --- | --- |
| `GET` | `/apis/funcd.io/v1alpha1/namespaces` | [List the Namespaces](/docs/api/tenancy-and-limits/namespace/list.md) |
| `POST` | `/apis/funcd.io/v1alpha1/namespaces` | [Create a Namespace](/docs/api/tenancy-and-limits/namespace/create.md) |
| `GET` | `/apis/funcd.io/v1alpha1/namespaces/{name}` | [Read a Namespace](/docs/api/tenancy-and-limits/namespace/get.md) |
| `PUT` | `/apis/funcd.io/v1alpha1/namespaces/{name}` | [Replace a Namespace](/docs/api/tenancy-and-limits/namespace/replace.md) |
| `DELETE` | `/apis/funcd.io/v1alpha1/namespaces/{name}` | [Delete a Namespace](/docs/api/tenancy-and-limits/namespace/delete.md) |
| `GET` | `/apis/funcd.io/v1alpha1/namespaces/{namespace}/resourcegroups` | [List the ResourceGroups of a namespace](/docs/api/tenancy-and-limits/resourcegroup/list.md) |
| `POST` | `/apis/funcd.io/v1alpha1/namespaces/{namespace}/resourcegroups` | [Create a ResourceGroup](/docs/api/tenancy-and-limits/resourcegroup/create.md) |
| `GET` | `/apis/funcd.io/v1alpha1/namespaces/{namespace}/resourcegroups/{name}` | [Read a ResourceGroup](/docs/api/tenancy-and-limits/resourcegroup/get.md) |
| `PUT` | `/apis/funcd.io/v1alpha1/namespaces/{namespace}/resourcegroups/{name}` | [Replace a ResourceGroup](/docs/api/tenancy-and-limits/resourcegroup/replace.md) |
| `DELETE` | `/apis/funcd.io/v1alpha1/namespaces/{namespace}/resourcegroups/{name}` | [Delete a ResourceGroup](/docs/api/tenancy-and-limits/resourcegroup/delete.md) |
