-
Notifications
You must be signed in to change notification settings - Fork 64
K8SPG-768 skip log creation #1217
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
base: main
Are you sure you want to change the base?
Conversation
… into K8SPG-768_skip_log_creation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall everything is fine, tested a little with fallocate
and couldn't see the logs that we have in main (per jira)
|
||
# Manage autogrow annotation. | ||
# Return size in Mebibytes. | ||
size=$(df --human-readable --block-size=M /pgdata | awk 'FNR == 2 {print $2}') | ||
use=$(df --human-readable /pgdata | awk 'FNR == 2 {print $5}') | ||
sizeInt="${size//M/}" | ||
# Use the sed punctuation class, because the shell will not accept the percent sign in an expansion. | ||
useInt=$(echo $use | sed 's/[[:punct:]]//g') | ||
triggerExpansion="$((useInt > 75))" | ||
if [ $triggerExpansion -eq 1 ]; then | ||
newSize="$(((sizeInt / 2)+sizeInt))" | ||
newSizeMi="${newSize}Mi" | ||
d='[{"op": "add", "path": "/metadata/annotations/suggested-pgdata-pvc-size", "value": "'"$newSizeMi"'"}]' | ||
curl --cacert ${CACERT} --header "Authorization: Bearer ${TOKEN}" -XPATCH "${APISERVER}/api/v1/namespaces/${NAMESPACE}/pods/${HOSTNAME}?fieldManager=kubectl-annotate" -H "Content-Type: application/json-patch+json" --data "$d" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to add a unit test with the FG enabled so that we can assert that is part exists in the script. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I think it's a good point. I will fix it.
…ona-postgresql-operator into K8SPG-768_skip_log_creation
commit: 508d86b |
CHANGE DESCRIPTION
Problem:
Excessive log generation from the replication-cert-copy container within the Postgres database pod. The container checks available disk space, and if the free volume is less than 75%, it triggers a Kubernetes API call to update the pod annotation with a suggested volume size (e.g., suggested-pgdata-pvc-size: 15345Mi).
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Avoid updating the pod annotation unless AutoGrowVolumes is enabled.
CHECKLIST
Jira
Needs Doc
) and QA (Needs QA
)?Tests
Config/Logging/Testability