<p>I have two services one is http(s) based while the other is cli which exists in a separate deployment (not on the same host as the first one). Lets name these services as Alice and Bob.</p>

<p>Alice is a http server while bob  is cli tool that is used to put some data into Alice on demand.</p>

<p><strong>What have I done so far ?</strong></p>

<p>Bob exists as a separate pod and since it does not have a http service to provide, I have used "sleep infinity" in its container CMD to make it run always.</p>

<p><strong>What do I expect ?</strong></p>

<p>Considering it a service that will not be in use most of the time except when someone needs to provision data in Alice. What other deployment options exist for this kind of application?</p>

<p><strong>What I don't expect ?</strong></p>

<p>For the following reason, I cannot let it reside inside the same container as Alice</p>

<ul>
<li>No http service exist for it, time constraints, lot of code refactoring required. Its my official project so can't reveal more details.</li>
</ul>

cafebabe1991
<p>You have two options in my view.
Option 1: Bob is CLI tools which does not require a endpoint, so you can deploy this as kubernetes batch job. It is super easy and you can use corn expression to schedule it.
Here is a link <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/</a></p>

<p>Alice is a service so you can execute it based on the endpoint you expose. So it can be an ingress or loadbalancer or nodeport whatever you want based on your specific need.</p>

<p>Option 2: You can use Knative architecture. You need to install knative crds based on the cloud provider. Once installed, you can simply use event driven - knative eventing to call batch. For example, you want to call Bob based on some event say Pubsub or SNS update, you can very well do it using it.
Knative service is a simple service and easy to implement. It is like kubernetes manifest file (it has only service, unlike kubernetes deployment and service). So this you can use it as an endpoint when you want to invoke Alice as service.</p>

<p>Hope this helps.</p>
