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

Upgrading the Helm chart on Kubernetes v1.25 fails with podDisruptionsBudget enabled #184

Closed
elchenberg opened this issue Feb 15, 2023 · 0 comments · Fixed by #185
Closed

Comments

@elchenberg
Copy link
Contributor

This is the error message:

Error: UPGRADE FAILED: unable to build kubernetes objects from current release manifest: resource mapping not found for name: "opa-opa-kube-mgmt" namespace: "" from "": no matches for kind "PodDisruptionBudget" in version "policy/v1beta1"

And this is the reason:

Recommendation: The best practice is to upgrade releases using deprecated API versions to supported API versions, prior to upgrading to a kubernetes cluster that removes those API versions.

If you don't update a release as suggested previously, you will have an error similar to the following when trying to upgrade a release in a Kubernetes version where its API version(s) is/are removed: [...]

https://helm.sh/docs/topics/kubernetes_apis/#helm-users

So my pull request from a few months ago (#172) had the order wrong:

{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodDisruptionBudget" }}
apiVersion: policy/v1beta1
{{- else }}
apiVersion: policy/v1
{{- end }}

It would have been better to do it like this:

{{- if .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
elchenberg added a commit to elchenberg/kube-mgmt that referenced this issue Feb 15, 2023
Previously the chart used the deprecated apiVersion policy/v1beta1 as long as it was avaiable in the cluster. This is against the recommendation of upgrading the release to a supported apiVersion prior to upgrading the cluster to a version that removes the deprecated apiVersion: <https://helm.sh/docs/topics/kubernetes_apis/#helm-users>

Closes open-policy-agent#184

Signed-off-by: elchenberg <[email protected]>
elchenberg added a commit to elchenberg/kube-mgmt that referenced this issue Feb 16, 2023
Previously the chart used the deprecated apiVersion policy/v1beta1 as long as it was avaiable in the cluster. This is against the recommendation of upgrading the release to a supported apiVersion prior to upgrading the cluster to a version that removes the deprecated apiVersion: <https://helm.sh/docs/topics/kubernetes_apis/#helm-users>

Closes open-policy-agent#184

Signed-off-by: elchenberg <[email protected]>
eshepelyuk pushed a commit that referenced this issue Feb 16, 2023
Previously the chart used the deprecated apiVersion policy/v1beta1 as long as it was avaiable in the cluster. This is against the recommendation of upgrading the release to a supported apiVersion prior to upgrading the cluster to a version that removes the deprecated apiVersion: <https://helm.sh/docs/topics/kubernetes_apis/#helm-users>

Closes #184

Signed-off-by: elchenberg <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant