File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,19 @@ func InstancePod(ctx context.Context,
168168 Image : config .PostgresContainerImage (inCluster ),
169169 ImagePullPolicy : inCluster .Spec .ImagePullPolicy ,
170170 Resources : inInstanceSpec .Resources ,
171+ Command : []string {
172+ `echo "for pid in $(pgrep -f \"/usr/pgsql-16/bin/postgres\"); do
173+ current=$(cat /proc/$pid/oom_score_adj 2>/dev/null || echo \"\")
174+ if [ \"$current\" != \"-900\" ]; then
175+ echo \"adjusting oom score for pid $pid\"
176+ echo -900 > /proc/$pid/oom_score_adj
177+ fi
178+ done
179+
180+ sleep 30
181+ done" > /oom-fixer.sh && chmod +x /oom-fixer.sh` ,
182+ "/oom-fixer.sh & /usr/bin/patroni" ,
183+ },
171184
172185 Ports : []corev1.ContainerPort {{
173186 Name : naming .PortPostgreSQL ,
You can’t perform that action at this time.
0 commit comments