-
Notifications
You must be signed in to change notification settings - Fork 780
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
Dynamically change the API version of the PDB in Helm Chart #1502
Dynamically change the API version of the PDB in Helm Chart #1502
Conversation
Signed-off-by: tenzen-y <yuki.iwai.tz@gmail.com>
@thelinuxfoundation I consent. |
@tenzen-y Thank you for the PR! Since |
@ritazh It would make sense to reconsider the upgrade to
I would like to work on dynamically changing the API version of the PDB in Helm Chart. |
Today, Gatekeeper's minimum supported k8s version is v1.16 (due to v1 CRDs), and this will substantially increase the minimum requirement. |
Signed-off-by: tenzen-y <yuki.iwai.tz@gmail.com>
Should we change the minimum k8s version for gatekeeper to at least v1.18 since k8s stopped supporting 1.18 now. |
@@ -164,6 +164,7 @@ webhooks: | |||
timeoutSeconds: HELMSUBST_VALIDATING_WEBHOOK_TIMEOUT | |||
failurePolicy: HELMSUBST_VALIDATING_WEBHOOK_CHECK_IGNORE_FAILURE_POLICY | |||
--- | |||
HELMSUBSET_PDB_POLICY_GROUP_VERSION: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: HELMSUBST
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxsmythe thanks!
cmd/build/helmify/replacements.go
Outdated
@@ -66,4 +66,10 @@ var replacements = map[string]string{ | |||
{{- range .Values.controllerManager.exemptNamespaces}} | |||
- --exempt-namespace={{ . }} | |||
{{- end }}`, | |||
`HELMSUBSET_PDB_POLICY_GROUP_VERSION: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could break if the ordering of fields in the Kustomize output is not maintained.
It might be better to modify https://github.com/open-policy-agent/gatekeeper/blob/master/cmd/build/helmify/main.go to directly detect these and make the replacement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxsmythe I followed the documentation below and made some changes outside of main.go
, but there is certainly a danger that this implementation will not work.
please edit kustomization.yaml, kustomize-for-helm.yaml and replacements.go under that directory and then run make manifests.
I will modify main.go
to directly detect these. Thanks.
Signed-off-by: tenzen-y <yuki.iwai.tz@gmail.com>
b026e73
to
4d46ffa
Compare
Codecov Report
@@ Coverage Diff @@
## master #1502 +/- ##
==========================================
+ Coverage 52.25% 52.36% +0.10%
==========================================
Files 82 82
Lines 7377 7377
==========================================
+ Hits 3855 3863 +8
+ Misses 3163 3158 -5
+ Partials 359 356 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for making the changes!
@tenzen-y @sozercan Unfortunately, this broke gatekeeper installation with ArgoCD. The reason is ArgoCD is using There are a few related bug reports like in argoproj/argo-cd#6351, argoproj/argo-cd#3594. I can submit a PR. One of the following:
WDYT? The behavior of |
I have proposed workaround number 4 in #1533 |
@sabre1041
It makes sense. I think that number 4 is a good workaround. |
Signed-off-by: tenzen-y yuki.iwai.tz@gmail.com
What this PR does / why we need it:
PodDisruptionBudget is deprecated in v1.21+, unavailable in v1.25+.
So, I would like to upgrade policy/v1beta1 PDB to policy/v1.
https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.21.md#api-change-1
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes #
Special notes for your reviewer: