Skip to content

[kube-prometheus-stack] Conflict on CRD upgrade #5242

Open
@MeCode4Food

Description

@MeCode4Food

Describe the bug a clear and concise description of what the bug is.

Errror occurred when trying to upgrade from v64 to v65. On the CRD update step, conflicts occurred requiring additional intervention.

What's your helm version?

version.BuildInfo{Version:"v3.14.3", GitCommit:"f03cc04caaa8f6d7c3e67cf918929150cf6f3f12", GitTreeState:"clean", GoVersion:"go1.22.1"}

What's your kubectl version?

WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version. Client Version: version.Info{Major:"1", Minor:"26+", GitVersion:"v1.26.7-dispatcher", GitCommit:"ae4b8e29ab9af72b4099cf8f5c6e768526c37da3", GitTreeState:"clean", BuildDate:"2023-07-26T00:30:36Z", GoVersion:"go1.20.6", Compiler:"gc", Platform:"darwin/arm64"} Kustomize Version: v4.5.7 Server Version: version.Info{Major:"1", Minor:"30", GitVersion:"v1.30.5-gke.1713000", GitCommit:"8327934473fe1db72655efdf110489f800175a20", GitTreeState:"clean", BuildDate:"2024-10-28T04:18:40Z", GoVersion:"go1.22.6 X:boringcrypto", Compiler:"gc", Platform:"linux/amd64"} WARNING: version difference between client (1.26) and server (1.30) exceeds the supported minor version skew of +/-1

Which chart?

prometheus-community/kube-prometheus-stack

What's the chart version?

v65

What happened?

Errror occurred when trying to upgrade from v64 to v65, on the CRD update step:

❯ kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.77.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml

error: Apply failed with 3 conflicts: conflicts with "helm" using apiextensions.k8s.io/v1:
- .metadata.annotations.controller-gen.kubebuilder.io/version
- .metadata.annotations.operator.prometheus.io/version
- .spec.versions
Please review the fields above--they currently have other managers. Here
are the ways you can resolve this warning:
* If you intend to manage all of these fields, please re-run the apply
  command with the `--force-conflicts` flag.
* If you do not intend to manage all of the fields, please edit your
  manifest to remove references to the fields that should keep their
  current managers.
* You may co-own fields by updating your manifest to match the existing
  value; in this case, you'll become the manager if the other manager(s)
  stop managing the field (remove it from their configuration).
See https://kubernetes.io/docs/reference/using-api/server-side-apply/#conflicts

What you expected to happen?

Running the CRD update steps should complete without requiring additional changes to the commands, or interventions

How to reproduce it?

Update the stack from v64 to v65, by first updating the CRDs

Enter the changed values of values.yaml?

NONE

Enter the command that you execute and failing/misfunctioning.

❯ kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.77.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml


error: Apply failed with 3 conflicts: conflicts with "helm" using apiextensions.k8s.io/v1:
- .metadata.annotations.controller-gen.kubebuilder.io/version
- .metadata.annotations.operator.prometheus.io/version
- .spec.versions
Please review the fields above--they currently have other managers. Here
are the ways you can resolve this warning:
* If you intend to manage all of these fields, please re-run the apply
  command with the `--force-conflicts` flag.
* If you do not intend to manage all of the fields, please edit your
  manifest to remove references to the fields that should keep their
  current managers.
* You may co-own fields by updating your manifest to match the existing
  value; in this case, you'll become the manager if the other manager(s)
  stop managing the field (remove it from their configuration).
See https://kubernetes.io/docs/reference/using-api/server-side-apply/#conflicts

Anything else we need to know?

I am aware that this issue has been referenced (and closed) in this ticket #2489, but adding a --force-conflicts flag to the command does not inspire confidence that the update will be smooth and without issues (in the future). As this comment mentions: Is this the recommended way to update the CRDs? Is there a way to update the CRDs without requiring additional changes to the commands provided in this step?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions