Skip to content

Commit 498aaed

Browse files
committed
feat(database): add hugepages support
1 parent 07e637f commit 498aaed

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ RUN mkdir -p $WALG_ENVDIR \
3030
python3 \
3131
ca-certificates \
3232
python3-pip \
33-
&& pip3 install envdir \
34-
&& sed -i -r 's/#huge_pages.*?/huge_pages = off/g' /usr/share/postgresql/postgresql.conf.sample
33+
&& pip3 install envdir
3534

3635
CMD ["/docker-entrypoint.sh", "postgres"]
3736
EXPOSE 5432

charts/database/templates/database-deployment.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,22 @@ spec:
3535
imagePullPolicy: {{.Values.imagePullPolicy}}
3636
ports:
3737
- containerPort: 5432
38-
{{- if or (.Values.limitsCpu) (.Values.limitsMemory)}}
38+
{{- if or (.Values.limitsCpu) (.Values.limitsMemory)}}
3939
resources:
4040
limits:
41-
{{- if (.Values.limitsCpu) }}
41+
{{- if (.Values.limitsCpu) }}
4242
cpu: {{.Values.limitsCpu}}
43-
{{- end}}
44-
{{- if (.Values.limitsMemory) }}
43+
{{- end}}
44+
{{- if (.Values.limitsMemory) }}
4545
memory: {{.Values.limitsMemory}}
46-
{{- end}}
47-
{{- end}}
46+
{{- end}}
47+
{{- if (.Values.limitsHugepages2Mi) }}
48+
hugepages-2Mi: {{.Values.limitsHugepages2Mi}}
49+
{{- end}}
50+
{{- if (.Values.limitsHugepages1Gi) }}
51+
hugepages-1Gi: {{.Values.limitsHugepages1Gi}}
52+
{{- end}}
53+
{{- end}}
4854
env:
4955
- name: DATABASE_STORAGE
5056
value: "{{.Values.global.storage}}"

charts/database/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ imageTag: "canary"
44
imageRegistry: "docker.io"
55
# limitsCpu: "100m"
66
# limitsMemory: "50Mi"
7+
# limitsHugepages2Mi: 100Mi
8+
# limitsHugepages1Gi: 2Gi
79
timeout: "1200"
810
# The username and password to be used by the on-cluster database.
911
# If left empty they will be generated using randAlphaNum

rootfs/docker-entrypoint.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ if [ "$1" = 'postgres' ]; then
2626
# look specifically for PG_VERSION, as it is expected in the DB dir
2727
if [ ! -s "$PGDATA/PG_VERSION" ]; then
2828
gosu postgres initdb
29-
3029
# check password first so we can output the warning before postgres
3130
# messes it up
3231
if [ "$POSTGRES_PASSWORD" ]; then

0 commit comments

Comments
 (0)