workaround for .Capabilities.APIVersions #277
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does:
#227 introduced
policy/v1
for PodDisruptionBudgets with a conditional based on.Capabilities.APIVersions
:cortex-helm-chart/templates/compactor/compactor-poddisruptionbudget.yaml
Line 2 in ad6ebfd
By default,
helm template
populates.Capabilities.APIVersions
with all API versions known to Kubernetes client-go v1.22. Many CD tools use this to render the template, then naively try to deploy to Kubernetes clusters that don't supportpolicy/v1
, such as v1.20 (e.g., argoproj/argo-cd#7291). This results in error messages likeno matches for kind "PodDisruptionBudget" in version "policy/v1"
.helm template
provides a couple ways to hint a more specific set of API versions:--api-versions
can explicitly append API versions to.Capabilities.APIVersions
--kube-version
can override.Capabilities.KubeVersion
, but doesn't have any effect on.Capabilities.APIVersions
--validate
will interrogate Kubernetes to get an accurate list of API versionsCurrently, this chart only works currently with
helm template --validate
andhelm install
.This PR provides a workaround so that all three methods of hinting API version support to
helm template
work as expected. This should make it easier for users of naive CD tools to deploy this chart successfully.Demo with various options:
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]