Skip to content

Commit

Permalink
Expose the setting of shared memory for internal DB
Browse files Browse the repository at this point in the history
Port the change in goharbor/harbor#15049 to the
chart.  Uses emptyDir as a workaround as k8s does not expose shm as a
setting of a pod/container.

Signed-off-by: Daniel Jiang <[email protected]>
  • Loading branch information
reasonerjt committed Jun 7, 2021
1 parent 73248da commit 1bd020f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ The following table lists the configurable parameters of the Harbor chart and th
| `database.internal.image.repository` | Repository for database image | `goharbor/harbor-db` |
| `database.internal.image.tag` | Tag for database image | `dev` |
| `database.internal.password` | The password for database | `changeit` |
| `database.internal.shmSizeLimit` | The limit for the size of shared memory for internal postGreSQL, conventionally it's around 50% of the memory limit of the container | `512Mi`
| `database.internal.resources` | The [resources] to allocate for container | undefined |
| `database.internal.automountServiceAccountToken` | Mount serviceAccountToken? | `false` |
| `database.internal.initContainer.migrator.resources` | The [resources] to allocate for the database migrator initContainer | undefined |
Expand Down
9 changes: 7 additions & 2 deletions templates/database/database-ss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,17 @@ spec:
- name: database-data
mountPath: /var/lib/postgresql/data
subPath: {{ $database.subPath }}
{{- if not .Values.persistence.enabled }}
- name: shm-volume
mountPath: /dev/shm
volumes:
- name: shm-volume
emptyDir:
medium: Memory
sizeLimit: {{ .Values.database.internal.shmSizeLimit }}
{{- if not .Values.persistence.enabled }}
- name: "database-data"
emptyDir: {}
{{- else if $database.existingClaim }}
volumes:
- name: "database-data"
persistentVolumeClaim:
claimName: {{ $database.existingClaim }}
Expand Down
4 changes: 4 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ database:
tag: dev
# The initial superuser password for internal database
password: "changeit"
# The size limit for Shared memory, pgSQL use it for shared_buffer
# More details see:
# https://github.com/goharbor/harbor/issues/15034
shmSizeLimit: 512Mi
# resources:
# requests:
# memory: 256Mi
Expand Down

0 comments on commit 1bd020f

Please sign in to comment.