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

feat: expose resources and additionalVolumes for HugePages #63

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions chart/templates/postgres-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ spec:
{{- toYaml .Values.postgresql.databases | nindent 4 }}
postgresql:
version: {{ .Values.postgresql.version | quote }}
resources:
{{- toYaml .Values.postgresql.resources | nindent 4 }}
{{- if ne (len .Values.postgresql.additionalVolumes) 0 }}
additionalVolumes:
{{- range .Values.postgresql.additionalVolumes }}
- {{ . | toYaml | nindent 6 }}
{{- end }}
{{- end }}
sidecars:
- name: "exporter"
image: {{ .Values.metrics.image | quote }}
Expand Down
8 changes: 8 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
postgresql:
enabled: false
ingress: []
resources:
limits:
cpu: 500m
memory: 500Mi
requests:
cpu: 100m
memory: 100Mi
additionalVolumes: []

# teamId: "uds"
# volume:
Expand Down
17 changes: 17 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,20 @@ Postgres Operator is configured through [`acid.zalan.do/v1` `Postgresql` custom
- `postgresql.databases`: The database names to create and the users they map to (i.e. `gitlabdb: gitlab.gitlab`)
- `postgresql.version`: The version of Postgres to run (i.e. `14`)
- `postgresql.ingress`: A list of ingress entries to create for this cluster (follows the [custom networking definition](https://github.com/defenseunicorns/uds-software-factory/blob/main/docs/networking.md) except for `direction` which is always `Ingress` and `selector` which is always `cluster-name: pg-cluster`)
- `postgresql.resources`: A Kubernetes Pod resource specification to define requests and limits
- `postgresql.additionalVolumes`: A list of additional volumes to map into the Postgres container if needed (see below)

## Postgres HugePages

Postgres Operator can also support HugePages by setting the following keys appropriately for your environment. You can learn more about HugePages in Kubernetes in their [Manage HugePages documentation](https://kubernetes.io/docs/tasks/manage-hugepages/scheduling-hugepages/#api) and learn more about these fields in the [`Postgresql` custom resource reference documentation](https://github.com/zalando/postgres-operator/blob/master/docs/reference/cluster_manifest.md#cluster-manifest-reference).

- `postgresql.resources`: This allows you to set the desired hugepages `limits` and `requests`
- `postgresql.additionalVolumes`: This allows you to map the correct hugepages volumes into the container, e.g.:

```yaml
- name: hugepage-2mi
mountPath: /hugepages-2Mi
volumeSource:
emptyDir:
medium: HugePages-2Mi
```