Skip to content

Commit

Permalink
[bitnami/concourse] PDB review (#25869)
Browse files Browse the repository at this point in the history
* [bitnami/concourse] PDB review

Signed-off-by: Fran Mulero <[email protected]>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <[email protected]>

* Fix bad references

Signed-off-by: Fran Mulero <[email protected]>

* Fix pdb conditions

Signed-off-by: Fran Mulero <[email protected]>

---------

Signed-off-by: Fran Mulero <[email protected]>
Signed-off-by: Bitnami Containers <[email protected]>
Co-authored-by: Bitnami Containers <[email protected]>
  • Loading branch information
fmulero and bitnami-bot authored May 20, 2024
1 parent 486c345 commit d8a78da
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bitnami/concourse/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ maintainers:
name: concourse
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/concourse
version: 4.0.2
version: 4.1.0
3 changes: 3 additions & 0 deletions bitnami/concourse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@ The [Bitnami Concourse](https://github.com/bitnami/containers/tree/main/bitnami/
| `web.extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for the Concourse web container(s) | `[]` |
| `web.sidecars` | Add additional sidecar containers to the Concourse web pod(s) | `[]` |
| `web.initContainers` | Add additional init containers to the Concourse web pod(s) | `[]` |
| `web.pdb.create` | Create Pod disruption budget object for Concourse worker nodes | `true` |
| `web.pdb.minAvailable` | Minimum number / percentage of Concourse worker pods that should remain scheduled | `1` |
| `web.pdb.maxUnavailable` | Maximum number/percentage of Concourse worker pods that may be made unavailable | `""` |
| `web.psp.create` | Whether to create a PodSecurityPolicy. WARNING: PodSecurityPolicy is deprecated in Kubernetes v1.21 or later, unavailable in v1.25 or later | `false` |
| `web.rbac.create` | Specifies whether RBAC resources should be created | `true` |
| `web.rbac.rules` | Custom RBAC rules to set | `[]` |
Expand Down
28 changes: 28 additions & 0 deletions bitnami/concourse/templates/web/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}

{{- if and .Values.web.enabled (include "concourse.host" .) .Values.web.pdb.create }}
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "concourse.web.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: worker
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.web.pdb.minAvailable }}
minAvailable: {{ .Values.web.pdb.minAvailable }}
{{- end }}
{{- if .Values.web.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.web.pdb.maxUnavailable }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.web.podLabels .Values.commonLabels ) "context" . ) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: web
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}

{{- if and .Values.worker.enabled .Values.worker.pdb.create -}}
{{- if and .Values.worker.enabled (or (not .Values.web.enabled) (include "concourse.host" .)) .Values.worker.pdb.create }}
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
Expand Down
11 changes: 11 additions & 0 deletions bitnami/concourse/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,17 @@ web:
## command: ['sh', '-c', 'echo "hello world"']
##
initContainers: []
## Pod Disruption Budget configuration
## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
##
pdb:
create: true
## @param web.pdb.create Create Pod disruption budget object for Concourse worker nodes
## @param web.pdb.minAvailable Minimum number / percentage of Concourse worker pods that should remain scheduled
## @param web.pdb.maxUnavailable Maximum number/percentage of Concourse worker pods that may be made unavailable
##
minAvailable: 1
maxUnavailable: ""
## @param web.psp.create Whether to create a PodSecurityPolicy. WARNING: PodSecurityPolicy is deprecated in Kubernetes v1.21 or later, unavailable in v1.25 or later
##
psp:
Expand Down

0 comments on commit d8a78da

Please sign in to comment.