# Self Awareness

> Enable applications to access their own metadata using the Downward API

- **Category**: Cloud
- **Subcategory**: Behavioral
- **Canonical URL**: https://designpattern.fyi/patterns/k8s_self_awareness/

---

## Description
The Self Awareness pattern uses the Kubernetes Downward API to expose pod and container metadata to running applications. Applications can access information about their own pod name, namespace, IP address, resource limits, and other metadata. This enables applications to make decisions based on their runtime context.


## Use Cases
Use when applications need to know their own metadata or when you want applications to adapt based on their runtime context.





## Trade-offs


### Advantages

- Enables context-aware applications

- No external service dependency

- Standard Kubernetes mechanism

- Supports dynamic configuration




### Considerations & Drawbacks

- Limited to pod metadata

- Read-only access to most fields

- Requires application changes to use







