Skip to content

Commit

Permalink
#469 feature: enable application volume to be shared across multiple …
Browse files Browse the repository at this point in the history
…different deployments
  • Loading branch information
zsinnema committed Mar 22, 2022
1 parent add896d commit 9814543
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/applications/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ The most important configuration entries are the following:
- `deployment`: creates a deployment
- `auto`: if true, creates the deployment automatically
- `resources`: define cpu and memory limits
- `volume`: application persistent volume
- `service`:
- `auto`: if true, creates the service automatically
- `dependencies`: lists of applications/images this application depends from
Expand Down
31 changes: 31 additions & 0 deletions docs/applications/volumes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Application Volume

Application Volumes are defined at `harness.deployment.volume`.
At the time of writing this documentation CloudHarness supports only one volume per deployment.

The Application Volume will be mounted in the container at a specific path at **deployment** time.

A Volume can be mounted by one or more pods (shared Volume). Be careful: only one of the deployments
should create the Volume, the other deployment should only mount it.

This can be established through setting the `auto` attribute (default false) of the Volume object
auto: true --> auto create the volume and mount
auto: false --> only mount the volume

Shared volumes are handy when you have e.g. 2 deployments for one app: frontend & backend deployment
in such a case it could be helpfull that the frontend can access files stored by the backend.
E.g. user uploaded media files

**Example**

```yaml
harness:
...
deployment:
...
volume:
name: myFirstVolume
mountpath: /usr/src/app/myvolume
auto: true
size: 5Gi
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- define "deploy_utils.pvolume" }}
{{- if not .app.harness.deployment.volume.auto }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand All @@ -12,6 +13,7 @@ spec:
resources:
requests:
storage: {{ .app.harness.deployment.volume.size }}
{{- end }}
---
{{- end }}
{{- range $app := .Values.apps }}
Expand Down

0 comments on commit 9814543

Please sign in to comment.