> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/troubleshooting-and-resources/armory/general/hitting-annotation-hard-limit-when-deploying-a-configmap-secret-too-long.md).

# Hitting annotation hard limit when deploying a Configmap/Secret (Too long)

### Issue <a href="#issue" id="issue"></a>

When users and administrators are deploying a Configmap/Secret, they may end up hitting the following error:

```
Error occurred when Deploy secret/ in : (500: error creating resource-name in :
 Secret "" is invalid: metadata.annotations: 
Too long: must have at most 262144 bytes: metadata.annotations:
 Too long: must have at most 262144 bytes)
```

### Cause <a href="#cause" id="cause"></a>

This error occurs during the `kubectl apply` phase for the ConfigMap/Secrets resources deployment. Spinnaker uses `kubectl apply` to perform deployments. One of the downsides of using `kubectl apply` is that it stores the entire `spec` as an annotation in the object, which is used to understand how to handle defaulted vs. deleted fields. What’s happening is that the data fields in the ConfigMap/Secrets are `exceeding 262144 characters` max limit enforced by the Kubernetes API server. As a result, Spinnaker cannot fit in the `last-applied-configuration` kubectl annotation.
