Answers: <p>You should have 3 names when you're willing to do a blue/green deployment.</p>
  
  <p>Two set of names, one for blue, one for green, which will works as is, and a production entrypoint which will point to either the blue name or green name.</p>
  
  <p>The point of a blue/green deployment is to be able to test the full deploy before switching the clients entry point, so your services calls themselves don't have to use the entry point name itself.</p>
  
Answers: CC BY-SA 4.0
Answers: 2018-09-17T08:50:36.627Z
Answers: But how to make the micro services point to each other in the same Cluster?
  I cannot tell the micro services that they are on the blue/green by modifying their URL (service1.blue.company.com/service1.green.company.com)
Answers: Kaymaz
Answers: CC BY-SA 4.0
Answers: 2018-09-17T08:51:22.667Z
Answers: Why can't you use blue/green names on each cluster ?
Answers: Tensibai
Answers: CC BY-SA 4.0
Answers: 2018-09-17T08:52:21.647Z
Answers: So it means the micro services must know in which "env" they are. That doesn't seem right to me. I must be missing something
Answers: Kaymaz
Answers: CC BY-SA 4.0
Answers: 2018-09-17T08:53:28.763Z
Answers: That's just a variable you give to your services, as well as any credential, db location, whatever which is cluster dependent.
Answers: Tensibai
Answers: CC BY-SA 4.0
Answers: 2018-09-17T08:55:03.337Z
Answers: Ok so I would have blue.company.com, green.company.com and a third one?
Answers: Kaymaz
Answers: CC BY-SA 4.0
Answers: 2018-09-17T08:56:35.550Z
Answers: Yes, your services should be able to take at least a dns suffix from an environment variable to build their own and others services urls.
Answers: Tensibai
Answers: CC BY-SA 4.0
Answers: 2024-05-27T21:09:43.630Z
Answers: Do you perhaps know how to answer this question as well? Here:  https://devops.stackexchange.com/questions/19340/green-blue-deployments-with-multiple-development-teams
Answers: CodeMonkey
Answers: CC BY-SA 4.0
Answers: 2018-09-17T08:42:52.423Z
Answers: 2018-09-17T08:42:52.423Z
Answers: Tensibai
Body: <p>Currently, we have on our test environment an <em>ECS Cluster</em> with micro services deployed. All micro services are talking to each other through <em>Route53</em> DNS CNAMEs like service1.company.com, service2.company.com, etc.</p>
  
  <p>Here is a simplified schema of the infra:
  <a href="https://i.sstatic.net/zGnj6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zGnj6.png" alt="ECS Cluster for micro services"></a></p>
  
  <p>The <em>ALB</em> listens on port 80 and everything works fine.</p>
  
  <p>Now comes the troubles: I'm trying to build a blue/green deployment infra.</p>
  
  <p>I basically know how to do it (<em>HAProxies</em>, 2x <em>ALBs</em>, 2x <em>ECS Clusters</em>). What I want to acheive can be seen <a href="https://www.youtube.com/watch?v=KJOORneBTHI" rel="nofollow noreferrer">https://www.youtube.com/watch?v=KJOORneBTHI</a></p>
  
  <p>I'm stuck with the fact that we are using CNAMEs for our micro services communications.</p>
  
  <ul>
  <li>So on the <strong>blue</strong> part:</li>
  </ul>
  
  <p>CNAME service1.company.com -> ALBBlue</p>
  
  <ul>
  <li>On the <strong>green</strong> part:</li>
  </ul>
  
  <p>CNAME service1.company.com -> ALBGreen</p>
  
  <p>But that's something I cannot do of course.</p>
  
  <p>How can I do?</p>
  
Tags: <amazon-web-services><microservices><amazon-ecs><dns><bluegreen>
Title: Blue/green deployment with micro services and DNS
UserDisplayName: Kaymaz
ThreadText: # Blue/green deployment with micro services and DNS
  
  (Asked by: username_0 on 2018-09-17)
  
  Currently, we have on our test environment an *ECS Cluster* with micro services deployed. All micro services are talking to each other through *Route53* DNS CNAMEs like service1.company.com, service2.company.com, etc.
  
  Here is a simplified schema of the infra:
  [![ECS Cluster for micro services](https://i.sstatic.net/zGnj6.png)](https://i.sstatic.net/zGnj6.png)
  
  The *ALB* listens on port 80 and everything works fine.
  
  Now comes the troubles: I'm trying to build a blue/green deployment infra.
  
  I basically know how to do it (*HAProxies*, 2x *ALBs*, 2x *ECS Clusters*). What I want to acheive can be seen <https://www.youtube.com/watch?v=KJOORneBTHI>
  
  I'm stuck with the fact that we are using CNAMEs for our micro services communications.
  
  * So on the **blue** part:
  
  CNAME service1.company.com -> ALBBlue
  
  * On the **green** part:
  
  CNAME service1.company.com -> ALBGreen
  
  But that's something I cannot do of course.
  
  How can I do?
  
  **Tags:** amazon-web-services, microservices, amazon-ecs, dns, bluegreen
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-09-17. Score: 5 | Accepted answer
  
  You should have 3 names when you're willing to do a blue/green deployment.
  
  Two set of names, one for blue, one for green, which will works as is, and a production entrypoint which will point to either the blue name or green name.
  
  The point of a blue/green deployment is to be able to test the full deploy before switching the clients entry point, so your services calls themselves don't have to use the entry point name itself.
  
  > **Comments:**
  > **username_0**: But how to make the micro services point to each other in the same Cluster? I cannot tell the micro services that they are on the blue/green by modifying their URL (service1.blue.company.com/service1.green.company.com)  
  > **username_1**: Why can't you use blue/green names on each cluster ?  
  > **username_0**: So it means the micro services must know in which "env" they are. That doesn't seem right to me. I must be missing something  
  > **username_1**: That's just a variable you give to your services, as well as any credential, db location, whatever which is cluster dependent.  
  > **username_0**: Ok so I would have blue.company.com, green.company.com and a third one?  
  > **username_1**: Yes, your services should be able to take at least a dns suffix from an environment variable to build their own and others services urls.  
  > **username_2**: Do you perhaps know how to answer this question as well? Here:  https://devops.stackexchange.com/questions/19340/green-blue-deployments-with-multiple-development-teams  
  
  ---
  
  