Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

changed PodDisruptionBudget to policy/v1 because it's failing in k8s version 1.21.2 #1453

Closed
wants to merge 1 commit into from

Conversation

shubham-automation
Copy link

@shubham-automation shubham-automation commented Nov 25, 2021

  • Chart version not bumped (the versions are all bumped and released at the same time)
  • README.md updated with any new values or changes
  • Updated template tests in ${CHART}/tests/*.py
  • Updated integration tests in ${CHART}/examples/*/test/goss.yaml

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

1 similar comment
@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@cla-checker-service
Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
dc86a5b

Please, read and sign the above mentioned agreement if you want to contribute to this project

@zerkms
Copy link

zerkms commented Dec 1, 2021

It should be changed to something like

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

so that it did not break on < 1.21

@jmlrt
Copy link
Member

jmlrt commented Feb 28, 2022

Hi @shubham-automation, Thanks for opening this PR.
It will be handled by #1420

@jmlrt jmlrt closed this Feb 28, 2022
@ebuildy
Copy link
Contributor

ebuildy commented Mar 11, 2022

Hi @jmlrt , in my case .Capabilities.APIVersions.Has "policy/v1" return always true , but this is wrong. Is it normal?

@zerkms
Copy link

zerkms commented Mar 12, 2022

@ebuildy how do you use helm? For templating or while interacting with a running cluster?

@ebuildy
Copy link
Contributor

ebuildy commented Mar 12, 2022

I have understood, we use argoCD with Helm v3.8 to deploy against a cluster k8s v1.19. This is a wrong set!

  1. argoCD use helm template to build manifests, without --validate flag
  2. helm .Capabilities.APIVersions.has template function use the compiled kubectl to discover capabilities

As such, policy/v1 is used but not exist yet on our production cluster :/

Helm questions helm/helm#10760
argoCD question: argoproj/argo-cd#3640

@ebuildy
Copy link
Contributor

ebuildy commented Mar 12, 2022

In our elastic helm-chart fork, I have replaced this by bitnami solution that rely on apiVersion:

https://github.com/bitnami/charts/blob/master/bitnami/common/templates/_capabilities.tpl#L21

{{- define "common.capabilities.policy.apiVersion" -}}
{{- if semverCompare "<1.21-0" (include "common.capabilities.kubeVersion" .) -}}
{{- print "policy/v1beta1" -}}
{{- else -}}
{{- print "policy/v1" -}}
{{- end -}}
{{- end -}}

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

Successfully merging this pull request may close these issues.

5 participants