Skip to content

Commit

Permalink
Add PodDisruptionBudget for pastebin
Browse files Browse the repository at this point in the history
  • Loading branch information
Rogerio Varalda authored and rvaralda committed Jul 13, 2022
1 parent 805cf37 commit 9f8e6b6
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 8 deletions.
8 changes: 4 additions & 4 deletions charts/pastebin/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: cert-manager
repository: https://charts.jetstack.io
version: v1.4.0
version: v1.4.4
- name: mysql
repository: https://charts.bitnami.com/bitnami
version: 8.7.1
digest: sha256:e93fb4a8c0549f951fbccaa5ee25474c43f8b59f33f910db6605a0479c52ed1d
generated: "2021-07-09T10:15:14.758143-04:00"
version: 9.2.0
digest: sha256:0c1b9b9df560cad0b8debd2210c9c365e0df97f49e340a84455d7fc67be5b420
generated: "2022-07-13T10:11:24.336447+02:00"
6 changes: 3 additions & 3 deletions charts/pastebin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: pastebin
description: A Helm chart for the Mozilla Pastebin (dpaste) application
type: application
version: 0.1.3
version: 0.1.4

keywords:
- Mozilla
Expand All @@ -19,10 +19,10 @@ maintainers:

dependencies:
- name: cert-manager
version: v1.4.0
version: 1.4.4
condition: cert-manager.install
repository: https://charts.jetstack.io
- name: mysql
version: 8.7.1
version: 9.2.0
condition: mysql.install
repository: https://charts.bitnami.com/bitnami
4 changes: 4 additions & 0 deletions charts/pastebin/ci/test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ configMap:
deployment:
port: 5000
replicaCount: 1
resources:
requests:
cpu: 50m
memory: 100Mi

imagePullSecrets:
- name: ecr-registry
Expand Down
4 changes: 4 additions & 0 deletions charts/pastebin/templates/job.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: batch/v1
{{- else }}
apiVersion: batch/v1beta1
{{- end }}
kind: CronJob
metadata:
name: {{ .Values.job.name }}
Expand Down
25 changes: 25 additions & 0 deletions charts/pastebin/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.podDisruptionBudget.enabled }}
{{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: policy/v1
{{- else }}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ .Values.podDisruptionBudget.name }}
labels:
{{- include "pastebin.labels" . | nindent 4 }}
{{- with .Values.podDisruptionBudget.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{- include "pastebin.selectorLabels" . | nindent 6 }}
{{- end }}
8 changes: 7 additions & 1 deletion charts/pastebin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ externalSecrets:
image:
pullPolicy: Always
repository: 783633885093.dkr.ecr.us-west-2.amazonaws.com/pastebin
tag: v3.5.4
tag: v3.5.8

imagePullSecrets: []

Expand Down Expand Up @@ -99,3 +99,9 @@ mysql:
install: false
image:
tag: 5.7.33

podDisruptionBudget:
enabled: true
name: pastebin
labels: {}
minAvailable: 1

0 comments on commit 9f8e6b6

Please sign in to comment.