I have a REST web service in Java that needs to call a Perl script. The Perl script takes a text file and returns output on stdout. I have a Dockerfile for this Perl script. I also have Dockerfile for the Java application. Ideally I would be able to scale the web service and the script independently based on load. What is a best practice solution for this? Do I:
The pod is the minimum deployable unit in Kubernetes, which is an scheduler of resources. That being said, if you need to scale those applications independently, you need to use two pods. Otherwise, they will belong to the same Pod, which is the thing that you scale up/down in kubernetes (normally, you use a Deployment
object to do that).
Ideally, the Java application would connect to the perl application through the network using a Service
object, which lets you expose a Pod to the rest of the cluster using a specific name.