Skip to content

Commit

Permalink
Adding Pod Disruption Budgets (PDB) to Java Chart (#41)
Browse files Browse the repository at this point in the history
* Adding PDB for chart
  • Loading branch information
adusumillipraveen authored Mar 20, 2019
1 parent abf4a33 commit de19e08
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ The following table lists the configurable parameters of the Java chart and thei
| `secrets` | Mappings of environment variables to service objects or pre-configured kubernetes secrets | nil |
| `keyVaults` | Mappings of keyvaults to be mounted as flexvolumes (see Example Configuration) | nil |
| `applicationInsightsInstrumentKey` | Instrumentation Key for App Insights , It is mapped to `AZURE_APPLICATIONINSIGHTS_INSTRUMENTATIONKEY` as environment variable | `00000000-0000-0000-0000-000000000000`
| `pdb.enabled` | To enable PodDisruptionBudget on the pods for handling disruptions | `true` |
| `pdb.maxUnavailable` | To configure the number of pods from the set that can be unavailable after the eviction. It can be either an absolute number or a percentage. pdb.minAvailable takes precedence over this if not nil | `50%` means evictions are allowed as long as no more than 50% of the desired replicas are unhealthy. It will allow disruption if you have only 1 replica.|
| `pdb.minAvailable` | To configure the number of pods from that set that must still be available after the eviction, even in the absence of the evicted pod. minAvailable can be either an absolute number or a percentage. This takes precedence over pdb.maxUnavailable if not nil. | `nil`|

## Adding Azure Key Vault Secrets
Key vault secrets can be mounted to the container filesystem using what's called a [keyvault-flexvolume](https://github.com/Azure/kubernetes-keyvault-flexvol). A flexvolume is just a kubernetes volume from the user point of view. This means that the keyvault secrets are accessible as files after they have been mounted.
Expand Down
2 changes: 1 addition & 1 deletion java/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: A Helm chart for HMCTS Java Microservices
name: java
version: 1.1.1
version: 1.1.2
icon: https://github.com/hmcts/chart-java/raw/master/images/icons8-java-50.png
keywords:
- java
Expand Down
16 changes: 16 additions & 0 deletions java/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{ if .Values.pdb.enabled }}
---
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "hmcts.releaseName" . }}
spec:
{{ if .Values.pdb.minAvailable }}
minAvailable: {{ .Values.pdb.minAvailable }}
{{- else -}}
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ template "hmcts.releaseName" . }}
{{- end }}
3 changes: 3 additions & 0 deletions java/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ livenessPeriod: 15
livenessFailureThreshold: 3
applicationInsightsInstrumentKey: '00000000-0000-0000-0000-000000000000'
useInterpodAntiAffinity: false
pdb:
enabled: true
maxUnavailable: 50%

0 comments on commit de19e08

Please sign in to comment.