<p>I'm new to k8's setup, I wanted to know what is the best way to deploy the services in production. Below are a few way's I could think of, can you guide me in the right direction.</p>

<pre><code>1) Deploy each *.war file into a apache tomcat docker container, and using the service discovery mechanism of k8's.
2) Run each application normally using "java -jar *.war" into pods and expose their ports using port binding.
</code></pre>

<p>Thanks.</p>

rajesh023
<p>The canonical way to deploy applications to Kubernetes is as follows:</p>

<ol>
<li>Package each application component in a container image and upload it to a container registry (e.g. Docker Hub)</li>
<li>Create a <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.15/#deployment-v1-apps" rel="nofollow noreferrer">Deployment</a> resource for each container that runs the container as a Pod (or a set of replicas of Pods) in the cluster</li>
<li>Expose the Pod(s) in each Deployment with a <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.15/#service-v1-core" rel="nofollow noreferrer">Service</a> so that they can be accessed by other Pods or by the user</li>
</ol>
