wave icon indicating copy to clipboard operation
wave copied to clipboard

updated k8s client to 21.0.0

Open munishchouhan opened this issue 1 year ago • 5 comments
trafficstars

This PR will update k8s client to 21.0.0

munishchouhan avatar Jul 05 '24 10:07 munishchouhan

Tested in locally, getting this error:

java.lang.NoSuchMethodError: 'void io.kubernetes.client.openapi.models.V1Pod.validateJsonObject(com.google.gson.JsonObject)'
	at io.kubernetes.client.openapi.models.V1Pod$CustomTypeAdapterFactory$1.read(V1Pod.java:309)
	at io.kubernetes.client.openapi.models.V1Pod$CustomTypeAdapterFactory$1.read(V1Pod.java:299)
	at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:308)
	at com.google.gson.Gson.fromJson(Gson.java:1361)
	at com.google.gson.Gson.fromJson(Gson.java:1262)
	at com.google.gson.Gson.fromJson(Gson.java:1171)
	at com.google.gson.Gson.fromJson(Gson.java:1137)
	at io.kubernetes.client.openapi.JSON.deserialize(JSON.java:778)
	at io.kubernetes.client.openapi.ApiClient.deserialize(ApiClient.java:895)
	at io.kubernetes.client.openapi.ApiClient.handleResponse(ApiClient.java:1105)
	at io.kubernetes.client.openapi.ApiClient.execute(ApiClient.java:1029)
	at io.kubernetes.client.openapi.apis.CoreV1Api.createNamespacedPodWithHttpInfo(CoreV1Api.java:10876)
	at io.kubernetes.client.openapi.apis.CoreV1Api$APIcreateNamespacedPodRequest.execute(CoreV1Api.java:10972)
	at io.seqera.wave.service.k8s.K8sServiceImpl.transferContainer(K8sServiceImpl.groovy:559)
	at io.seqera.wave.service.blob.impl.KubeTransferStrategy.transfer(KubeTransferStrategy.groovy:52)
	at io.seqera.wave.service.blob.impl.BlobCacheServiceImpl.store(BlobCacheServiceImpl.groovy:233)
	at io.seqera.wave.service.blob.impl.BlobCacheServiceImpl.storeIfAbsent(BlobCacheServiceImpl.groovy:195)
	at io.seqera.wave.service.blob.impl.BlobCacheServiceImpl.retrieveBlobCache(BlobCacheServiceImpl.groovy:111)
	at io.seqera.wave.controller.RegistryProxyController.fromDownloadResponse(RegistryProxyController.groovy:321)
	at io.seqera.wave.controller.RegistryProxyController.handleDelegate0(RegistryProxyController.groovy:225)
	at io.seqera.wave.controller.RegistryProxyController.handleGet0(RegistryProxyController.groovy:194)
	at io.seqera.wave.controller.RegistryProxyController.handleGet(RegistryProxyController.groovy:135)
	at io.seqera.wave.controller.$RegistryProxyController$Definition$Exec.dispatch(Unknown Source)
	at io.micronaut.context.AbstractExecutableMethodsDefinition$DispatchedExecutableMethod.invoke(AbstractExecutableMethodsDefinition.java:371)
	at io.micronaut.context.DefaultBeanContext$4.invoke(DefaultBeanContext.java:594)
	at io.micronaut.web.router.AbstractRouteMatch.execute(AbstractRouteMatch.java:303)
	at io.micronaut.web.router.RouteMatch.execute(RouteMatch.java:111)
	at io.micronaut.http.context.ServerRequestContext.with(ServerRequestContext.java:103)
	at io.micronaut.http.server.RouteExecutor.lambda$executeRoute$14(RouteExecutor.java:659)
	at reactor.core.publisher.FluxDeferContextual.subscribe(FluxDeferContextual.java:49)
	at reactor.core.publisher.InternalFluxOperator.subscribe(InternalFluxOperator.java:62)
	at reactor.core.publisher.FluxSubscribeOn$SubscribeOnSubscriber.run(FluxSubscribeOn.java:194)
	at io.micronaut.reactive.reactor.instrument.ReactorInstrumentation.lambda$init$0(ReactorInstrumentation.java:62)
	at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
	at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
	at io.micrometer.core.instrument.composite.CompositeTimer.recordCallable(CompositeTimer.java:129)
	at io.micrometer.core.instrument.Timer.lambda$wrap$1(Timer.java:206)
	at io.micronaut.scheduling.instrument.InvocationInstrumenterWrappedCallable.call(InvocationInstrumenterWrappedCallable.java:53)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1589)

munishchouhan avatar Jul 05 '24 10:07 munishchouhan

issue created https://github.com/kubernetes-client/java/issues/3539

munishchouhan avatar Jul 05 '24 11:07 munishchouhan

Still not working error:


io.seqera.wave.exception.BadRequestException: Unexpected build failure - {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods \"build-090844c190db1409-1\" is forbidden: pod rejected: Pod Overhead set without corresponding RuntimeClass defined Overhead","reason":"Forbidden","details":{"name":"build-090844c190db1409-1","kind":"pods"},"code":403}

	at io.seqera.wave.service.builder.KubeBuildStrategy.build(KubeBuildStrategy.groovy:114)
	at io.seqera.wave.service.builder.ContainerBuildServiceImpl.launch(ContainerBuildServiceImpl.groovy:203)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1268)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
	at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:1036)
	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:1019)
	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethodSafe(InvokerHelper.java:97)
	at io.seqera.wave.service.builder.ContainerBuildServiceImpl$_launchAsync_lambda2.doCall(ContainerBuildServiceImpl.groovy:249)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at io.micronaut.scheduling.instrument.InvocationInstrumenterWrappedRunnable.run(InvocationInstrumenterWrappedRunnable.java:47)
	at io.micrometer.core.instrument.composite.CompositeTimer.record(CompositeTimer.java:141)
	at io.micrometer.core.instrument.Timer.lambda$wrap$0(Timer.java:196)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: io.kubernetes.client.openapi.ApiException: Message: 
HTTP response code: 403
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods \"build-090844c190db1409-1\" is forbidden: pod rejected: Pod Overhead set without corresponding RuntimeClass defined Overhead","reason":"Forbidden","details":{"name":"build-090844c190db1409-1","kind":"pods"},"code":403}

HTTP response headers: {audit-id=[1b220415-0563-49cf-acab-21433e63b505], cache-control=[no-cache, private], content-length=[304], content-type=[application/json], date=[Fri, 12 Jul 2024 16:35:00 GMT], x-kubernetes-pf-flowschema-uid=[2e5d4335-8d18-47e8-8ccc-d5cff84dadc7], x-kubernetes-pf-prioritylevel-uid=[5f6328bd-868a-4cbb-85be-c907b3ddac78]}
	at io.kubernetes.client.openapi.ApiClient.handleResponse(ApiClient.java:1116)
	at io.kubernetes.client.openapi.ApiClient.execute(ApiClient.java:1029)
	at io.kubernetes.client.openapi.apis.CoreV1Api.createNamespacedPodWithHttpInfo(CoreV1Api.java:10876)
	at io.kubernetes.client.openapi.apis.CoreV1Api$APIcreateNamespacedPodRequest.execute(CoreV1Api.java:10972)
	at io.seqera.wave.service.k8s.K8sServiceImpl.buildContainer(K8sServiceImpl.groovy:340)
	at io.seqera.wave.service.builder.KubeBuildStrategy.build(KubeBuildStrategy.groovy:102)
	... 18 common frames omitted

munishchouhan avatar Jul 12 '24 16:07 munishchouhan

found the solution here https://github.com/quarkusio/quarkus/issues/39934#issuecomment-2099132431

munishchouhan avatar Jul 19 '24 16:07 munishchouhan

A new issue emerges with this upgrade is how to find pods associated with jobs, because new functions doesnot have filed to mentioned the jobname when fetching pods

munishchouhan avatar Aug 29 '24 09:08 munishchouhan

@munishchouhan Maybe it's time to move forward this

pditommaso avatar Nov 11 '24 07:11 pditommaso

@munishchouhan Maybe it's time to move forward this

sure I will start working on it

munishchouhan avatar Nov 18 '24 08:11 munishchouhan

Tested locally:

  1. Build and scan:
(base) munish.chouhan@Munishs-MacBook-Pro ~ % kubectl get jobs -n wave-local
NAME                    STATUS    COMPLETIONS   DURATION   AGE
bd-322727e313d784e8-1   Running   0/1           41s        41s
(base) munish.chouhan@Munishs-MacBook-Pro ~ % kubectl get pods -n wave-local
NAME                          READY   STATUS    RESTARTS   AGE
bd-322727e313d784e8-1-m44b7   1/1     Running   0          46s
(base) munish.chouhan@Munishs-MacBook-Pro ~ % kubectl get pods -n wave-local
NAME                          READY   STATUS      RESTARTS   AGE
bd-322727e313d784e8-1-m44b7   0/1     Completed   0          83s
sc-542be9ed6f8ed250-1-zkrdc   1/1     Running     0          15s
(base) munish.chouhan@Munishs-MacBook-Pro ~ % kubectl get jobs -n wave-local
NAME                    STATUS    COMPLETIONS   DURATION   AGE
sc-542be9ed6f8ed250-1   Running   0/1           19s        19s

munishchouhan avatar Nov 19 '24 10:11 munishchouhan

Tested successfully yin dev:

(base) munish.chouhan@Munishs-MacBook-Pro ~ % kubectl get pods -n wave-build
NAME                          READY   STATUS      RESTARTS   AGE
bd-17b61f06aa206422-1-5x796   0/1     Completed   0          3h53m
bd-455c62e9081e85ab-2-dprkj   0/1     Completed   0          4m58s
bd-d61125149884e89d-1-7s5zn   0/1     Completed   0          4h46m
sc-688b344eb7b647b1-1-8vt57   0/1     Completed   0          2m20s
Screenshot 2024-11-19 at 12 40 51

munishchouhan avatar Nov 19 '24 11:11 munishchouhan