# io.k8s.api.core.v1.Affinity

From **Kubernetes**.

Affinity is a group of affinity scheduling rules.

- Type: `object`

## Properties

### `nodeAffinity`

- Required: false
Describes node affinity scheduling rules for the pod.

### `podAffinity`

- Required: false
Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).

### `podAntiAffinity`

- Required: false
Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).

## JSON Schema

```json
{"description":"Affinity is a group of affinity scheduling rules.","properties":{"nodeAffinity":{"allOf":[{"$ref":"#/components/schemas/io.k8s.api.core.v1.NodeAffinity"}],"description":"Describes node affinity scheduling rules for the pod."},"podAffinity":{"allOf":[{"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAffinity"}],"description":"Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s))."},"podAntiAffinity":{"allOf":[{"$ref":"#/components/schemas/io.k8s.api.core.v1.PodAntiAffinity"}],"description":"Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s))."}},"type":"object"}
```
