Skip to content

Commit

Permalink
[simple-app] Introduce an optional PodDisruptionBudget resource (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
diranged authored Apr 23, 2021
1 parent ab32295 commit 34c4601
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/simple-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: simple-app
description: Default Microservice Helm Chart
type: application
version: 0.2.2
version: 0.3.0
appVersion: latest
maintainers:
- name: diranged
Expand Down
3 changes: 2 additions & 1 deletion charts/simple-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Default Microservice Helm Chart

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

[deployments]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
[hpa]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
Expand Down Expand Up @@ -44,6 +44,7 @@ defaults for you like the Kubernetes [Horizontal Pod Autoscaler][hpa].
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podDisruptionBudget | object | `{}` | Set up a PodDisruptionBudget for the Deployment |
| podSecurityContext | object | `{}` | |
| ports | list | `[{"containerPort":80,"name":"http","protocol":"TCP"},{"containerPort":443,"name":"https","protocol":"TCP"}]` | A list of Port objects that are exposed by the service. These ports are applied to the main container, or the proxySidecar container (if enabled). The port list is also used to generate Network Policies that allow ingress into the pods. |
| proxySidecar.enabled | bool | `false` | (Boolean) Enables injecting a pre-defined reverse proxy sidecar container into the Pod containers list. |
Expand Down
13 changes: 13 additions & 0 deletions charts/simple-app/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.podDisruptionBudget -}}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "simple-app.fullname" . }}
labels:
{{- include "simple-app.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "simple-app.selectorLabels" . | nindent 8 }}
{{ toYaml .Values.podDisruptionBudget | nindent 2 }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/simple-app/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# -- The number of Pods to start up by default
replicaCount: 1

# -- Set up a PodDisruptionBudget for the Deployment
podDisruptionBudget: {}

image:
# -- (String) The Docker image name and repository for your application
repository: nginx
Expand Down

0 comments on commit 34c4601

Please sign in to comment.