Skip to content

Commit

Permalink
Merge pull request #20 from colearendt/add-generic-storage
Browse files Browse the repository at this point in the history
add storage values to generic chart
  • Loading branch information
colearendt authored Jan 19, 2022
2 parents 74f5867 + 6f0b371 commit af8aec7
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/generic/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: generic
description: A generic Helm chart for Kubernetes

type: application
version: 0.1.2
version: 0.1.3
appVersion: latest
maintainers:
- name: colearendt
Expand Down
5 changes: 5 additions & 0 deletions charts/generic/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.1.3

- Add `storage` values for setting a PersistentVolumeClaim
- It is best when we do not need to use this, but alas, it is often necessary

# 0.1.2

- Add `pod.env` values for setting pod environment variables
Expand Down
54 changes: 54 additions & 0 deletions charts/generic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# generic

![Version: 0.1.3](https://img.shields.io/badge/Version-0.1.3-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)

A generic Helm chart for Kubernetes

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| colearendt | [email protected] | https://github.com/colearendt |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| autoscaling.enabled | bool | `false` | |
| autoscaling.maxReplicas | int | `100` | |
| autoscaling.minReplicas | int | `1` | |
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"nginx"` | |
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | |
| ingress.annotations | object | `{}` | |
| ingress.enabled | bool | `false` | |
| ingress.hosts[0].host | string | `"chart-example.local"` | |
| ingress.hosts[0].paths | list | `[]` | |
| ingress.tls | list | `[]` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| pod.env | list | `[]` | |
| pod.port | int | `80` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| securityContext | object | `{}` | |
| service.port | int | `80` | |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | The name of the service account to use. -- If not set and create is true, a name is generated using the fullname template |
| storage.accessModes[0] | string | `"ReadWriteOnce"` | |
| storage.create | bool | `false` | |
| storage.name | string | `""` | |
| storage.requests.storage | string | `"6Gi"` | |
| storage.storageClassName | string | `""` | |
| tolerations | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0)
5 changes: 5 additions & 0 deletions charts/generic/ci/storage-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
storage:
name: my-storage
create: true
requests:
storage: 2Gi
22 changes: 22 additions & 0 deletions charts/generic/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if .Values.storage.create }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{default (print (include "generic.fullname" .) "-storage" ) .Values.storage.name }}
namespace: {{ $.Release.Namespace }}
annotations:
"helm.sh/resource-policy": keep
spec:
accessModes:
{{- .Values.storage.accessModes | toYaml | nindent 4 }}
volumeMode: Filesystem
{{- if .Values.storage.storageClassName }}
storageClassName: {{ .Values.storage.storageClassName }}
{{- end }}
resources:
{{- with .Values.storage.requests }}
requests:
{{- . | toYaml | nindent 6 }}
{{- end }}
---
{{- end }}
9 changes: 9 additions & 0 deletions charts/generic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ pod:
port: 80
env: []

storage:
name: ''
create: false
accessModes:
- ReadWriteOnce
storageClassName: ''
requests:
storage: 6Gi

serviceAccount:
# -- Specifies whether a service account should be created
create: true
Expand Down

0 comments on commit af8aec7

Please sign in to comment.