You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "bmlyr (via GitHub)" <gi...@apache.org> on 2025/08/18 22:17:13 UTC
[PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
bmlyr opened a new pull request, #2380:
URL: https://github.com/apache/polaris/pull/2380
Add PodDisruptionBudget support to Helm chart (https://kubernetes.io/docs/tasks/run-application/configure-pdb/)
This PR should resolve #2345
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on PR #2380:
URL: https://github.com/apache/polaris/pull/2380#issuecomment-3201483566
@bmlyr I think you need to rebase your PR, there is some strange compilation failure right now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "bmlyr (via GitHub)" <gi...@apache.org>.
bmlyr commented on code in PR #2380:
URL: https://github.com/apache/polaris/pull/2380#discussion_r2286203105
##########
helm/polaris/values.yaml:
##########
@@ -62,6 +62,21 @@ podLabels: {}
# -- Additional Labels to apply to polaris configmap.
configMapLabels: {}
+# -- Pod disruption budget settings.
+podDisruptionBudget:
+ # -- Specifies whether a pod disruption budget should be created.
+ enabled: false
+ # -- The minimum number of pods that should remain available during disruptions.
+ # Can be an absolute number (ex: 5) or a percentage of desired pods (ex: 50%).
+ # Cannot be used if maxUnavailable is set.
+ minAvailable: ~
+ # -- The maximum number of pods that can be unavailable during disruptions.
+ # Can be an absolute number (ex: 5) or a percentage of desired pods (ex: 50%).
+ # Cannot be used if minAvailable is set.
+ maxUnavailable: 1
Review Comment:
Sure it's better, I have set this value to ~ now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #2380:
URL: https://github.com/apache/polaris/pull/2380#discussion_r2287925610
##########
helm/polaris/tests/poddisruptionbudget_test.yaml:
##########
@@ -0,0 +1,214 @@
+#
+# 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 handle both minAvailable and maxUnavailable set (minAvailable takes precedence)
Review Comment:
Very nice, thank you 👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "bmlyr (via GitHub)" <gi...@apache.org>.
bmlyr commented on code in PR #2380:
URL: https://github.com/apache/polaris/pull/2380#discussion_r2287911293
##########
helm/polaris/tests/poddisruptionbudget_test.yaml:
##########
@@ -0,0 +1,214 @@
+#
+# 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 handle both minAvailable and maxUnavailable set (minAvailable takes precedence)
Review Comment:
Might be better now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #2380:
URL: https://github.com/apache/polaris/pull/2380#discussion_r2287895866
##########
helm/polaris/tests/poddisruptionbudget_test.yaml:
##########
@@ -0,0 +1,214 @@
+#
+# 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 handle both minAvailable and maxUnavailable set (minAvailable takes precedence)
Review Comment:
Maybe? We can also fail hard e.g.
```
{{- if and .Values.podDisruptionBudget.minAvailable .Values.podDisruptionBudget.maxUnavailable }}
{{- fail "podDisruptionBudget.minAvailable and podDisruptionBudget.maxUnavailable cannot be both set." -}}
{{- end }}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "bmlyr (via GitHub)" <gi...@apache.org>.
bmlyr commented on code in PR #2380:
URL: https://github.com/apache/polaris/pull/2380#discussion_r2287896568
##########
helm/polaris/tests/poddisruptionbudget_test.yaml:
##########
@@ -0,0 +1,214 @@
+#
+# 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 handle both minAvailable and maxUnavailable set (minAvailable takes precedence)
Review Comment:
I made a few changes to avoid that. Let me know if you prefer this version
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "bmlyr (via GitHub)" <gi...@apache.org>.
bmlyr commented on PR #2380:
URL: https://github.com/apache/polaris/pull/2380#issuecomment-3202045184
@adutra Might be better now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #2380:
URL: https://github.com/apache/polaris/pull/2380#discussion_r2287838204
##########
helm/polaris/tests/poddisruptionbudget_test.yaml:
##########
@@ -0,0 +1,214 @@
+#
+# 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
Review Comment:
Explicitly unsetting this is not necessary anymore, but it doesn't hurt to keep this line either.
##########
helm/polaris/tests/poddisruptionbudget_test.yaml:
##########
@@ -0,0 +1,214 @@
+#
+# 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 handle both minAvailable and maxUnavailable set (minAvailable takes precedence)
Review Comment:
This would be rather a pathological case imho, but OK to test it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "bmlyr (via GitHub)" <gi...@apache.org>.
bmlyr commented on code in PR #2380:
URL: https://github.com/apache/polaris/pull/2380#discussion_r2287899574
##########
helm/polaris/tests/poddisruptionbudget_test.yaml:
##########
@@ -0,0 +1,214 @@
+#
+# 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 handle both minAvailable and maxUnavailable set (minAvailable takes precedence)
Review Comment:
You're right, failing is a better option
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #2380:
URL: https://github.com/apache/polaris/pull/2380#discussion_r2287850610
##########
helm/polaris/tests/poddisruptionbudget_test.yaml:
##########
@@ -0,0 +1,214 @@
+#
+# 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 handle both minAvailable and maxUnavailable set (minAvailable takes precedence)
Review Comment:
Apparently, this would fail to apply:
```
one or more objects failed to apply, reason: PodDisruptionBudget.policy [...] is invalid: [...] minAvailable and maxUnavailable cannot be both set.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra merged PR #2380:
URL: https://github.com/apache/polaris/pull/2380
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #2380:
URL: https://github.com/apache/polaris/pull/2380#discussion_r2285738680
##########
helm/polaris/values.yaml:
##########
@@ -62,6 +62,21 @@ podLabels: {}
# -- Additional Labels to apply to polaris configmap.
configMapLabels: {}
+# -- Pod disruption budget settings.
+podDisruptionBudget:
+ # -- Specifies whether a pod disruption budget should be created.
+ enabled: false
+ # -- The minimum number of pods that should remain available during disruptions.
+ # Can be an absolute number (ex: 5) or a percentage of desired pods (ex: 50%).
+ # Cannot be used if maxUnavailable is set.
+ minAvailable: ~
+ # -- The maximum number of pods that can be unavailable during disruptions.
+ # Can be an absolute number (ex: 5) or a percentage of desired pods (ex: 50%).
+ # Cannot be used if minAvailable is set.
+ maxUnavailable: 1
Review Comment:
Setting this to 1 by default forces users to unset this value, if they want to set `minAvailable`. How about we don't specify any default value for any of the fields?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "bmlyr (via GitHub)" <gi...@apache.org>.
bmlyr commented on code in PR #2380:
URL: https://github.com/apache/polaris/pull/2380#discussion_r2287879906
##########
helm/polaris/tests/poddisruptionbudget_test.yaml:
##########
@@ -0,0 +1,214 @@
+#
+# 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 handle both minAvailable and maxUnavailable set (minAvailable takes precedence)
Review Comment:
Should we prevent the user from doing this? Maybe by selecting only minAvailable?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add Pod Disruption Budget support to Helm chart [polaris]
Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on PR #2380:
URL: https://github.com/apache/polaris/pull/2380#issuecomment-3206067376
Thank you for your contribution @bmlyr !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org