Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object exceeds last-applied-configuration annotation #712

Closed
sh0rez opened this issue Sep 2, 2019 · 6 comments
Closed

Object exceeds last-applied-configuration annotation #712

sh0rez opened this issue Sep 2, 2019 · 6 comments

Comments

@sh0rez
Copy link

sh0rez commented Sep 2, 2019

With the current implementation of kubectl it is not possible to apply very large objects, e.g. ConfigMaps.

We experienced this during development on our configuration management tool Tanka (grafana/tanka#50)

Problem description

For the apply feature to work, kubectl relies on the last-applied-configuration annotation:
https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/#how-apply-calculates-differences-and-merges-changes

However, annotation values are limited to 256kb in total, with equals to 262144 characters.
The actual ConfigMap has no size limit but what etcd imposes, which is 1mb.

When trying to apply a ConfigMap larger than 256kb, the operation fails:

$ kubectl apply -f large.yml
The ConfigMap "a" is invalid: metadata.annotations: Too long: must have at most 262144 characters`.

Contents of large.yml:

apiVersion: v1
data:
  a: |
    <TRUNCATED>
kind: ConfigMap
metadata:
  name: a
  namespace: default

Possible fix

According to the docs (https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/#how-apply-calculates-differences-and-merges-changes):

... kubectl.kubernetes.io/last-applied-configuration annotation. This is used to identify fields that have been removed from the configuration file and need to be cleared from the live configuration.

This sounds like this is (only?) used to identify removed fields. If this is the case, it should be sufficient to store only the field names, but not their values (ie. store an <redacted> identifier or so if the data is too large).

Closing thoughts

Internally, we already hit this limit when trying to apply generated Grafana dashboards, which are pretty huge yaml files.

Other people experienced this as well:

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 1, 2019
@sh0rez
Copy link
Author

sh0rez commented Dec 1, 2019

/remove-lifecycle stale

Is this the right place to post such issues to?

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 1, 2019
@2rs2ts
Copy link

2rs2ts commented Dec 3, 2019

Based on the contributing guidelines maybe this should go on the main kubernetes repo? https://github.com/kubernetes/kubectl/blob/master/CONTRIBUTING.md

@sh0rez
Copy link
Author

sh0rez commented Dec 3, 2019

This repository is called „Issue tracker for kubectl“ ... so I think it belongs here. But I can open another issue over at kubernetes/kubernetes and see :D

@liggitt
Copy link
Member

liggitt commented Dec 3, 2019

This sounds like this is (only?) used to identify removed fields.

It is also used to determine when a value has been changed, so the value is required as well.

This is not possible to change for the client-side apply algorithm, but is how the server-side-apply feature in-progress works. Closing in favor of kubernetes/enhancements#555

/close

@k8s-ci-robot
Copy link
Contributor

@liggitt: Closing this issue.

In response to this:

This sounds like this is (only?) used to identify removed fields.

It is also used to determine when a value has been changed, so the value is required as well.

This is not possible to change for the client-side apply algorithm, but is how the server-side-apply feature in-progress works. Closing in favor of kubernetes/enhancements#555

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants