eclipse / jifa

🔬 Online Heap Dump, GC Log, Thread Dump & JFR File Analyzer.
https://eclipse.github.io/jifa/
Eclipse Public License 2.0
543 stars 96 forks source link

jifa can only be deployed in the "jifa" k8s namespace? #262

Closed mark8s closed 8 months ago

mark8s commented 8 months ago

Well, I am currently building a jifa helm chart by myself, and I also want to contribute to this project after it is completed.

But when I deployed it in the test-jifa namespace, the following error log occurred:

2024-03-18T10:29:17.795Z  INFO 1 --- [nio-8102-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-03-18T10:29:17.795Z  INFO 1 --- [nio-8102-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2024-03-18T10:29:17.798Z  INFO 1 --- [nio-8102-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 2 ms
2024-03-18T10:29:26.393Z ERROR 1 --- [ker - 1 Starter] o.e.j.s.service.impl.K8SWorkerScheduler  : Failed to start elastic worker, response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods is forbidden: User \"system:serviceaccount:test-jifa:jifa\" cannot create resource \"pods\" in API group \"\" in the namespace \"jifa\"","reason":"Forbidden","details":{"kind":"pods"},"code":403}

2024-03-18T10:29:48.920Z ERROR 1 --- [MessageBroker-3] o.e.j.s.service.impl.K8SWorkerScheduler  : Error occurred when terminating inconsistent instances

io.kubernetes.client.openapi.ApiException: 
    at io.kubernetes.client.openapi.ApiClient.handleResponse(ApiClient.java:973) ~[client-java-api-18.0.1.jar:na]
    at io.kubernetes.client.openapi.ApiClient.execute(ApiClient.java:885) ~[client-java-api-18.0.1.jar:na]
    at io.kubernetes.client.openapi.apis.CoreV1Api.listNamespacedPodWithHttpInfo(CoreV1Api.java:32918) ~[client-java-api-18.0.1.jar:na]
    at io.kubernetes.client.openapi.apis.CoreV1Api.listNamespacedPod(CoreV1Api.java:32807) ~[client-java-api-18.0.1.jar:na]
    at org.eclipse.jifa.server.service.impl.K8SWorkerScheduler.terminateInconsistentInstancesQuietly(K8SWorkerScheduler.java:179) ~[jifa/:na]
    at org.eclipse.jifa.server.task.LockSupport.runUnderLock(LockSupport.java:35) ~[jifa/:na]
    at org.eclipse.jifa.server.task.ElasticWorkerRelatedTasks.terminateInconsistentInstances(ElasticWorkerRelatedTasks.java:56) ~[jifa/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-6.0.12.jar:6.0.12]
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-6.0.12.jar:6.0.12]
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na]
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

image

image

I looked through the source code, and it seems that this is hard-coded in the code. It seems that it can't be passed in using args?

D-D-H commented 8 months ago

I agree. We should make it configurable.

mark8s commented 8 months ago

@D-D-H Can this problem be fixed in the next two days? Also update to the latest image by the way. :smile::smile::smile:

D-D-H commented 8 months ago

@mark8s

I can fix this quickly.

The current main branch code is very different from the last time the image was built. Is it convenient for you to build a local image yourself first?

mark8s commented 8 months ago

@D-D-H Yes, I can build the image myself. I want to submit the helm charts I made myself to deploy jifa, is that OK?

D-D-H commented 8 months ago

I want to submit the helm charts I made myself to deploy jifa, is that OK?

Do you mean you want to submit a PR for adding support for helm? Contributions are very welcome.

D-D-H commented 8 months ago

@mark8s

I filed a PR for this issue. Please verify it if it works for you.

https://github.com/eclipse/jifa/pull/264

mark8s commented 8 months ago

@D-D-H Could you please help me review this PR? I submit helm chart #268

D-D-H commented 8 months ago

@D-D-H Could you please help me review this PR? I submit helm chart #268

Thanks.

We will review it.