---
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 automatically; you don't normally need to create or modify them.

## Block affinity definition

### Metadata

| Field | Description                                                        | Accepted Values                                          | Schema |
| ----- | ------------------------------------------------------------------ | -------------------------------------------------------- | ------ |
| name  | Unique name to describe this resource instance. Must be specified. | Lower-case alphanumeric string with optional `.` or `-`. | 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` |
