Skip to content

Commit

Permalink
Merge pull request #27 from dasmeta/fixes
Browse files Browse the repository at this point in the history
Added dataSource part to pvc.yaml
  • Loading branch information
viktoryathegreat committed Jun 29, 2022
2 parents 5c18d72 + 269cd0c commit 7245972
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 11 deletions.
4 changes: 2 additions & 2 deletions charts/base/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ 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.1.28
version: 0.1.29

# 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
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.28"
appVersion: "0.1.29"
39 changes: 32 additions & 7 deletions charts/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
```
dependencies:
- name: base
version: 0.1.28
version: 0.1.29
repository: https://dasmeta.github.io/helm
```

Expand Down Expand Up @@ -95,9 +95,9 @@ Here are 2 examples about this:
**Alias is not specified, name, version and appVersion are not overridden by parent chart**
In this case, labels will be like this:**

- `helm.sh/chart: base-0.1.28`
- `helm.sh/chart: base-0.1.29`
- `app.kubernetes.io/name: base`
- `app.kubernetes.io/version: 0.1.28`
- `app.kubernetes.io/version: 0.1.29`

Chart.yaml
```
Expand All @@ -110,7 +110,7 @@ appVersion: "0.1.0"
dependencies:
- name: base
version: 0.1.28
version: 0.1.29
repository: https://dasmeta.github.io/helm
```

Expand Down Expand Up @@ -146,7 +146,7 @@ appVersion: "0.1.0"
dependencies:
- name: base
version: 0.1.28
version: 0.1.29
repository: https://dasmeta.github.io/helm
alias: my-app-base
```
Expand Down Expand Up @@ -174,7 +174,7 @@ appVersion: "0.1.0"
dependencies:
- name: base
version: 0.1.28
version: 0.1.29
repository: https://dasmeta.github.io/helm
```

Expand Down Expand Up @@ -205,14 +205,39 @@ my-app-base:
```

### Volumes

**The PVC has a specific name**
```
my-app-base:
...
deployment:
volumes:
- name: test-volume
persistentVolumeClaim:
claimName:
claimName: volume-1
```

**The PVC has the name of the release**
```
my-app-base:
...
deployment:
volumes:
- name: test-volume
persistentVolumeClaim:
dynamicName: true
```

### PVC
By defining `storage` block in values.yaml file you can create a PVC resource.
```
my-app-base:
...
storage:
className: aws-efs
accessModes:
- ReadWriteOnce
requestedSize: 4Gi
```

### Health Checks
Expand Down
4 changes: 4 additions & 0 deletions charts/base/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ spec:
- name: {{ coalesce $element.name (add $index 1) }}
{{- if $element.persistentVolumeClaim }}
persistentVolumeClaim:
{{- if $element.persistentVolumeClaim.claimName }}
claimName: {{ $element.persistentVolumeClaim.claimName }}
{{- else }}
claimName: {{ include "base.fullname" $ }}
{{- end }}
{{- end }}
{{- if $element.secret }}
secret:
Expand Down
7 changes: 5 additions & 2 deletions charts/base/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "base.fullname" . }}
name: {{ .Values.storage.persistentVolumeClaimName | default (include "base.fullname" .) }}
labels:
{{- include "base.labels" . | nindent 4 }}
{{- if .Values.storage.keepPvc }}
Expand All @@ -20,5 +20,8 @@ spec:
{{- if .className }}
storageClassName: {{ .className }}
{{- end }}
{{- end }}
{{- end }}
dataSource:
kind: PersistentVolumeClaim
name: {{ .Values.storage.persistentVolumeClaimName | default (include "base.fullname" .) }}
{{- end }}

0 comments on commit 7245972

Please sign in to comment.