Skip to content

Commit

Permalink
feat: enabled poddisruptionbudget in case more than one broker instan…
Browse files Browse the repository at this point in the history
…ce is used (#50)

Signed-off-by: Sherif Ayad <[email protected]>
  • Loading branch information
sherifkayad authored Mar 30, 2023
1 parent 5981831 commit f517f47
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/pact-broker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: pact-broker
description: The Pact Broker is an application for sharing for Pact contracts and verification results.
type: application
version: 0.8.0
version: 0.9.0
appVersion: 2.105.0.1
dependencies:
- condition: postgresql.enabled
Expand Down
9 changes: 5 additions & 4 deletions charts/pact-broker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pact-broker

![Version: 0.8.0](https://img.shields.io/badge/Version-0.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.105.0.1](https://img.shields.io/badge/AppVersion-2.105.0.1-informational?style=flat-square)
![Version: 0.9.0](https://img.shields.io/badge/Version-0.9.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.105.0.1](https://img.shields.io/badge/AppVersion-2.105.0.1-informational?style=flat-square)

The Pact Broker is an application for sharing for Pact contracts and verification results.

Expand Down Expand Up @@ -121,6 +121,7 @@ helm upgrade -i <release_name> oci://ghcr.io/pact-foundation/pact-broker-chart/p
| broker.containerSecurityContext.enabled | Enable Pact Broker containers' Security Context | bool | `true` |
| broker.containerSecurityContext.runAsNonRoot | Set Pact Broker container's Security Context runAsNonRoot | bool | `true` |
| broker.containerSecurityContext.runAsUser | Set Pact Broker container's Security Context runAsUser | int | `1001` |
| broker.extraContainers | Additional containers to add to the Pact Broker pods | list | `[]` |
| broker.labels | Additional labels that can be added to the Broker deployment | object | `{}` |
| broker.livenessProbe.enabled | Enable livenessProbe on Pact Broker containers | bool | `true` |
| broker.livenessProbe.failureThreshold | Failure threshold for livenessProbe | int | `3` |
Expand All @@ -129,6 +130,7 @@ helm upgrade -i <release_name> oci://ghcr.io/pact-foundation/pact-broker-chart/p
| broker.livenessProbe.successThreshold | Success threshold for livenessProbe | int | `1` |
| broker.livenessProbe.timeoutSeconds | Timeout seconds for livenessProbe | int | `5` |
| broker.nodeSelector | Pact Broker [Node Selector](https://kubernetes.io/docs/user-guide/node-selection/) | object | `{}` |
| broker.podDisruptionBudget.maxUnavailable | Max Unavailable Pods (alternatively one can define `minAvailable`) | int | `1` |
| broker.podSecurityContext.enabled | Enable Pact Broker pods' Security Context | bool | `true` |
| broker.podSecurityContext.fsGroup | Set Pact Broker pod's Security Context fsGroup | int | `1001` |
| broker.readinessProbe.enabled | Enable readinessProbe on Pact Broker containers | bool | `true` |
Expand All @@ -144,9 +146,8 @@ helm upgrade -i <release_name> oci://ghcr.io/pact-foundation/pact-broker-chart/p
| broker.resources.requests.memory | | string | `"512Mi"` |
| broker.revisionHistoryLimit | Number of Deployment Revisions to set | int | `10` |
| broker.tolerations | Pact Broker [Tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | list | `[]` |
| broker.volumeMounts | | list | `[]` |
| broker.volumes | | list | `[]` |
| broker.extraContainers | Additional containers to add to the Pact Broker pods | list | `[]` |
| broker.volumeMounts | Volume mounts | list | `[]` |
| broker.volumes | Volumes to mount | list | `[]` |
| externalDatabase.config.adapter | Database engine to use. Only allowed values are `postgres` or `sqlite`. More info [here](https://docs.pact.io/pact_broker/docker_images/pactfoundation#getting-started) | string | `""` |
| externalDatabase.config.auth.existingSecret | Name of an existing Kubernetes secret containing the database credentials | string | `""` |
| externalDatabase.config.auth.existingSecretPasswordKey | The key to which the password will be stored under within existing secret. | string | `"user-password"` |
Expand Down
23 changes: 23 additions & 0 deletions charts/pact-broker/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if gt (int .Values.broker.replicaCount) 1 }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
name: {{ include "chart.fullname" . }}
app.kubernetes.io/name: {{ include "chart.name" . }}
helm.sh/chart: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
selector:
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/name: {{ include "chart.name" . }}
{{- with .Values.broker.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
{{- with .Values.broker.podDisruptionBudget.minAvailable }}
minAvailable: {{ . }}
{{- end }}
{{- end }}
10 changes: 8 additions & 2 deletions charts/pact-broker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,19 @@ broker:
# -- Success threshold for readinessProbe
successThreshold: 1

# Volumes to mount
# Pact Broker [Pod Disruption Budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget)
podDisruptionBudget:
# -- Max Unavailable Pods (alternatively one can define `minAvailable`)
maxUnavailable: 1
# minAvailable: 1

# -- Volumes to mount
volumes: []
# - name: cache-volume
# emptyDir:
# sizeLimit: 500Mi

# Volume mounts
# -- Volume mounts
volumeMounts: []
# - mountPath: <CONTAINER_PATH>
# name: <VOLUME_NAME>
Expand Down

0 comments on commit f517f47

Please sign in to comment.