Skip to content

Commit

Permalink
simple-app: v0.11.4
Browse files Browse the repository at this point in the history
  • Loading branch information
elephantum committed Feb 9, 2024
1 parent bca485e commit 2fed5e5
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 12 deletions.
4 changes: 4 additions & 0 deletions charts/simple-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.11.4

* Add `.volumes[].secret` and `.volumes[].configMap` options

# 0.11.3

* Add GCP IAP configuation for `GCPBackendPolicy`
Expand Down
2 changes: 1 addition & 1 deletion charts/simple-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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: "0.11.3"
version: "0.11.4"

# 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
14 changes: 10 additions & 4 deletions charts/simple-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,22 @@ spec:
sizeLimit: {{ .Values.shmSize }}
{{- end }}
{{- range .Values.volumes }}
- name: {{ $fullName }}-{{ .name }}
- name: {{ .name }}
{{- if .emptyDir }}
emptyDir:
sizeLimit: {{ .size }}
{{- else }}
{{- else if .size }}
persistentVolumeClaim:
claimName: {{ $fullName }}-{{ .name }}
{{- else if .configMap }}
configMap:
{{- .configMap | toYaml | nindent 12 }}
{{- else if .secret }}
secret:
{{- .secret | toYaml | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.configs }}
{{- range .Values.configs }}
- name: configs
configMap:
name: {{ $fullName }}
Expand Down Expand Up @@ -102,7 +108,7 @@ spec:
mountPath: /dev/shm
{{- end }}
{{- range .Values.volumes }}
- name: {{ $fullName }}-{{ .name }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- end }}
{{- range .Values.configs }}
Expand Down
4 changes: 2 additions & 2 deletions charts/simple-app/tests/__snapshot__/simple_test.yaml.snap
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ All manifests should match snapshot:
securityContext: {}
volumeMounts:
- mountPath: /data
name: simple-data
name: data
securityContext: {}
serviceAccountName: simple
volumes:
- name: simple-data
- name: data
persistentVolumeClaim:
claimName: simple-data
2: |
Expand Down
20 changes: 16 additions & 4 deletions charts/simple-app/tests/simple_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ tests:
path: spec.template.spec.containers[0].volumeMounts[0]
value:
mountPath: /data
name: simple-data
name: data
- equal:
path: spec.template.spec.volumes[0]
value:
name: simple-data
name: data
persistentVolumeClaim:
claimName: simple-data

Expand All @@ -254,14 +254,26 @@ tests:
path: spec.template.spec.containers[0].volumeMounts[0]
value:
mountPath: /data
name: simple-data
name: data
- equal:
path: spec.template.spec.volumes[0]
value:
name: simple-data
name: data
emptyDir:
sizeLimit: 1Gi

- it: PVC should not be created if emptyDir
template: pvc.yaml
set:
volumes:
- name: data
size: 1Gi
mountPath: /data
emptyDir: true
asserts:
- hasDocuments:
count: 0

- it: PVC should have correctly mounted volumes with pvc
template: pvc.yaml
asserts:
Expand Down
20 changes: 19 additions & 1 deletion charts/simple-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,29 @@ command: []
shmSize: ""

volumes: []
# if "size" is set, it will create a PVC
# - name: data
# size: 1Gi
# mountPath: /data
# If not need pvc:

# if "emptyDir" is set, it will create an emptyDir
# - name: cache
# emptyDir: true
# size: 1Gi
# mountPath: /cache

# if "secret" is set, it will use the secret
# - name: secret
# secret:
# secretName: secret
# mountPath: /secret

# if "configMap" is set, it will use the configMap
# - name: config
# configMap:
# name: config
# mountPath: /config


configs: []
# - name: conn.json
Expand Down

0 comments on commit 2fed5e5

Please sign in to comment.