-
Notifications
You must be signed in to change notification settings - Fork 332
feat: Add Pod Disruption Budget support to Helm chart #2380
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2d8eebc
feat: Add Pod Disruption Budget configuration to Helm chart
bmlyr e7252f2
fix: Add missing newline at end of poddisruptionbudget.yaml
bmlyr a6d8916
feat: Add unit tests for Pod Disruption Budget configuration
bmlyr 3c70a81
Modularize generic table federation (#2379)
eric-maynard 93788ec
Update community meeting dates (#2382)
jbonofre 31de2e3
Reduce getRealmConfig calls (#2337)
XN137 0de2204
Python client: make S3 role-ARN optional and add missing endpoint-int…
snazy d25393c
fix(deps): update dependency io.prometheus:prometheus-metrics-exporte…
renovate-bot 5580e31
chore(deps): bump s3mock from 3.11.0 to 4.7.0 (#2375)
0f7c8b9
Nit: extract getResolvedCatalogEntity method in IcebergCatalogHandler…
adutra b083b49
Nit: remove transitive dependencies from runtime/server/build.gradle.…
adutra b0fa74b
Nit: add methods isExternal and isStaticFacade to CatalogEntity (#2386)
adutra dd81355
Minor refactor of integration test classes (#2384)
adutra 923ef45
Remove BaseMetaStoreManager.serializeProperties (#2374)
XN137 4e3f79d
fix: minor corrections of documentation (#2397)
olsoloviov 37e678e
Merge branch 'apache:main' into helm-pdb
bmlyr 89c2c3f
fix: Update maxUnavailable value to allow for undefined configuration
bmlyr 9943594
feat: Add pod disruption budget configuration to README with helm-docs
bmlyr e4da1db
fix: Add missing newline at end of poddisruptionbudget_test.yaml
bmlyr fe4aa04
fix: Remove redundant test cases for default maxUnavailable in poddis…
bmlyr 6b1cb4b
fix: Update pod disruption budget logic to prevent simultaneous use o…
bmlyr c348bf0
fix: Prevent simultaneous use of minAvailable and maxUnavailable in p…
bmlyr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| {{/* | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| */}} | ||
|
|
||
| {{- if .Values.podDisruptionBudget.enabled -}} | ||
| apiVersion: policy/v1 | ||
| kind: PodDisruptionBudget | ||
| metadata: | ||
| name: {{ include "polaris.fullname" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "polaris.labels" . | nindent 4 }} | ||
| {{- if .Values.podDisruptionBudget.annotations }} | ||
| annotations: | ||
| {{- tpl (toYaml .Values.podDisruptionBudget.annotations) . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| {{- if and .Values.podDisruptionBudget.minAvailable .Values.podDisruptionBudget.maxUnavailable }} | ||
| {{- fail "podDisruptionBudget.minAvailable and podDisruptionBudget.maxUnavailable cannot be both set." -}} | ||
| {{- end }} | ||
| {{- if .Values.podDisruptionBudget.minAvailable }} | ||
| minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} | ||
| {{- end }} | ||
| {{- if .Values.podDisruptionBudget.maxUnavailable }} | ||
| maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} | ||
| {{- end }} | ||
| selector: | ||
| matchLabels: | ||
| {{- include "polaris.selectorLabels" . | nindent 6 }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,210 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
|
|
||
| chart: | ||
| version: 1.2.3 | ||
| appVersion: 4.5.6 | ||
|
|
||
| release: | ||
| name: polaris-release | ||
| namespace: polaris-ns | ||
|
|
||
| templates: | ||
| - poddisruptionbudget.yaml | ||
|
|
||
| tests: | ||
|
|
||
| # kind | ||
| - it: should not create PDB by default | ||
| asserts: | ||
| - containsDocument: | ||
| kind: PodDisruptionBudget | ||
| apiVersion: policy/v1 | ||
| not: true | ||
| - it: should create PDB when enabled | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| asserts: | ||
| - containsDocument: | ||
| kind: PodDisruptionBudget | ||
| apiVersion: policy/v1 | ||
|
|
||
| # metadata.name (with PDB enabled) | ||
| - it: should set PDB name | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| asserts: | ||
| - equal: | ||
| path: metadata.name | ||
| value: polaris-release | ||
| - it: should set PDB name with override | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| nameOverride: polaris-override | ||
| asserts: | ||
| - equal: | ||
| path: metadata.name | ||
| value: polaris-release-polaris-override | ||
| - it: should set PDB name with full override | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| fullnameOverride: polaris-override | ||
| asserts: | ||
| - equal: | ||
| path: metadata.name | ||
| value: polaris-override | ||
|
|
||
| # metadata.namespace (with PDB enabled) | ||
| - it: should set PDB namespace | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| asserts: | ||
| - equal: | ||
| path: metadata.namespace | ||
| value: polaris-ns | ||
|
|
||
| # metadata.labels (with PDB enabled) | ||
| - it: should set PDB default labels | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| asserts: | ||
| - isSubset: | ||
| path: metadata.labels | ||
| content: | ||
| app.kubernetes.io/name: polaris | ||
| app.kubernetes.io/instance: polaris-release | ||
| app.kubernetes.io/version: 4.5.6 | ||
| app.kubernetes.io/managed-by: Helm | ||
| helm.sh/chart: polaris-1.2.3 | ||
|
|
||
| # metadata.annotations (with PDB enabled) | ||
| - it: should not set annotations by default | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| asserts: | ||
| - isNull: | ||
| path: metadata.annotations | ||
| - it: should set custom annotations | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| podDisruptionBudget.annotations: | ||
| example.com/policy: "critical" | ||
| kubernetes.io/description: "PDB for Polaris" | ||
| asserts: | ||
| - equal: | ||
| path: metadata.annotations | ||
| value: | ||
| example.com/policy: "critical" | ||
| kubernetes.io/description: "PDB for Polaris" | ||
| - it: should template annotations | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| podDisruptionBudget.annotations: | ||
| app.example.com/release: "{{ .Release.Name }}" | ||
| asserts: | ||
| - equal: | ||
| path: metadata.annotations | ||
| value: | ||
| app.example.com/release: "polaris-release" | ||
|
|
||
| - it: should set custom maxUnavailable | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| podDisruptionBudget.maxUnavailable: 2 | ||
| asserts: | ||
| - equal: | ||
| path: spec.maxUnavailable | ||
| value: 2 | ||
| - isNull: | ||
| path: spec.minAvailable | ||
| - it: should set maxUnavailable percentage | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| podDisruptionBudget.maxUnavailable: "50%" | ||
| asserts: | ||
| - equal: | ||
| path: spec.maxUnavailable | ||
| value: "50%" | ||
| - isNull: | ||
| path: spec.minAvailable | ||
|
|
||
| # spec.minAvailable | ||
| - it: should set minAvailable and unset maxUnavailable | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| podDisruptionBudget.minAvailable: 2 | ||
| podDisruptionBudget.maxUnavailable: null | ||
| asserts: | ||
| - equal: | ||
| path: spec.minAvailable | ||
| value: 2 | ||
| - isNull: | ||
| path: spec.maxUnavailable | ||
| - it: should set minAvailable percentage | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| podDisruptionBudget.minAvailable: "75%" | ||
| podDisruptionBudget.maxUnavailable: null | ||
| asserts: | ||
| - equal: | ||
| path: spec.minAvailable | ||
| value: "75%" | ||
| - isNull: | ||
| path: spec.maxUnavailable | ||
|
|
||
| # spec.selector.matchLabels | ||
| - it: should set selector labels to match deployment | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| asserts: | ||
| - equal: | ||
| path: spec.selector.matchLabels | ||
| value: | ||
| app.kubernetes.io/name: polaris | ||
| app.kubernetes.io/instance: polaris-release | ||
| - it: should set selector labels with name override | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| nameOverride: polaris-override | ||
| asserts: | ||
| - equal: | ||
| path: spec.selector.matchLabels | ||
| value: | ||
| app.kubernetes.io/name: polaris-override | ||
| app.kubernetes.io/instance: polaris-release | ||
| - it: should set selector labels with full name override | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| fullnameOverride: polaris-override | ||
| asserts: | ||
| - equal: | ||
| path: spec.selector.matchLabels | ||
| value: | ||
| app.kubernetes.io/name: polaris | ||
| app.kubernetes.io/instance: polaris-release | ||
|
|
||
| # validation tests | ||
| - it: should fail when both minAvailable and maxUnavailable are set | ||
| set: | ||
| podDisruptionBudget.enabled: true | ||
| podDisruptionBudget.minAvailable: 1 | ||
| podDisruptionBudget.maxUnavailable: 1 | ||
| asserts: | ||
| - failedTemplate: | ||
| errorMessage: "podDisruptionBudget.minAvailable and podDisruptionBudget.maxUnavailable cannot be both set." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Explicitly unsetting this is not necessary anymore, but it doesn't hurt to keep this line either.