Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/474 to release #476

Merged
merged 10 commits into from
Mar 28, 2022
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 or (not (hasKey .app.harness.deployment.volume "auto")) .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