---
title: "Block affinity"
description: "Reference for the BlockAffinity resource in Calico Open Source that records which node owns each IP address management block."
product: "Calico Open Source"
version: "3.33 (latest)"
section: "Reference"
canonical_url: "https://docs.tigera.io/calico/latest/reference/resources/blockaffinity"
---

# Block affinity

A block affinity resource (BlockAffinity) represents the affinity between a node and an IP address management (IPAM) block. Calico IPAM creates and manages these resources. Don't create, change, or delete them yourself. BlockAffinity is a cluster-scoped resource.

For `kubectl` commands, you can use the aliases `blockaffinity.projectcalico.org`, `blockaffinities.projectcalico.org`, `blockaffinity.p`, and `blockaffinities.p`.

## Definition

### Metadata

| Field  | Description                                | Accepted Values                                                                                                          | Schema | Default |
| ------ | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------ | ------- |
| `name` | The name of this block affinity. Required. | Lowercase alphanumeric characters, `-`, or `.`. Must start and end with an alphanumeric character. Up to 253 characters. | string |         |

### Spec

| Field     | Description                                                                  | Accepted Values                                                                 | Schema  | Default |
| --------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------- | ------- |
| `state`   | State of the affinity with regard to any referenced IPAM blocks. Required.   | `confirmed`, `pending`, `pendingDeletion`, or empty                             | string  |         |
| `node`    | The node that this affinity is assigned to. Required.                        | The name of the node, or `load-balancer` for blocks in a `LoadBalancer` IP pool | string  |         |
| `cidr`    | The CIDR range this block affinity references. Required.                     | A valid IPv4 or IPv6 CIDR.                                                      | string  |         |
| `deleted` | When set to `true`, clients should treat this block as if it does not exist. | `true`, `false`                                                                 | boolean | `false` |

## Additional resources

- [IPAM block](https://docs.tigera.io/calico/latest/reference/resources/ipamblock.md)
- [IP pool](https://docs.tigera.io/calico/latest/reference/resources/ippool.md)
