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?
Why does Java maxMemory() show more than the on certain NOT all Kubernetes pods?
Hi I have 50 or so APIs deployed using various JVM from 8 to 21. And when I call Runtime.getRuntime().maxMemory()
In some app it’s prints the correct memory and some it prints way above the actual pod limit.
kubernetes: How does “kubectl top node” calculates the usage percentage?
I’m trying to get programatically something similar to kubectl top node. I can get each node cpu/memory usage info and I also want to print the %, but I don’t know where can I find information about the total to compare against.
Example:
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??
Why should we set -XX:InitialRAMPercentage and -XX:MaxRAMPercentage to the same value for cloud environment?
I’ve read multiple articles about best practices for setting the {Min/Max/Initial}RAMPercentage
values for java applications in the cloud environment. The purpose of Min and Max RAM Percentage flags is clear for me.
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: