diff --git a/charts/app/Chart.yaml b/charts/app/Chart.yaml index 4eaee42..a12a241 100644 --- a/charts/app/Chart.yaml +++ b/charts/app/Chart.yaml @@ -3,5 +3,5 @@ description: Deployment for base pinup app maintainers: - email: d7561985@gmail.com name: DevOps -version: 3.1.21 +version: 3.1.23 apiVersion: v2 diff --git a/charts/app/templates/pdb.yaml b/charts/app/templates/pdb.yaml new file mode 100644 index 0000000..616e1be --- /dev/null +++ b/charts/app/templates/pdb.yaml @@ -0,0 +1,22 @@ +{{- if .Values.pdb.enabled -}} +apiVersion: {{ default "policy/v1beta1" .Values.pdb.apiVersion }} +kind: PodDisruptionBudget +metadata: + namespace: {{ .Release.Namespace }} + {{- if .Values.pdb.annotations }} + annotations: {{ toJson .Values.pdb.annotations }} + {{- end }} + labels: + app: {{ template "name" . }} + appver: "{{ .Values.image.tag }}" + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + name: {{ .Values.appName }} +spec: + {{- if .Values.pdb.minAvailable }} + minAvailable: {{ .Values.pdb.minAvailable }} + {{- end }} + {{- if .Values.pdb.maxUnavailable }} + maxUnavailable: {{ .Values.pdb.maxUnavailable }} + {{- end }} +{{- end }} diff --git a/charts/app/values.example.yaml b/charts/app/values.example.yaml index d33dd40..2001f51 100644 --- a/charts/app/values.example.yaml +++ b/charts/app/values.example.yaml @@ -67,4 +67,12 @@ ingress: servicePort: 8888 "/page": serviceName: "test-sv" - servicePort: 8881 \ No newline at end of file + servicePort: 8881 + +pdb: + enabled: true + annotations: { + foo: "bar" + } + minAvailable: 1 + maxUnavailable: 1 diff --git a/charts/app/values.yaml b/charts/app/values.yaml index 9738acf..2c2a4d3 100644 --- a/charts/app/values.yaml +++ b/charts/app/values.yaml @@ -245,3 +245,7 @@ hpa: maxReplicas: 6 cpu: 70 memory: 70 + +pdb: + enabled: false + maxUnavailable: 1