- use pagination to reduce memory consumption/prevent
OOM kills when there is a very large number of pods
in the cluster (i.e 1000+)
- we have to fetch a list of pods, since the kubernetes api
does not support fuzzy matches for fields and the field
that we are filtering for (`metadata.name`) may contain
dynamic elements (like some -sha-1234 suffix)
- update python dependencies to their latest versions
-> requests (2.31.0 -> 2.32.4)
-> kubernetes (29.0.0 -> 33.1.0)
Issue-ID: INT-2325
Change-Id: I9df0aec35c13b8c6c55db3ee22784a30d033f586
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
ready = False
log.info("Checking if pod %s is ready", pod_name)
try:
ready = False
log.info("Checking if pod %s is ready", pod_name)
try:
- response = coreV1Api.list_namespaced_pod(namespace=namespace,
- watch=False)
- for pod in response.items:
- if (pod.metadata.name.startswith(pod_name)):
- ready = is_pod_ready(pod)
+ _continue = ""
+ while True:
+ if not _continue:
+ response = coreV1Api.list_namespaced_pod(namespace=namespace, watch=False, limit=300)
+ else:
+ response = coreV1Api.list_namespaced_pod(namespace=namespace, watch=False, limit=300, _continue=_continue)
+
+ for pod in response.items:
+ if (pod.metadata.name.startswith(pod_name)):
+ ready = is_pod_ready(pod)
+ break
+
+ _continue = response._metadata._continue
+
+ if _continue is None:
+ break
+
except ApiException as exc:
log.error("Exception when calling list_namespaced_pod: %s\n", exc)
return ready
except ApiException as exc:
log.error("Exception when calling list_namespaced_pod: %s\n", exc)
return ready
url = DEF_URL
ns = ""
interval=None
url = DEF_URL
ns = ""
interval=None
try:
opts, _args = getopt.getopt(argv, "hj:s:c:p:a:t:m:u:n:i:", ["service-name=",
"container-name=",
try:
opts, _args = getopt.getopt(argv, "hj:s:c:p:a:t:m:u:n:i:", ["service-name=",
"container-name=",
"url=",
"job-name=",
"namespace=",
"url=",
"job-name=",
"namespace=",
"help"])
for opt, arg in opts:
if opt in ("-h", "--help"):
"help"])
for opt, arg in opts:
if opt in ("-h", "--help"):
-requests==2.31.0
-kubernetes==29.0.0
+requests==2.32.4
+kubernetes==33.1.0
# because they are used in Jenkins, whose plug-in doesn't support
major=6
# because they are used in Jenkins, whose plug-in doesn't support
major=6
base_version=${major}.${minor}.${patch}
base_version=${major}.${minor}.${patch}