Bootstrap Java app to be able to expose remote debug portĮxample: # Set debug options if required if [ x " $ " fi Define debug port in docker container via kubernetes manifest For example, for the HawtApp Maven plugin which is a simple mvn plugin that assigns a Java Main as the executable and a simple, flexible bootstrap bin/run.sh script (or batch file for windows) that allows you to control classpath and debugging via environment variables. When you bootstrap your JVM, you should have a way to enable JVM debug. To do this, you don’t really do anything different from what you do today. This becomes really handy to see exactly what’s going on in your application. If you must log into the pod for some reason (poke around the file system, grok other config files, etc): (~ ) $ kubectl exec -it file-ingress-events-3artj bash JVM Remote debug your application Now pick the pod you want to stream the logs from and go! (~ ) $ kubectl logs -f file-ingress-events-3artj Connect via Shell if you must Regardless of which machine you’re running on (ie, where you run the kubernetes client), you can do the following: List the pods in your cluster (~ ) $ kubectl get podįile-ingress-events-3artj 1/1 Running 1 13h Tail the logs With Kubernetes, you don’t have to do any of that. On some cluster management systems, you have to basically look up the local IP of your application (if running in a container), ssh into it somehow, and then find the log and tail it. Here are a few tips: Tailing logs for your pod One thing for Java Developers that comes up is how do you view logs, do remote debug, and take stack traces. For example, you get process isolation, port-space isolation, network/storage, etc so things don’t collide on your local developer laptop. When you’re developing microservices on your local laptop, you can use something like Kubernetes to run you docker containers locally and get developer/QA/production likeness in how you deploy your applications. Custom defined metrics as the basis for autoscaling.Graceful shutdown of nodes, transitioning to other running nodes in the cluster.Cluster can now scale to 30,000 containers per cluster.Check it out if you haven’t already – here are some interesting tidbits about the 1.2 release: Kubernetes 1.2 was just released and is quickly becooming the defacto cluster management solution for containers (Docker, Rocket, Hyper, etc).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |