-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding volumes and some refactor
- Loading branch information
1 parent
e550f33
commit d5280cc
Showing
9 changed files
with
131 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# pvc from values.yaml | ||
{{- range $volumeName, $volume := .Values.volumes }} | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ include "generic-app.fullname" . }}-{{ $volumeName }} | ||
labels: | ||
{{- include "generic-app.labels" $ | nindent 4 }} | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: {{ $volume.size }} | ||
storageClassName: {{ $volume.storageClass }} | ||
volumeMode: Filesystem | ||
--- | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
charts/generic-app/tests/__snapshot__/deployment_test.yaml.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
should work: | ||
1: | | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
link.argocd.argoproj.io/external-link: https://hello-world.com | ||
labels: | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/managed-by: Helm | ||
app.kubernetes.io/name: generic-app | ||
helm.sh/chart: generic-app-0.1.10 | ||
name: web-RELEASE-NAME-generic-app | ||
spec: | ||
replicas: 1 | ||
revisionHistoryLimit: 3 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/name: generic-app | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 0 | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
annotations: | ||
checksum/env: 52133ddfcd583280388a8bbfb67a417b6b660f75bc63ec1b01beec811d4498ef | ||
checksum/envEncrypted: 52133ddfcd583280388a8bbfb67a417b6b660f75bc63ec1b01beec811d4498ef | ||
labels: | ||
app.kubernetes.io/instance: RELEASE-NAME | ||
app.kubernetes.io/name: generic-app | ||
spec: | ||
containers: | ||
- image: map[tag:latest] | ||
imagePullPolicy: Always | ||
lifecycle: | ||
preStop: | ||
exec: | ||
command: | ||
- sleep | ||
- "10" | ||
name: web-RELEASE-NAME-generic-app | ||
ports: | ||
- containerPort: 80 | ||
name: http | ||
volumeMounts: | ||
- mountPath: /data | ||
name: data | ||
volumes: | ||
- name: data | ||
persistentVolumeClaim: | ||
claimName: RELEASE-NAME-generic-app-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
suite: test deployment | ||
templates: | ||
- deployment.yaml | ||
tests: | ||
- it: should have volume mounts for data | ||
set: | ||
volumes: | ||
data: | ||
size: 1Gi | ||
storageClass: "" | ||
mountPath: /data | ||
asserts: | ||
- matchSnapshot: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters