Answers: <p>You can create multiple instances of your application and in your application you can configure database details to use different databases.</p>
  <p>For routing part, you can setup a proxy server using Apache2/Nginx/HA Proxy.</p>
  <p>Your domain and sub-domains point to proxy server ip and Proxy server route the traffic to desired upstream application instance based on routing rules.</p>
  <p>This can be done without kubernetes and docker on any virtual machine from any cloud provider.</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-12-29T18:19:28.947Z
Answers: 2022-12-29T18:19:28.947Z
Answers: sujit patel
Answers: <ol>
  <li>Deploy your application in different namespaces.</li>
  <li>Use configmaps in each namespace to specify a DB endpoint(This way you can specify different DB endpoints for each instance of the application).</li>
  <li>It is your choice to deploy multiple ingress according to your domains, which ideally you should or to use an nginx, or any equivalent tool to forward your request to a particular application.</li>
  </ol>
  <p>I hope this helps.</p>
  
Answers: CC BY-SA 4.0
Answers: 2023-09-26T08:58:14.530Z
Answers: 2023-09-26T08:58:14.530Z
Answers: Meetu Gupta
Body: <p>I'm developing a web application in NodeJS and I want to create multiple instances of the same application to deploy it in multiple subdomains of my main domain. I want each instance to have the same application but a different database for each. But I don't know how to do it.</p>
  <p>I looked into it and it turns out that if I use Docker, Kubernetes and deploy to a cloud provider, that can solve my problem. The problem is that I know very little about Kubernetes and I have a question I can't answer!</p>
  <p>Since each subdomain must point to the IP address of an instance of my application. How can I solve this problem? Do I have to create a cluster for each subdomain or is there a way to put them all in one? What do you think about this solution?</p>
  <p>If you have a resource or another completely different solution, I'm open to anything. Thank you.</p>
  
Tags: <docker><kubernetes><azure-devops><microservices><cloud>
Title: Deploy multiple instances of the same application Kubernetes
UserDisplayName: Kardier
ThreadText: # Deploy multiple instances of the same application Kubernetes
  
  (Asked by: username_0 on 2022-12-29)
  
  I'm developing a web application in NodeJS and I want to create multiple instances of the same application to deploy it in multiple subdomains of my main domain. I want each instance to have the same application but a different database for each. But I don't know how to do it.
  
  I looked into it and it turns out that if I use Docker, Kubernetes and deploy to a cloud provider, that can solve my problem. The problem is that I know very little about Kubernetes and I have a question I can't answer!
  
  Since each subdomain must point to the IP address of an instance of my application. How can I solve this problem? Do I have to create a cluster for each subdomain or is there a way to put them all in one? What do you think about this solution?
  
  If you have a resource or another completely different solution, I'm open to anything. Thank you.
  
  **Tags:** docker, kubernetes, azure-devops, microservices, cloud
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-12-29. Score: 0
  
  You can create multiple instances of your application and in your application you can configure database details to use different databases.
  
  For routing part, you can setup a proxy server using Apache2/Nginx/HA Proxy.
  
  Your domain and sub-domains point to proxy server ip and Proxy server route the traffic to desired upstream application instance based on routing rules.
  
  This can be done without kubernetes and docker on any virtual machine from any cloud provider.
  
  
  ---
  
  ### Answer by username_2 on 2023-09-26. Score: 0
  
  1. Deploy your application in different namespaces.
  2. Use configmaps in each namespace to specify a DB endpoint(This way you can specify different DB endpoints for each instance of the application).
  3. It is your choice to deploy multiple ingress according to your domains, which ideally you should or to use an nginx, or any equivalent tool to forward your request to a particular application.
  
  I hope this helps.
  
  
  ---
  
  