File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 216216 if post250 {
217217 script = fmt .Sprintf (`
218218# Parameters for curl when managing autogrow annotation.
219- APISERVER="https://kubernetes.default.svc "
219+ APISERVER="https://${KUBERNETES_SERVICE_HOST} "
220220SERVICEACCOUNT="/var/run/secrets/kubernetes.io/serviceaccount"
221221NAMESPACE=$(cat ${SERVICEACCOUNT}/namespace)
222222TOKEN=$(cat ${SERVICEACCOUNT}/token)
@@ -246,7 +246,7 @@ while read -r -t 5 -u "${fd}" ||:; do
246246 newSize="$(((sizeInt / 2)+sizeInt))"
247247 newSizeMi="${newSize}Mi"
248248 d='[{"op": "add", "path": "/metadata/annotations/suggested-pgdata-pvc-size", "value": "'"$newSizeMi"'"}]'
249- 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"
249+ 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"
250250 fi
251251done
252252` ,
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ containers:
172172 - |-
173173 monitor() {
174174 # Parameters for curl when managing autogrow annotation.
175- APISERVER="https://kubernetes.default.svc "
175+ APISERVER="https://${KUBERNETES_SERVICE_HOST} "
176176 SERVICEACCOUNT="/var/run/secrets/kubernetes.io/serviceaccount"
177177 NAMESPACE=$(cat ${SERVICEACCOUNT}/namespace)
178178 TOKEN=$(cat ${SERVICEACCOUNT}/token)
@@ -202,7 +202,7 @@ containers:
202202 newSize="$(((sizeInt / 2)+sizeInt))"
203203 newSizeMi="${newSize}Mi"
204204 d='[{"op": "add", "path": "/metadata/annotations/suggested-pgdata-pvc-size", "value": "'"$newSizeMi"'"}]'
205- 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"
205+ 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"
206206 fi
207207 done
208208 }; export -f monitor; exec -a "$0" bash -ceu monitor
You can’t perform that action at this time.
0 commit comments