-
Notifications
You must be signed in to change notification settings - Fork 359
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
[BUG] In kubernetes access to logs not work with pod with ID not found error #581
Comments
Hi @lenglet-k, I'm digging up this issue to let you know that this is fixed on our end. Can you confirm ? Thank you ! |
Hi, i have the same behavior in 1.5.7. |
@TheophileDiot I have test with 1.5.9. The first problem is rbac: We need to add apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/instance: bunkerweb
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: bunkerweb
helm.sh/chart: bunkerweb-0-master
name: bunkerweb
rules:
- apiGroups:
- ""
resources:
- services
- pods
- pods/log
- configmaps
- secrets
verbs:
- get
- watch
- list
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- get
- watch
- list After i have this error: [2024-07-23 07:45:26 +0000] [UI] [11] [❌] - Could not get logs for pod bunkerweb-v5krt
Traceback (most recent call last):
File "/usr/share/bunkerweb/ui/main.py", line 2058, in logs_container
kubernetes_logs = kubernetes_client.read_namespaced_pod_log(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/bunkerweb/deps/python/kubernetes/client/api/core_v1_api.py", line 23957, in read_namespaced_pod_log
return self.read_namespaced_pod_log_with_http_info(name, namespace, **kwargs) # noqa: E501
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/bunkerweb/deps/python/kubernetes/client/api/core_v1_api.py", line 24076, in read_namespaced_pod_log_with_http_info
return self.api_client.call_api(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/bunkerweb/deps/python/kubernetes/client/api_client.py", line 348, in call_api
return self.__call_api(resource_path, method,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/bunkerweb/deps/python/kubernetes/client/api_client.py", line 180, in __call_api
response_data = self.request(
^^^^^^^^^^^^^
File "/usr/share/bunkerweb/deps/python/kubernetes/client/api_client.py", line 373, in request
return self.rest_client.GET(url,
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/bunkerweb/deps/python/kubernetes/client/rest.py", line 244, in GET
return self.request("GET", url,
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/bunkerweb/deps/python/kubernetes/client/rest.py", line 238, in request
raise ApiException(http_resp=r)
kubernetes.client.exceptions.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Audit-Id': '74c628e8-21f8-46fe-a76c-a3b418aed614', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'Date': 'Tue, 23 Jul 2024 07:45:26 GMT', 'Content-Length': '198'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods \"bunkerweb-v5krt\" not found","reason":"NotFound","details":{"name":"bunkerweb-v5krt","kind":"pods"},"code":404} Ok i have found, this error is due to this code: https://github.com/bunkerity/bunkerweb/blob/v1.5.9/src/ui/main.py#L2058 i had not the KUBERNETES_NAMESPACE environment variable. - name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace Theses update in clusterrole and bunkerwebui deployment need update of helm charts. I have done here: #1340 |
Description
On bunkerweb-ui when i try to see the logs i have this error:
The pod with bunkerweb-wgcq6 name exist
How to reproduce
Start a kubernetes bunkerweb stack
Show logs from the logs menu
Logs
HTTP CALL, 404 response:
and the response:
The text was updated successfully, but these errors were encountered: