Relative Content

Tag Archive for javakubernetes

How to get java program exit code when using kubectl run from another machine

I have a Java program which exits with code 0 or 1 to identify whether the process is successful. I want to use kubectl run to run it in a remote kubernetes cluster. It works fine but how could I get the Java program exit code then. Because no matter how the Java program exits, the pod is always successful. I have to use interactive mode because it gives me logs when running. Is there any way that I can get the exit code? Or is there any way that a Java program to escalate its exit code to the pod system?

k8s ProcessMetrics Issue

Been getting this error from many days initialization – cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘processorMetrics’ defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/SystemMetricsAutoConfiguration.class]: Failed to instantiate [io.micrometer.core.instrument.binder.system.ProcessorMetrics]: Factory method ‘processorMetrics’ threw exception with message: java.lang.reflect.InvocationTargetException
this only happens in k8s and not in k3s and minikube why??

Problem in using io.kubernetes library running in a docker immage inside a cluster

I’m using a local cluster that is Kind to test an application that has to run inside a Pod.The pourpose is to see if the application running inside a Pod is able to authenticate to the API server with a service account that I have already created. I created the application using Java leaveraging the kubernetes.io library as follow: