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

Quickstart stop to work using kubectl apply #4348

Closed
RafalKorepta opened this issue Oct 27, 2021 · 2 comments · Fixed by #4349
Closed

Quickstart stop to work using kubectl apply #4348

RafalKorepta opened this issue Oct 27, 2021 · 2 comments · Fixed by #4349
Labels

Comments

@RafalKorepta
Copy link
Contributor

What happened?

In the README.md there is Quickstart section that says to run kubectl apply -f bundle.yaml. This doesn't work as kubectl apply adds annotation section. In Redpanda operator our tests starts to failed with the following error:

The CustomResourceDefinition "prometheuses.monitoring.coreos.com" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

The #4326 changed the content of the bundle.yaml file. The recommended way of

Did you expect to see something different?

I was expected to change the README.md to say kubectl create -f bundle.yaml or don't introduce breaking change.

How to reproduce it (as minimally and precisely as possible):

kind create cluster
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/master/bundle.yaml
  • Prometheus Operator version:

Latest bundle.yaml from this repository after #4326 PR

  • Kubernetes version information:

    kubectl version

  • Kubernetes cluster kind:

It's kind version kind v0.11.1 go1.16.4 darwin/amd64 with kind nodes in version 1.22

  • Manifests:

https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/master/bundle.yaml

  • Prometheus Operator Logs:

None

Anything else we need to know?:

@ArthurSens
Copy link
Member

One problem that we might have now:

Previously we could upgrade prometheus CRD by using incremental changes with kubectl apply. That is not possible anymore since prometheus CRD is too long to fit in the "kubectl.kubernetes.io/last-applied-configuration" annotation.

Am I missing something or now we're all forced to upgrade CRDs by deleting the previous one and then creating the new one with kubectl create?

@stefanandres
Copy link

stefanandres commented Nov 17, 2021

kubernetes/kubectl#712 suggests to wait for server-side apply (kubernetes/enhancements#555).
When using a recent enough k8s version (don't known which, 1.21 works though) you can use server-side apply instead

❯ helm show crds prometheus-community/kube-prometheus-stack --version "20.0.1"| kubectl apply --server-side=true --overwrite=false --force-conflicts -f -
customresourcedefinition.apiextensions.k8s.io/alertmanagerconfigs.monitoring.coreos.com serverside-applied
customresourcedefinition.apiextensions.k8s.io/alertmanagers.monitoring.coreos.com serverside-applied
customresourcedefinition.apiextensions.k8s.io/podmonitors.monitoring.coreos.com serverside-applied
customresourcedefinition.apiextensions.k8s.io/probes.monitoring.coreos.com serverside-applied
customresourcedefinition.apiextensions.k8s.io/prometheuses.monitoring.coreos.com serverside-applied
customresourcedefinition.apiextensions.k8s.io/prometheusrules.monitoring.coreos.com serverside-applied
customresourcedefinition.apiextensions.k8s.io/servicemonitors.monitoring.coreos.com serverside-applied
customresourcedefinition.apiextensions.k8s.io/thanosrulers.monitoring.coreos.com serverside-applied

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

Successfully merging a pull request may close this issue.

3 participants