Skip to content

Commit

Permalink
chore: add ephemeral vol and pvc as default or provide pvc name from …
Browse files Browse the repository at this point in the history
…values
  • Loading branch information
royki committed Feb 8, 2023
1 parent c3742c8 commit 58d5677
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.2
version: 1.0.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generic-microservice-helm

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

Generic helm chart for Energy Web Foundation microservices

Expand Down Expand Up @@ -45,6 +45,10 @@ pre-commit install-hooks
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| container.ports.http | int | `80` | |
| deploymentStrategy | string | `"RollingUpdate"` | |
| emptyDir.enabled | bool | `false` | |
| emptyDir.mountPath | string | `"/cache"` | |
| emptyDir.name | string | `"shared-vol"` | |
| emptyDir.sizeLimit | string | `"500Mi"` | |
| env | object | `{}` | |
| extraLabels | object | `{}` | Extra lables to be added to all resources |
| fullnameOverride | string | `""` | |
Expand Down Expand Up @@ -75,8 +79,10 @@ pre-commit install-hooks
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| pvc.accessModes | string | `"ReadWriteOnce"` | |
| pvc.claimname | string | `"pv-claim"` | |
| pvc.enabled | bool | `false` | |
| pvc.mountPath | string | `"/tmp"` | |
| pvc.name | string | `"pvc-vol"` | |
| pvc.storage | string | `"20Gi"` | |
| pvc.storageClassName | string | `"default"` | |
| readinessProbe.enabled | bool | `false` | |
Expand Down
17 changes: 14 additions & 3 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,28 @@ spec:
{{- if .Values.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.emptyDir.enabled }}
volumeMounts:
- mountPath: {{ .Values.emptyDir.mountPath }}
name: {{ .Values.emptyDir.name | default (printf "%s-volume" (include "microservice.fullname" .)) }}
{{- end }}
{{- if .Values.pvc.enabled }}
volumeMounts:
- mountPath: {{ .Values.pvc.mountPath }}
name: {{ include "microservice.fullname" . }}-volume
name: {{ .Values.pvc.name | default (printf "%s-volume" (include "microservice.fullname" .)) }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- if .Values.emptyDir.enabled }}
volumes:
- name: {{ .Values.emptyDir.name | default (printf "%s-volume" (include "microservice.fullname" .)) }}
emptyDir:
sizeLimit: {{ .Values.emptyDir.sizeLimit }}
{{- end }}
{{- if .Values.pvc.enabled }}
volumes:
- name: {{ include "microservice.fullname" . }}-volume
- name: {{ .Values.pvc.name | default (printf "%s-volume" (include "microservice.fullname" .)) }}
persistentVolumeClaim:
claimName: {{ include "microservice.fullname" . }}-claim
claimName: {{ .Values.pvc.claimname | default (printf "%s-claim" (include "microservice.fullname" .)) }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
8 changes: 8 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,19 @@ livenessProbe:

pvc:
enabled: false
name: pvc-vol
claimname: pv-claim
accessModes: ReadWriteOnce
storageClassName: default
storage: 20Gi
mountPath: "/tmp"

emptyDir:
enabled: false
name: shared-vol
mountPath: /cache
sizeLimit: 500Mi


container:
ports:
Expand Down

0 comments on commit 58d5677

Please sign in to comment.