<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[CloudWithMORE - Medium]]></title>
        <description><![CDATA[Get MORE with your Cloud - Medium]]></description>
        <link>https://medium.com/cloudwithmore?source=rss----c10da74a56d0---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>CloudWithMORE - Medium</title>
            <link>https://medium.com/cloudwithmore?source=rss----c10da74a56d0---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 18:29:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/cloudwithmore" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Mayday !!! Mayday !!! Mayday !!!]]></title>
            <link>https://medium.com/cloudwithmore/mayday-mayday-mayday-95fb5d2e46e0?source=rss----c10da74a56d0---4</link>
            <guid isPermaLink="false">https://medium.com/p/95fb5d2e46e0</guid>
            <category><![CDATA[cloud-monitoring]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[stackdriver]]></category>
            <category><![CDATA[cloud-operations]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Yogesh Golande]]></dc:creator>
            <pubDate>Mon, 28 Dec 2020 09:54:17 GMT</pubDate>
            <atom:updated>2020-12-28T09:54:17.013Z</atom:updated>
            <content:encoded><![CDATA[<h3>Mayday !!! Mayday !!! Mayday !!!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*vOT8L55sQiricIng0-fzfg.jpeg" /></figure><p><strong>Monitoring Alerts in GCP by integrating Cloud Operations with Notification Channels</strong></p><p>An integral part of ensuring applications run smoothly on the cloud is to ensure the infrastructure runs smoothly, and one way of doing this is to anticipate problems and handle them before they escalate into a system downtime. A simple and effective way of doing this is to set up effective monitoring systems. Systems that monitor the health of the infrastructure on important low-level metrics such as CPU usage, disk usage, memory usage, etc. These metrics going out of bounds can alert us to potential problems and preventive actions can be taken.</p><p>How can these monitoring systems alert us?</p><p>In this blog, we take a look at Google Cloud’s Cloud Operations (formerly StackDriver) and the options available to get monitoring alerts.</p><p>Cloud operations Monitoring measures the health of cloud resources and applications by providing visibility into metrics such as CPU usage, disk I/O, memory, network traffic, and uptime. These measurements, which are known as metrics, are made repeatedly over time and constitute a time series of measurements. After we put systems in place to collect this data, the next step is to determine what values are safe, what values indicate a “warning” and what values are a “danger” sign. This is a matter of tuning and review. The next step is determining how the SRE team gets notifications whenever any of the metrics are in a warning or danger state.</p><p>There are various channels available for these notifications — some out of the box, some that can be integrated into applications and dashboards. We take a look at some of these and explain how to set them up. It is a matter of company policy to decide which notification channels are to be used and different channels can be used for different types of notifications — based on components, severity, etc.</p><p>Some Notification channel’s integration lets us create automated and programmatic workflows in response to alerts. For example, Pub/Sub is a publish/subscribe queue that lets us build loosely coupled applications. Using Pub/Sub as our notification channel makes it easy to integrate with third-party providers for alerting and incident response workflows, we can use the Pub/Sub as a notification channel through the API and the Google Cloud Console.</p><p><strong>Different types of Notification Alerts and Creating Channels</strong></p><p>There are multiple types of notification alerts provided by Google Cloud such as:</p><p>1. Email</p><p>2. MobileApp</p><p>3. PagerDuty</p><p>4. SMS</p><p>5. Slack</p><p>6. Webhook</p><p>7. Pub/Sub</p><p>In this blog, we will focus on Slack, Webhook, and Pub/Sub. Slack is a popular tool for internal and external communication used by a lot of organizations. Webhooks allow custom handling of notification and can be integrated with existing applications and dashboards. Pub/Sub also allows for custom handling where one notification can be handled in different ways.</p><p>Let us dive in and start setting up the notification channel.</p><p>To configure a notification channel, you must have one of the following Identity and Access Management roles on the Workspace’s host project:</p><p>-Monitoring NotificationChannel Editor</p><p>-Monitoring Editor</p><p>-Monitoring Admin</p><p>-Project Editor</p><p>-Project Owner</p><p>When you are creating an alerting policy, you have the option to select any configured notification channel and add it to your policy. You can pre-configure your notification channels, or you can configure them as part of the process of creating an alerting policy. To create a notification channel we need to follow the below steps:</p><p>1. In the Cloud Console, we need to select Monitoring or search monitoring on the search window.</p><p>2. This will take you to the Monitoring section.</p><p>3. By using the Monitoring navigation pane, we need to verify that the correct Workspace is selected.</p><p>4. In the Monitoring navigation pane, click the notifications “Alerting”.</p><p>5. Under the Alerting section click Edit notification channels on the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m2wsi8iiCtnrKvDi" /></figure><p>6. To add a new notification channel, locate the channel type such as “SMS” or “SLACK” or “PUB/SUB” and click Add new, and then follow the channel-specific instructions as per the below instruction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3Gdcdv5JwMqr8wQl" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dqU3LkNIAQ-GTKl0" /></figure><h4><strong>I. Notification via Slack</strong></h4><p>Monitoring Slack integration allows your alerting policies to post to a Slack channel when a new incident is created. The slack free version provides features of 10 apps or service integrations.</p><p>To set up Slack notifications, do the following:</p><p>1. In Slack, create a Slack channel at the Slack site and record the channel URL.</p><p>2. In the Cloud Console, select Monitoring and Go to Monitoring</p><p>3. Select Alerting and then select Edit notification channels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_mFHDVtIjdW_oaqc" /></figure><p>4. In the Slack section, click Add new which brings you to the Slack sign-in page.</p><p>5. Enter your Slack workspace URL.</p><p>6. Select and click Allow to enable Google Cloud Monitoring access to your Slack workspace</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/0*GoZC88DEyl67L_aG" /></figure><p>7. When you create an alerting policy, select Slack in the Notifications section and choose your Slack configuration.</p><p><strong>II. Notification via Webhook:</strong></p><p>Webhooks are aimed at explicit invocation where the publisher (client) retains full control of the webhook’s execution. This means that the execution timing and the processing of the alert message are the server’s responsibility. Moreover, although a webhook does retry deliveries a few times upon failure if the target endpoint is unavailable for too long, notifications are dropped entirely. A few use cases/examples for webhook would be:</p><p>1. Upon completion of an audit the webhook triggers a script to pull the page details report and send an email to the addresses in the notifications field of the recently completed auditing.</p><p>2. Upon completion of an audit the webhook triggers a script to pull a report from the recently completed audit and display it in a dashboard.</p><p>3. Integrate the Slack messaging app with your webhooks. Upon completion of the audit, your script is triggered to pull data such as rule failures or console errors. A webhook is also available on Slack and that is triggered as soon as the data is pulled and a message is sent to the relevant Slack channel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*GzaS55ahSMVpn0oI" /></figure><p>To configure Webhooks notifications, do the following:</p><p>1. The webhook handler: Identify an endpoint URL that will receive webhook data from Monitoring.</p><p>2. In the Webhooks section, click Add new and follow the instructions and click Save.</p><p>3. When you create an alerting policy, select Webhook in the Notifications section and choose your webhook configuration.</p><p><strong>Basic authentication</strong></p><p>In addition to the webhook request sent by Cloud Monitoring, basic authentication utilizes the HTTP specification for the username and password. Cloud Monitoring requires your server to return a 401 response with the proper WWW-Authenticate header.</p><p><strong>III. Notification via Pub/Sub:</strong></p><p>Pub/Sub is a publish/subscribe queue that lets us build loosely coupled applications. Using Pub/Sub as our notification channel makes it easy to integrate with third-party providers for alerting and incident response workflows, we can use the Pub/Sub as a notification channel through the API and the Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/0*yzkJQUP9eNind-zI" /></figure><p><strong>When to use Pub/Sub Notifications</strong> — Pub/Sub supports both explicit (push) and implicit (pull) invocation. In pull mode, the subscriber has control over when to pull the message from the queue and how to process an alert message. Pub/Sub provides a durable queue in which messages wait as long as necessary until the subscriber pulls the message.</p><p>Pub/Sub is an access-controlled queue, with access managed by Cloud Identity and Access Management, meaning that the subscriber needs to be able to authenticate using a user or service account. Messages delivered to Pub/Sub never leave the Google network.</p><p>An example of where to use Pub/Sub is if an alert message needs to be transformed before it is sent to be processed. Consider this scenario where an uptime check that you configured to check the health of your load balancers is failing. As a result, an alert is fired and a message is published to your Pub/Sub channel. A Cloud Function is triggered as soon as a new message hits the Pub/Sub topic. The function reads the message and identifies the failing load balancer. The function then sends a command to change the DNS record to point to a failover load balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*eGmBYd3f4yEbgW3H" /></figure><p>Integration with Pub/Sub can be possible through GUI and Code. Here we show the configuration through a coded way to be familiar with commands.</p><p>To send notifications to a Pub/Sub topic, do the following:</p><p>1. Click the following button to enable the Pub/Sub API for your project:</p><p>-Enable Pub/Sub API</p><p>-Ensure that the correct Google Cloud project is selected.</p><p>-If an Enable button is displayed, then click that button.</p><p>-If API Enabled is displayed, then the API is already enabled.</p><p>2. Create a Pub/Sub topic, as described in creating a topic, if you don’t already have one. The topic must exist before you can use it as a notification channel. The following command creates a topic called <strong>notificationTopic</strong>.</p><p>gcloud pubsub topics create notificationTopic</p><p>3. Create a notification channel that uses the topic. You can use the Monitoring API, the gcloud command-line tool, or the Cloud Console.</p><p>To use the Cloud Console to create the notification channel, go to the Edit notification channels window and then do the following:</p><p>i. In the Cloud Pub/Sub section, click Add new.</p><p>ii. Enter a display name for your channel, enter the Pub/Sub topic name, and then click Add channel.</p><p>To use the Monitoring API or the gcloud command-line tool to create the notification channel, see creating channels for information and examples.</p><p>4. Authorize the notifications service account to publish to each Pub/Sub topic that you are using as a notification channel.</p><p>When you create the first Pub/Sub channel, Cloud Monitoring creates a service account for the Monitoring Notification Service Agent, for the project in which the channel was created. This service account manages the sending of notifications to Pub/Sub-based notification channels in this project.</p><p>This service account has an ID with the following structure:</p><p>service-[PROJECT_NUMBER]@gcp-sa-monitoring-notification.iam.gserviceaccount.com</p><p>You can see this account on the IAM page, not the Service accounts page, of the Cloud Console.</p><p>To authorize this account to publish to a topic, you must give the service account the pubsub.publisher IAM role for the topic. The following command does this for the notificationTopic topic:</p><p>gcloud pubsub topics add-iam-policy-binding \</p><p>projects/[PROJECT_NUMBER]/topics/notificationTopic — role=roles/pubsub.publisher \</p><p>— member=serviceAccount:service-[PROJECT_NUMBER]@gcp-sa-monitoring-notification.iam.gserviceaccount.com</p><p>-If the command succeeds, it returns output like the following:</p><p>Updated IAM policy for topic [notificationTopic].</p><p>bindings:</p><p>‐ members:</p><p>‐ serviceAccount:service-[PROJECT_NUMBER]@gcp-sa-monitoring-notification.iam.gserviceaccount.com</p><p>role: roles/pubsub.publisher</p><p>etag: BwWcDOIw1Pc=</p><p>version: 1</p><p>Note that the project number is not the same as the project ID. Project IDs are typically strings that reflect the project name, like my-test-project. Project numbers are unique numerical identifiers. You can find the project name, ID, and number on the project’s landing page in the Cloud Console or you can retrieve it with the following command:</p><p>gcloud projects describe [PROJECT_ID] — format=”value(project_number)”</p><p>5. Add the Pub/Sub channel to an alerting policy by selecting Pub/Sub as the channel type and a named topic as the notification channel.</p><p><strong>Editing or deleting the channel: </strong>To edit or delete a notification channel by using the Cloud Console, select Monitoring and go to the “Alerting” section of the Monitoring navigation pane. Edit the notification channel and delete the notification you no longer need for you to notify.</p><p><strong>Sample Alert Notification:</strong></p><p>Once the integration is completed, a notification will be sent to the mentioned channel, below is an example of slack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B_RuJJM585Rk1ez4" /></figure><p>Alert notifications give timely awareness of problems in your cloud applications so you can resolve the problems quickly. In the landscape of managing infrastructure, this is a small but important part and hopefully will help speed up your journey to effective and efficient infrastructure management.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95fb5d2e46e0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudwithmore/mayday-mayday-mayday-95fb5d2e46e0">Mayday !!! Mayday !!! Mayday !!!</a> was originally published in <a href="https://medium.com/cloudwithmore">CloudWithMORE</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is Kubernetes The Right Fit?]]></title>
            <link>https://medium.com/cloudwithmore/is-kubernetes-the-right-fit-9bbde9d75a87?source=rss----c10da74a56d0---4</link>
            <guid isPermaLink="false">https://medium.com/p/9bbde9d75a87</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[google-kubernetes-engine]]></category>
            <dc:creator><![CDATA[Yogesh Golande]]></dc:creator>
            <pubDate>Mon, 07 Dec 2020 10:28:57 GMT</pubDate>
            <atom:updated>2020-12-07T10:28:57.809Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*7urqx9SW-UvB9ueRHA25FQ.jpeg" /></figure><p>Nowadays every IT organization widely uses the concept of Containers to deploy the applications. Containers have changed the entire virtualization theory by allowing you to run multiple isolated applications on a single hardware, or you can say on the same machine, which in turn helps you use your hardware resources wisely.</p><p>When Docker was first introduced in the year 2013 then it brought the revolution in the field of using microservices, because it allows us to use the server’s base Operating System to control all the running applications inside the containers and hence make all the containers light-weighted. So when people started using containers in production environments to deploy their applications the result was very good, but providing zero downtime when a container goes down was still a headache, as we need to manually spin up a new container to handle this. In such critical situations you can’t afford a long downtime because it will cost you a good loss in your business and hence people started thinking about solutions like having a managed containerized platform that can take care of scaling, failover as well as down-scaling when required. And in 2014, Google Engineers came up with the solution that is, <strong>Kubernetes (K8s)</strong>.</p><p>Kubernetes is an open-source platform that helps in everything, starting from deploying the application, managing the application, as well as scaling-in and scaling-out your application. In simple words, K8s helps in controlling the containerized clusters used for application deployment.</p><p>In recent times I guess there are very few technologies that have gained so much success as Kubernetes have, and at the same time is popular among all the IT geeks. But it doesn’t mean that learning K8s is like a piece of cake. There are so many things that you need to be aware of before getting your hands dirty with K8s.</p><h3><strong>Real-time Benefits of Kubernetes</strong></h3><p>Let’s see some of the real-time benefits you will get from K8s:</p><ul><li>High availability of your applications. You will not even notice a small fluctuation in your containerized infrastructure if some of the nodes go offline.</li><li>Consider if your website/application receives high traffic, then the auto-scaling feature of K8s will spin up more nodes or containers to match the traffic.</li><li>Using the concept of ‘namespaces’ you can deploy and also separate the services with different teams and their test/dev/prod environments.</li><li>K8s have the ability to self-heal the cluster. This means if a container stops, then K8s will try to restart it, kill it if the container doesn’t respond, plus doesn’t expose your application to any user request unless and until the container is up &amp; running to take the incoming requests.</li></ul><p>I have often seen people get confused between Google Compute Engine (GCE) Managed Instances &amp; Google Kubernetes Engine (GKE) and consider them the same. But in reality, it’s not. In the coming section, I will brief you about both and also put some use cases to understand them completely.</p><h3>Google Compute Engine MIGs Vs Google Kubernetes Engine</h3><h4>GCE MIGs</h4><p>Google Compute Engine is a service in the Google Cloud Platform that allows you to create any number of virtual machines with the option of choosing the hardware resources (CPU, RAM, Hard Disk, etc) as per your need. You can simply consider it as an Infrastructure-as-a-Service (IaaS) provided by Google.</p><p>Using GCE, you can create 3 types of instance groups; one is Managed stateless Instance Group (MIGs), the second is Managed stateful Instance Group and the other is Un-managed Instance Groups. The key difference among both of these is MIGs provide features like autoscaling, auto-healing, multiple zone deployments, etc since all instances in the managed instance groups run the same image. Whereas Un-managed Instance Groups only helps you in load-balance the requests across multiple VM’s, since the instances in an un-managed instance group could have different images. For this blog’s sake, we will focus only on MIG’s.</p><p><strong>When to choose MIGs?</strong></p><p>Following are some of the topmost use cases of using MIGs,</p><ul><li>If your website or application is frequently receiving high traffic then you don’t have to worry about that, as MIGs have the ability to auto-scale your infrastructure when a certain metric condition is met. Like for example, in the below screenshot you can see when the CPU usage goes above 60% then MIG’s will auto-scale as per the configuration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/0*vuvwtsarhsUgYL1j" /><figcaption><strong>Screenshot A</strong></figcaption></figure><ul><li>MIGs can be best suited for applications where containerization and subsequent running-in GKE is not an option, however, auto-scaling is desirable. This could happen if the application is a legacy application and the time needed to modernize it is not available. In the case of legacy applications, based on whether the application is stateful or stateless, various deployment options are available.</li><li>Compared with security, GKE security namespaces does not provide more isolated security features like GCE instances because GKE uses the same kernel and that’s the reason root has access to any namespace.</li></ul><h3>Google Kubernetes Engine (GKE)</h3><p>Google Kubernetes Engine is a managed Kubernetes service where you Kubernetes components are provided out of the box. GKE also provides services such as centralized logging and monitoring with Google Cloud’s Operations suite, automatic upgrade of cluster nodes software, node pools for additional flexibility</p><p>GKE provides a horizontal and vertical scaling that dynamically adds and removes nodes to</p><p>A pool which it calls the cluster auto-scaler. The cluster auto-scaler is going to add or remove nodes as needed based on the resource requests that we have for our pods.</p><p>The screenshot below gives us some parameters that are used to configure the auto-scaling of a cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CPXp5_PObdAO4fHg" /><figcaption><strong>Screenshot B</strong></figcaption></figure><h3>When to use GKE?</h3><p>Below are some of the reasons to go with GKE,</p><ul><li>GKE is the go-to option for a microservices-based application since it gives fine-grained control over scaling. The most frequently used services can scale faster and be given more resources than services that are not as popular.</li><li>A complex application with numerous smaller parts that need to communicate with each other, that need to scale differently. GKE is best suited as GKE Pods contain one or more containers When a Pod runs multiple containers, the containers are managed as a single entity and share the Pod’s resources. Pods also contain shared networking and storage resources for their containers.</li></ul><h3>Cost Comparison Between GCE and GKE</h3><h4><strong>GCE Pricing</strong></h4><p>Calculating or getting an estimated cost of running VMs on a Google Compute Engine depends upon many aspects. Like,</p><ul><li>The machine type that includes some CPU and size of memory you required to create your VM’s</li><li>Price also varies if you are using sole tenant nodes instead of Multi-tenant hosts.</li><li>Premium OS images will also incur some additional costs.</li><li>The size and type of disks attached to VMs will also add to your cost.</li><li>If you are using Custom Images to create your VMs then it will incur a storage cost to you.</li></ul><p>So, depending upon all the above, the cost of GCE will vary.</p><h4>GKE Pricing</h4><p>Cost for GKE also depends upon many aspects like,</p><ul><li>A cluster consists of worker nodes, which are priced at regular machine instance prices. The machine type includes the number of CPUs and the size of the memory.</li><li>The number of clusters you are using for your deployments. Google charges $0.10 per cluster/hour and makes it as a cluster management fee, which means they will give you almost 100 % assurance for the availability of your clusters.</li><li>Also Few other things like networking and resource location.</li></ul><p>You can also calculate your cost estimation for GCE &amp; GKE from<a href="https://cloud.google.com/products/calculator"> <strong>here</strong></a>.</p><p>Given that there is a cost overhead with GKE, should GKE be a choice for choosing a scalable platform?</p><p>As mentioned above, GKE allows for fine-grained control over scaling pods. If nodes are under-utilized, and all Pods could be scheduled even with fewer nodes in the node pool, Cluster auto-scaler removes nodes, down to the minimum size of the node pool. This brings in far more efficient use of resources and thus in the long run makes GKE cost-effective.</p><h3>Performance Comparison</h3><p>When it comes to performance, then definitely Google Kubernetes Engine (GKE) is far better than the Google Compute Engine (GCE) to deploy the applications.</p><ul><li>GCE VM security and updates are up to you. On the other hand, if there are any updates or patches for GKE it will automatically get pushed to the cluster.</li><li>GKE comes with more automation and management baked in.</li><li>Running each microservice on a separate virtual machine (VM) on Compute Engine could make the operating system overhead a significant part of your cost.</li><li>Google Kubernetes Engine lets you deploy multiple containers and groups of containers for each VM instance, which can allocate host VM resources more efficiently to microservices with a smaller footprint.</li><li>GKE Sandbox provides a second layer of defense between containerized workloads on GKE for enhanced workload security. GKE clusters natively support Kubernetes Network Policy to restrict traffic with pod-level firewall rules.</li><li>Scaling / down-scaling of application containers works faster automatically handled by Kubernetes Engine. This feature is not there in GCE.</li><li>GKE provides managed DNS for resolving service names and for resolving external names.</li></ul><h3>Deploying New Features</h3><p>New feature deployment is one of the plus points of GKE, as this feature is missed in GCE. Because GKE has the ability to roll-out the new changes with zero downtime and hence it gives IT geeks the freedom to add the new features/functionalities to their application/website on the go.</p><p>GKE will allow you to roll out new updates without impacting the running deployment. It will first spin a container of new deployment (rollout update) and if all goes well then it will spin up more containers and gradually destroy the containers of the previous deployment. Similarly, after the rollout of a new deployment if you see bugs in your website/app, then GKE also has the ability to roll back to the previous release of deployment in the blink of your eye.</p><h3>Applications Suitable for K8s Deployment</h3><p>Below are some of the suggestions where we can take the benefit from K8s,</p><ul><li>K8s is mostly useful for microservices applications where the application is built as a suite of modular services. Each module supports a specific business goal and uses a simple, well-defined interface to communicate with other sets of services.</li><li>The applications such as E-commerce apps and websites consist of several modules. Define each module as a separate loosely coupled service depending on the requirement, which may collaborate based on the scenario.</li><li>Applications that provide Online streaming, Online Gaming platforms can also make use of K8s.</li></ul><p>The above three points are showing where K8s is best suited. But I will also share a few points where K8s could be overkill.</p><ul><li>K8s is expensive for small applications to host. To take the advantage of GKE resiliency you need additional nodes above the minimum amount required to run your application. If a node is down, the requested pods will be relocated to the available nodes. For production workloads, at least three nodes are recommended for resiliency.</li><li>K8s is complex to start with, so if you are planning to move your applications on a containerized platform then make sure to hire the right resource to work with K8s, as migrating from a traditional setup to K8s is very challenging.</li></ul><h3>Endnotes</h3><p>Containerized applications are one of the hottest topics in the current market, so is the Kubernetes and its managing platforms like Google Kubernetes Service (GKE), AWS Elastic Kubernetes Service (EKS), Azure Kubernetes Service (AKS).</p><p>It’s easy to start with K8s, but having the ability to provide real-world solutions becomes a bit tricky. Building a strategy to use the K8s and any of its managing platforms as per your needs requires extensive knowledge of K8s, which you will only get by deep diving.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bbde9d75a87" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudwithmore/is-kubernetes-the-right-fit-9bbde9d75a87">Is Kubernetes The Right Fit?</a> was originally published in <a href="https://medium.com/cloudwithmore">CloudWithMORE</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How do you implement Blue/Green deployment in AWS (Part 7/7)]]></title>
            <link>https://medium.com/cloudwithmore/how-do-you-implement-blue-green-deployment-in-aws-part-7-7-9143b3c945c1?source=rss----c10da74a56d0---4</link>
            <guid isPermaLink="false">https://medium.com/p/9143b3c945c1</guid>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[codedeploy]]></category>
            <dc:creator><![CDATA[Leon Jalfon]]></dc:creator>
            <pubDate>Tue, 20 Oct 2020 09:44:48 GMT</pubDate>
            <atom:updated>2020-10-20T09:44:48.179Z</atom:updated>
            <content:encoded><![CDATA[<p>In this 7-parts tutorial, we will create an initial environment composed of an autoscaling group with two ubuntu machines behind a load balancer, then we will create a CI/CD pipeline to provide blue/green deployments using CodeBuild, CodeDeploy, and CodePipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6X5M-VHXjmy3-RD2uU9aEA.jpeg" /></figure><h3>Step 7: Putting all together</h3><p>Finally, let’s make a change in the code and see how all the process works</p><h3>Trigger the Pipeline</h3><p>Update the index.html to change the background color from “#0188cc” to “#de660b”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kmG9zJyqAoNLhWXF.png" /></figure><p>A new pipeline will be triggered automatically</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cBmOXk6F0n-LvxS7.png" /></figure><p>Wait until the pipeline finish and browse to the load balancer DNS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*idae7v_wfUt2Dom5.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9143b3c945c1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudwithmore/how-do-you-implement-blue-green-deployment-in-aws-part-7-7-9143b3c945c1">How do you implement Blue/Green deployment in AWS (Part 7/7)</a> was originally published in <a href="https://medium.com/cloudwithmore">CloudWithMORE</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How do you implement Blue/Green deployment in AWS (Part 6/7)]]></title>
            <link>https://medium.com/cloudwithmore/how-do-you-implement-blue-green-deployment-in-aws-part-6-7-b037617dadbb?source=rss----c10da74a56d0---4</link>
            <guid isPermaLink="false">https://medium.com/p/b037617dadbb</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[codedeploy]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Leon Jalfon]]></dc:creator>
            <pubDate>Tue, 20 Oct 2020 09:44:36 GMT</pubDate>
            <atom:updated>2020-10-20T09:44:36.822Z</atom:updated>
            <content:encoded><![CDATA[<p>In this 7-parts tutorial, we will create an initial environment composed of an autoscaling group with two ubuntu machines behind a load balancer, then we will create a CI/CD pipeline to provide blue/green deployments using CodeBuild, CodeDeploy, and CodePipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6X5M-VHXjmy3-RD2uU9aEA.jpeg" /></figure><h3>Step 6: Configure CodePipeline</h3><p>In this section, we will put all together by creating a pipeline to automate all the process</p><h3>About CodePipeline</h3><p>AWS CodePipeline is a continuous integration and continuous delivery service for fast and reliable applications and infrastructure updates. CodePipeline builds, tests, and deploys your code every time there is a code change, based on the release process models you define. This enables you to rapidly and reliably deliver features and updates.</p><h3>Configure CodeDeploy</h3><p>Browse to “Pipelines” (under Pipeline) in the CodePipeline portal and click on “Create pipeline”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7oCiiJ3SPTbHDnV4.png" /></figure><p>Configure the pipeline settings with the details below:</p><ul><li>Pipeline name: bluegreen-pipeline</li><li>Service Role: New service role</li><li>Role name: bluegreen-codepipeline-role</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mn_IUUoHB1DAHDlF.png" /></figure><p>Under “Source” configure the pipeline to retrieve the source code from your github repository and use github webhooks</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BjigfX81s6FcghPb.png" /></figure><p>Set the build provider as CodeBuild and use the project “bluegreen-build”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8_mg1-3EvhClvt4G.png" /></figure><p>Configure the deployment to use the application “bluegreen-deploy” and the group “bluegreen-deploygroup”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rL_HSlu15uqpftRd.png" /></figure><p>Review the pipeline configuration and click on “Create pipeline”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fvSbEmgvBYR3pezL.png" /></figure><p>Finally, the pipeline will be automatically triggered</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i_Mrx3yP8hlDfTwE.png" /></figure><p>Wait until the pipeline finish and browse to the load balancer DNS (note that the build id appear in the page)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BvURSp2BBVu3B2U9.png" /></figure><p>Next: How do you implement Blue/Green deployment in AWS (Part 7/7) <strong>[Will be available soon]</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b037617dadbb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudwithmore/how-do-you-implement-blue-green-deployment-in-aws-part-6-7-b037617dadbb">How do you implement Blue/Green deployment in AWS (Part 6/7)</a> was originally published in <a href="https://medium.com/cloudwithmore">CloudWithMORE</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How do you implement Blue/Green deployment in AWS (Part 5/7)]]></title>
            <link>https://medium.com/cloudwithmore/how-do-you-implement-blue-green-deployment-in-aws-part-5-7-238c04f93a67?source=rss----c10da74a56d0---4</link>
            <guid isPermaLink="false">https://medium.com/p/238c04f93a67</guid>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[codedeploy]]></category>
            <category><![CDATA[ec2]]></category>
            <dc:creator><![CDATA[Leon Jalfon]]></dc:creator>
            <pubDate>Wed, 14 Oct 2020 10:44:11 GMT</pubDate>
            <atom:updated>2020-10-14T10:44:11.899Z</atom:updated>
            <content:encoded><![CDATA[<p>In this 7-parts tutorial, we will create an initial environment composed of an autoscaling group with two ubuntu machines behind a load balancer, then we will create a CI/CD pipeline to provide blue/green deployments using CodeBuild, CodeDeploy, and CodePipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6X5M-VHXjmy3-RD2uU9aEA.jpeg" /></figure><h3>Step 5: Configure CodeDeploy</h3><p>In this section, we will configure CodeDeploy to allow it to manage our application</p><h3>About CodeDeploy</h3><p>AWS CodeDeploy automates code deployments to any instance, including Amazon EC2 instances and on-premises servers. AWS CodeDeploy makes it easier for you to rapidly release new features, helps you avoid downtime during application deployment, and handles the complexity of updating your applications.</p><h3>Configure CodeDeploy</h3><p>Browse to “Applications” (under Deploy) in the CodeDeploy portal and click on “Create application”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yuII4NtADztQD2Hx.png" /></figure><p>Name it “bluegreen-deploy” and set it to use “EC2/On-premises”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3T4NC9YMEGnxYxID.png" /></figure><p>Click on “Create deployment group”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ka2wE5ctNDi9Z2Xm.png" /></figure><p>Set the deployment group name as “bluegreen-deploygroup”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*ZJNW1VQY7kSVTQa7sL_Txg.png" /></figure><p>Choose the IAM role “bluegreen-codedeploy-role”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*mgdnAJ9abX5DTMLZkfFKmg.png" /></figure><p>Select “Blue/Green” as deployment type</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*uqNf6lGYIjgAbyBQ.png" /></figure><p>Choose “Automatically copy Amazon EC2 Auto Scaling group” and set the auto scaling group “bluegreen-tg”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*c0v03ytvjZ6mXtSYn8y0lA.png" /></figure><p>Under deployment settings configure the below:</p><ul><li>Reroute traffic immediately</li><li>Terminate the original instances in the deployment group</li><li>Deployment configuration: CodeDeployDefault.AllAtOnce</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*PZ3HuYFN1ImApuzE.png" /></figure><p>Select “Application Load Balancer” and choose the target group “bluegreen-tg” and click on “Create deployment group”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*xFJJzlcyGZ5yyiPn.png" /></figure><p>Finally click on “Create deployment” to trigger a new deployment (manually)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gostQuiThSWDc0Bn.png" /></figure><p>Choose the deployment group, select the last github commit and trigger the deployment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X5gQLnKTrYcj2_IV.png" /></figure><p>Then you will be redirected to the deployment portal and you will be able to track the process</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y-GjtJpgD2ucF5Rn.png" /></figure><p>Wait until the deployment finish and browse to the load balancer DNS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lrAfjByhsXwjz2IS.png" /></figure><p>Next: How do you implement Blue/Green deployment in AWS (Part 6/7) <strong>[Will be available soon]</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=238c04f93a67" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudwithmore/how-do-you-implement-blue-green-deployment-in-aws-part-5-7-238c04f93a67">How do you implement Blue/Green deployment in AWS (Part 5/7)</a> was originally published in <a href="https://medium.com/cloudwithmore">CloudWithMORE</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How do you implement Blue/Green deployment in AWS (Part 4/7)]]></title>
            <link>https://medium.com/cloudwithmore/how-do-you-implement-blue-green-deployment-in-aws-part-4-7-8b38c1798208?source=rss----c10da74a56d0---4</link>
            <guid isPermaLink="false">https://medium.com/p/8b38c1798208</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[codedeploy]]></category>
            <dc:creator><![CDATA[Leon Jalfon]]></dc:creator>
            <pubDate>Mon, 12 Oct 2020 10:28:44 GMT</pubDate>
            <atom:updated>2020-10-12T10:28:44.748Z</atom:updated>
            <content:encoded><![CDATA[<p>In this 7-parts tutorial, we will create an initial environment composed of an autoscaling group with two ubuntu machines behind a load balancer, then we will create a CI/CD pipeline to provide blue/green deployments using CodeBuild, CodeDeploy, and CodePipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6X5M-VHXjmy3-RD2uU9aEA.jpeg" /></figure><h3>Part 4: Configure CodeBuild</h3><p>In this section, we will configure a CodeBuild project that will update the “index.html” to add the build Id</p><h3>About CodeBuild</h3><p>AWS CodeBuild is a fully managed build service that compiles source code, runs tests, and produces software packages that are ready to deploy. With CodeBuild, you don’t need to provision, manage, and scale your own build servers. CodeBuild scales continuously and processes multiple builds concurrently, so your builds are not left waiting in a queue.</p><h3>Configure a CodeBuild Project</h3><p>Browse to “Build projects” (under Build) in the CodeBuild portal and click on “Create build project”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0EF8-W2VgLEajEgJ.png" /></figure><p>In the “Project configuration” name the build as “bluegreen-build”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*n3v91A3_DQx07KgQ.png" /></figure><p>In the “Source” section set the following details:</p><ul><li>Source provider: GitHub</li><li>Repository: Repository in my GitHub account</li><li>Github repository: /</li><li>Source version: master</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*0D245fddTSrI5L3l.png" /></figure><p>Under “Primary source webhook events” set:</p><ul><li>Enable checkbox “Rebuild every time a code change is pushed to this repository”</li><li>Event type: PUSH</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*FSrN2OhiDOYcdj8o.png" /></figure><p>Configure the “Environment” section with the following details:</p><ul><li>Environment Image: Managed image</li><li>Operating system: Ubuntu</li><li>Runtimes: Standard</li><li>Image: aws/codebuild/standard:4.0</li><li>Image version: Always use the latest image for this runtime version</li><li>Environment type: Linux</li><li>Service role: Existing service role</li><li>Role ARN: select “bluegreen-codebuild-role”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/0*pHIdwdBhamlIAu5X.png" /></figure><p>Under “Buildspec” choose “Use a buildspec file”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/0*pw7wY9ZNETFIbRMr.png" /></figure><p>In the “Artifacts” section set the type as “No artifacts”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/0*Ae2v8r845RGD5cu7.png" /></figure><p>Under “Logs” keep enable the CloudWatch logs and set the following parameters:</p><ul><li>Group name: bluegreen</li><li>Stream name: codebuild</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*TFfH_ADqmvQEAZ0v.png" /></figure><p>Finally test the build by click on “Start build” (keep default values)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V80L36QtFJw7IJJD.png" /></figure><p>You will be redirected to the build log page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JWVdxNNdl6eWI8A-.png" /></figure><p>Next: How do you implement Blue/Green deployment in AWS (Part 5/7) <strong>[Will be available soon]</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b38c1798208" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudwithmore/how-do-you-implement-blue-green-deployment-in-aws-part-4-7-8b38c1798208">How do you implement Blue/Green deployment in AWS (Part 4/7)</a> was originally published in <a href="https://medium.com/cloudwithmore">CloudWithMORE</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blue/Green Deployment for Autoscaling Groups with CodePipeline, CodeBuild and CodeDeploy (Part 3/7)]]></title>
            <link>https://medium.com/cloudwithmore/blue-green-deployment-for-autoscaling-groups-with-codepipeline-codebuild-and-codedeploy-part-3-7-9d1d1d1824e7?source=rss----c10da74a56d0---4</link>
            <guid isPermaLink="false">https://medium.com/p/9d1d1d1824e7</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[codedeploy]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cicd]]></category>
            <dc:creator><![CDATA[Leon Jalfon]]></dc:creator>
            <pubDate>Tue, 06 Oct 2020 14:20:37 GMT</pubDate>
            <atom:updated>2020-10-06T14:20:37.715Z</atom:updated>
            <content:encoded><![CDATA[<h3>How do you implement Blue/Green deployment in AWS (Part 3/7)</h3><p>In this 7-parts tutorial, we will create an initial environment composed of an autoscaling group with two ubuntu machines behind a load balancer, then we will create a CI/CD pipeline to provide blue/green deployments using CodeBuild, CodeDeploy, and CodePipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6X5M-VHXjmy3-RD2uU9aEA.jpeg" /></figure><h3>Part 3: Setup the initial environment</h3><p>In this section we will setup our initial environment by configuring:</p><ol><li>Launch Configuration</li><li>Autoscaling Group</li><li>Target Group</li><li>Load Balancer</li><li>Configure Servers</li></ol><h3>Create a Launch Configuration</h3><p>Browse to “Launch Configurations” (under Auto Scaling) in the EC2 portal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MY2P0HV7d3Ql9zz3.png" /></figure><p>Then click in “Create launch configuration”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yioF2F0NoBxu9fmE.png" /></figure><p>Select “Ubuntu 18.04” as the AMI template for the instances</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4yqeXmF63mw75Hyr.png" /></figure><p>Select “t2.micro” as the instance type</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P0yUnYfzB1uNaEs2.png" /></figure><p>Configure the launch configuration with the following details and click on “Next: Add storage”:</p><ul><li>Name: bluegreen-launchconfig</li><li>IAM Role: bluegreen-ec2-role</li><li>Advanced -&gt; User data:</li><li>Set a startup script for the instances to install the codedeploy agent</li></ul><pre>#!/bin/bash <br>apt-get -y update <br>apt-get -y install ruby <br>apt-get -y install wget <br>cd /home/ubuntu <br>wget <a href="https://aws-codedeploy-ap-southeast-1.s3.amazonaws.com/latest/install">https://aws-codedeploy-ap-southeast-1.s3.amazonaws.com/latest/install</a> <br>chmod +x ./install <br>./install auto <br>systemctl enable codedeploy-agent <br>systemctl start codedeploy-agent <br>systemctl restart codedeploy-agent</pre><ul><li>Note: you may require update the script according to your region (I am working on “ap-southeast-1”, for more details see: <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/resource-kit.html#resource-kit-bucket-names">https://docs.aws.amazon.com/codedeploy/latest/userguide/resource-kit.html#resource-kit-bucket-names</a>)</li><li>Advanced → IP Address Type: Assign a public IP address to every instance</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gs0zbhaM1W49Gk3c.png" /></figure><p>Then you will be asked for the storage configuration, keep the defaults and click “Next: Configure Security Group”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h4tWVOX_RGORNg2Q.png" /></figure><p>Choose the security group that you created before (bluegreen-sg) and click “Review”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XLPb7CQZrA34xx3S.png" /></figure><p>Review the details and click on “Create launch configuration”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Sr57M6BI_j-uJnVJ.png" /></figure><p>Choose the SSH key pair created before (bluegreen-key), check the confirmation box and click on “Create launch configuration”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JoLfZU8UUayubMyu.png" /></figure><p>Finally in the confirmation page click on “Create an Auto Scaling group using this launch configuration”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hhWWYxOPw17DwgXC.png" /></figure><h3>Configure an Autoscaling Group</h3><p>Configure the autoscaling group with the parameters below and click on “Next: Configure scaling policies”</p><ul><li>Group Name: bluegreen-asg</li><li>Group Size: 2</li><li>Network: &lt;your-vpc&gt;</li><li>Subnets: &lt;your-subnets&gt;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2OP3rbQgcU9UsKwK.png" /></figure><p>Choose “Keep this group at its initial size” (default) and click on “Next: Configure notifications”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TZ5pq24VIWMCFT6K.png" /></figure><p>We don’t need any notification so just click on “Next: Configure Tags”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ISnXjDB9q2Az5uRa.png" /></figure><p>Set the following tags and click on “Review” (those tags will be added to the instances created by the autos calling group)</p><ul><li>Name=bluegreen</li><li>App=bluegreen</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2cZ1yVPwk6AnCbLU.png" /></figure><p>Review the details and click on “Create Auto Scaling group”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Br1zVLanDIU4G9ks.png" /></figure><p>Browse to “Instances” under “EC2” to see how your servers are being created by the auto scaling group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TGFvimKSXxh7kieR.png" /></figure><h3>Create a Target Group</h3><p>Browse to “Target Groups” (under Load Balancing) in the EC2 portal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gChQ4i5dm1M2jGCu.png" /></figure><p>Click on “Create target group”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*awsODYDASvib1xMD.png" /></figure><p>Configure the target group with the details below:</p><ul><li>Name: bluegreen-tg</li><li>Target Type: Instance</li><li>Protocol: HTTP</li><li>Port: 80</li><li>VPC: &lt;your-pvc&gt;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WK23T7RFG6lSXxtW.png" /></figure><p>Select the created target group, open the tab “Targets” and click on “Edit” to add the instances to the target group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jlpS1qF9egTl87pL.png" /></figure><p>Search the instances created by the auto scaling group (“bluegreen”) and register them in the target group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qztNBBzC8s7z7shS.png" /></figure><h3>Setup a Load Balancer</h3><p>Browse to “Load Balancers” under “Load Balancing” in the EC2 portal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ec-6gcKLBmwHiFBE.png" /></figure><p>Click on “Create Load Balancer”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zDefoEQJHMnyipSP.png" /></figure><p>Let’s create an Application Load Balancer by choose “HTTP/HTTPS”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gwvuRT335sIWicX2.png" /></figure><p>Configure the load balancer with the details below, then click on “Next: Configure Security Settings”</p><ul><li>Name: bluegreen-lb</li><li>Scheme (default): internet-facing</li><li>IP adress type (default): ipv4</li><li>Listeners (default): HTTP-80</li><li>Availability Zones</li><li>VPC: &lt;your-vpc&gt;</li><li>Subnets: &lt;your-subnets&gt;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yhPPWpTApLsVHMPO.png" /></figure><p>Click on “Next: Configure Security Groups”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Byz719z2vVuEM4qb.png" /></figure><p>Select the security group “bluegreen-sg” and click on “Next: Configure Routing”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0UTTi6JXBRf9yfKJ.png" /></figure><p>Configure routing with the parameters below, then click on “Next: Register Targets”</p><ul><li>Target Group: Existing target group</li><li>Name: bluegreen-tg</li><li>Target Type: Instance</li><li>Protocol: HTTP</li><li>Port: 80</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3yO7jhG9v5NIZcm0.png" /></figure><p>Ensure that the instances are registered and click on “Next: Review”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1yIzdeP_-2wORjHr.png" /></figure><p>Review the load balancer details and click on “Create”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ax6UMj3R3bKR4WdR.png" /></figure><h3>Configure Servers</h3><p>Get the public ip of your instances in the EC2 portal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IeylAwwReuwhM3O4.png" /></figure><p>Ensure that the downloaded ssh key have the right permissions by run</p><pre>chmod 400 ~/Downloads/bluegreen-key.pem</pre><p>Access the first instance by using the command</p><pre>ssh ubuntu@&lt;instance1-public-ip&gt; -i ~/Downloads/bluegreen-key.pem</pre><p>Ensure that the CodeDeploy agent is up and running</p><pre>systemctl status codedeploy-agent</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fnWKLat9ke_X2NxH.png" /></figure><p>Use the command below to install Apache</p><pre>sudo apt-get install -y apache2</pre><p>Browse to the first server, you should see the Apache default page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cqysUFt5WSEmzjY2.png" /></figure><p>Exit from the first instance and access to the second one</p><pre>ssh ubuntu@&lt;instance2-public-ip&gt; -i ~/Downloads/bluegreen-key.pem</pre><p>Use the command below to install Apache</p><pre>sudo apt-get install -y apache2</pre><p>Browse to the second server, you should see the Apache default page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eNGHCDpiz28-LVdn.png" /></figure><p>Browse to the load balancer to ensure that it’s working as expected</p><p>Next: How do you implement Blue/Green deployment in AWS (Part 4/7) <strong>[Will be available soon]</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d1d1d1824e7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudwithmore/blue-green-deployment-for-autoscaling-groups-with-codepipeline-codebuild-and-codedeploy-part-3-7-9d1d1d1824e7">Blue/Green Deployment for Autoscaling Groups with CodePipeline, CodeBuild and CodeDeploy (Part 3/7)</a> was originally published in <a href="https://medium.com/cloudwithmore">CloudWithMORE</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blue/Green Deployment for Autoscaling Groups with CodePipeline, CodeBuild and CodeDeploy (Part 2/7)]]></title>
            <link>https://medium.com/cloudwithmore/blue-green-deployment-for-autoscaling-groups-with-codepipeline-codebuild-and-codedeploy-part-2-7-c31479ef3791?source=rss----c10da74a56d0---4</link>
            <guid isPermaLink="false">https://medium.com/p/c31479ef3791</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[codedeploy]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Leon Jalfon]]></dc:creator>
            <pubDate>Wed, 30 Sep 2020 10:19:09 GMT</pubDate>
            <atom:updated>2020-10-05T14:28:09.246Z</atom:updated>
            <content:encoded><![CDATA[<h3>How do you implement Blue/Green deployment in AWS (Part 2/7)</h3><p>In this 7-parts tutorial, we will create an initial environment composed of an autoscaling group with two ubuntu machines behind a load balancer, then we will create a CI/CD pipeline to provide blue/green deployments using CodeBuild, CodeDeploy, and CodePipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6X5M-VHXjmy3-RD2uU9aEA.jpeg" /></figure><h3>Part 2: Prerequisites</h3><p>In this section we will create all the required resources that we need for the next steps:</p><ol><li>EC2 Key Pair</li><li>Security Group</li><li>IAM Role for EC2 Instances</li><li>IAM Role for CodeBuild</li><li>IAM Role for CodeDeploy</li><li>Fork the Tutorial Repository on Github</li></ol><h3>Create an EC2 Key Pair</h3><p>Let’s create an SSH key to access our servers</p><p>Browse to “Key Pairs” (under Network &amp; Security) in the EC2 portal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1wnehwjyU7USBnv9.png" /></figure><p>Then click to “Create key pair”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*08mxlDEsRe7xlmJ8.png" /></figure><p>Create a new key with the following details:</p><ul><li>Name: Bluegreen-key</li><li>File format: pem</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BH9ybdrutUFuLB78.png" /></figure><p>The key will be downloaded automatically, store it in a secure place (you will need it after)</p><h3>Create a Security Group</h3><p>Now let’s create a security group to allow traffic to our servers</p><p>Browse to “Security groups” (under Network &amp; Security) in the EC2 portal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l6cBnKABwdcSocfQ.png" /></figure><p>Then click to “Create security group”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3GqU7Dd4b-PGS4w3.png" /></figure><p>Create a new key with the following details</p><ul><li>Name: bluegreen-sg</li><li>Description: all open</li><li>VPC: &lt;your-vpc&gt;</li><li>Inbound Rules Type: All traffic</li><li>Inbound Rules Source: Anywhere</li><li>Outbound Rules Type: All traffic</li><li>Outbound Rules Destination: Custom 0.0.0.0/0</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FfXJ40ugXI05b0IZ.png" /></figure><h3>Create an IAM Role for your EC2 Instances</h3><p>Now we need to create an IAM role for your instances to grant access to S3</p><p>Browse to “Policies” in the IAM portal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7SQwRl5EGI6MflgI.png" /></figure><p>Click on “Create policy”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OfEOM7kzFDN9IaAl.png" /></figure><p>Click on the “JSON” tab, paste the below policy and click on “Review policy”</p><pre>{<br>   &quot;Version&quot;: &quot;2012-10-17&quot;,<br>   &quot;Statement&quot;: [<br>       {<br>           &quot;Action&quot;: [<br>               &quot;s3:Get*&quot;,<br>               &quot;s3:List*&quot;<br>           ],<br>           &quot;Effect&quot;: &quot;Allow&quot;,<br>           &quot;Resource&quot;: &quot;*&quot;<br>       }<br>   ]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*COpP0BkF1LGk6MlC.png" /></figure><p>Create the policy with the details below:</p><ul><li>Name: bluegreen-ec2-policy</li><li>Description: allow access to s3 from ec2 instance</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V2mMZFoxkmjL5WzW.png" /></figure><p>Browse to “Roles” in the IAM portal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yYVvPruCZKbaVt5n.png" /></figure><p>Click on “Create role”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BO0hvnXmQ_UW_Zco.png" /></figure><p>Create a role with the following details:</p><ul><li>Type of trusted entity: AWS service</li><li>Use case: EC2</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lxbvA2QiHk9fPH8y.png" /></figure><p>Then attach the policy created previously “bluegreen-ec2-policy” and click “Next:Tags”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k3ALIDqckKvFUc_u.png" /></figure><p>Add a tag (optional) and click “Next: Review”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RCwHg5xZVIosBgJi.png" /></figure><p>Finally create the role by click “Create role” (name it “bluegreen-ec2-role”)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FYrJytfCb9wQkc1P.png" /></figure><h3>Create an IAM Role for CodeBuild</h3><p>Let’s create an IAM role to by used by CodeBuild</p><p>Browse to “Policies” in the IAM portal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jPuuLWyVWTXTUYWI.png" /></figure><p>Click on “Create policy”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LZxH39e3rvCFHxZ0.png" /></figure><p>Click on the “JSON” tab, paste the below policy and click on “Review policy”</p><pre>{<br>   &quot;Version&quot;: &quot;2012-10-17&quot;,<br>   &quot;Statement&quot;: [<br>       {<br>           &quot;Effect&quot;: &quot;Allow&quot;,<br>           &quot;Resource&quot;: &quot;*&quot;,<br>           &quot;Action&quot;: [<br>               &quot;logs:CreateLogGroup&quot;,<br>               &quot;logs:CreateLogStream&quot;,<br>               &quot;logs:PutLogEvents&quot;<br>           ]<br>       },<br>       {<br>           &quot;Effect&quot;: &quot;Allow&quot;,<br>           &quot;Resource&quot;: &quot;*&quot;,<br>           &quot;Action&quot;: [<br>               &quot;s3:PutObject&quot;,<br>               &quot;s3:GetObject&quot;,<br>               &quot;s3:GetObjectVersion&quot;,<br>               &quot;s3:GetBucketAcl&quot;,<br>               &quot;s3:GetBucketLocation&quot;<br>           ]<br>       },<br>       {<br>           &quot;Effect&quot;: &quot;Allow&quot;,<br>           &quot;Action&quot;: [<br>               &quot;codebuild:CreateReportGroup&quot;,<br>               &quot;codebuild:CreateReport&quot;,<br>               &quot;codebuild:UpdateReport&quot;,<br>               &quot;codebuild:BatchPutTestCases&quot;<br>           ],<br>           &quot;Resource&quot;: &quot;*&quot;<br>       }<br>   ]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oNEBpWXtgoTDxyUa.png" /></figure><p>Create the policy with the details below:</p><ul><li>Name: bluegreen-codebuild-policy</li><li>Description: allow required access for codebuild</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ORSRyHvIthdTrr_S.png" /></figure><p>Browse to “Roles” in the IAM portal</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*URU9T4ju7Hkq9Xx1.png" /></figure><p>Now let’s create another role for CodeBuild by click on “Create role”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lj3yG2Pbx6ZeY4Zk.png" /></figure><p>Create a role with the following details:</p><ul><li>Type of trusted entity: AWS service</li><li>Use case: CodeBuild</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PIQ0mgAgm81tyh0h.png" /></figure><p>Then attach the policy created previously “bluegreen-codebuild-policy” and click “Next:Tags”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xWTMc5HbzGj8TFj3.png" /></figure><p>Add a tag (optional) and click “Next: Review”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Tsk37vbEAoXR72S0.png" /></figure><p>Finally create the role by click “Create role” (name it “bluegreen-codebuild-role”)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uApy37GbvRlSp0Ez.png" /></figure><h3>Create an IAM Role for CodeDeploy</h3><p>Now let’s create another role for CodeDeploy</p><p>Click on “Create role” to create a new role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2koX7Dr9mhkIS1Je.png" /></figure><p>Create a role with the following details:</p><ul><li>Type of trusted entity: AWS service</li><li>Use case: CodeDeploy</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yS0b8IfXJOQBjN3N.png" /></figure><p>Then keep the policy called “AWSCodeDeployRole” and click “Next:Tags”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*47N8PbSOtcNed-8b.png" /></figure><p>Add a tag (optional) and click “Next: Review”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZONPw0qxNsaRyo4K.png" /></figure><p>Finally create the role by click “Create role” (name it “bluegreen-codedeploy-role”)</p><h3>Fork the Tutorial Repository on Github</h3><p>Fork the following repository:</p><p><a href="https://github.com/leonjalfon1/ec2-blue-green-deployment">leonjalfon1/ec2-blue-green-deployment</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VjQbg-JsJV89xCO8o_WoSA.png" /></figure><p>Next: How do you implement Blue/Green deployment in AWS (Part 3/7) <strong>[Will be available soon]</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c31479ef3791" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudwithmore/blue-green-deployment-for-autoscaling-groups-with-codepipeline-codebuild-and-codedeploy-part-2-7-c31479ef3791">Blue/Green Deployment for Autoscaling Groups with CodePipeline, CodeBuild and CodeDeploy (Part 2/7)</a> was originally published in <a href="https://medium.com/cloudwithmore">CloudWithMORE</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How do you implement Blue Green deployment in AWS]]></title>
            <link>https://medium.com/cloudwithmore/how-do-you-implement-blue-green-deployment-in-aws-f2f8e0df348d?source=rss----c10da74a56d0---4</link>
            <guid isPermaLink="false">https://medium.com/p/f2f8e0df348d</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[codedeploy]]></category>
            <dc:creator><![CDATA[Leon Jalfon]]></dc:creator>
            <pubDate>Thu, 24 Sep 2020 12:15:09 GMT</pubDate>
            <atom:updated>2020-10-05T14:28:10.764Z</atom:updated>
            <content:encoded><![CDATA[<h3>How do you implement Blue/Green deployment in AWS (Part 1/7)</h3><p>In this 7-parts tutorial, we will create an initial environment composed of an autoscaling group with two ubuntu machines behind a load balancer, then we will create a CI/CD pipeline to provide blue/green deployments using CodeBuild, CodeDeploy, and CodePipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6X5M-VHXjmy3-RD2uU9aEA.jpeg" /></figure><p>How often do your users experience downtime, caused by a buggy release? How often do you have to stay up late to take down a system? Do release days make you feel anxious?</p><p>Well, it doesn’t have to be that way. We’re here to help you make safe deployments without downtime.</p><h3>In this tutorial:</h3><ol><li>Prerequisites</li><li>Setup the initial environment</li><li>Configure CodeBuild</li><li>Configure CodeDeploy</li><li>Configure CodePipeline</li><li>Putting all together</li></ol><h3>The benefits of blue/green deployments</h3><p>Blue/green deployment involves two production environments:</p><ul><li>Blue is the active environment.</li><li>Green is for the release of a new version.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m-MMOG_UB_mQs8wX.png" /></figure><h3>Here are some of the advantages of a blue/green deployment:</h3><ul><li>You can perform testing on the green environment without disrupting the blue environment.</li><li>Switching to the green environment involves no downtime. It only requires the redirecting of user traffic.</li><li>Rolling back from the green environment to the blue environment in the event of a problem is easier because you can redirect traffic to the blue environment without having to rebuild it.</li><li>You can incorporate the principle of infrastructure immutability by provisioning fresh instances when you need to make changes. In this way, you avoid configuration drift.</li></ul><h3>AWS CodeDeploy offers two ways to perform blue/green deployments on EC2:</h3><ul><li>In the first approach, AWS CodeDeploy makes a copy of an Auto Scaling group. It, in turn, provisions new Amazon EC2 instances, deploys the application to these new instances and then redirects traffic to the newly deployed code.</li><li>In the second approach, you use instance tags or an Auto Scaling group to select the instances that will be used for the green environment. AWS CodeDeploy then deploys the code to the tagged instances.</li></ul><h3>References</h3><ul><li><a href="https://docs.aws.amazon.com/codebuild/latest/userguide">https://docs.aws.amazon.com/codebuild/latest/userguide</a></li><li><a href="https://docs.aws.amazon.com/codedeploy/latest/userguide">https://docs.aws.amazon.com/codedeploy/latest/userguide</a></li><li><a href="https://docs.aws.amazon.com/codepipeline/latest/userguide">https://docs.aws.amazon.com/codepipeline/latest/userguide</a></li></ul><p>Next: How do you implement Blue/Green deployment in AWS (Part 2/7) <strong>[Will be available soon]</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2f8e0df348d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudwithmore/how-do-you-implement-blue-green-deployment-in-aws-f2f8e0df348d">How do you implement Blue Green deployment in AWS</a> was originally published in <a href="https://medium.com/cloudwithmore">CloudWithMORE</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mirroring AWS Target Groups]]></title>
            <link>https://medium.com/cloudwithmore/mirroring-aws-target-groups-8af8bfa4f11b?source=rss----c10da74a56d0---4</link>
            <guid isPermaLink="false">https://medium.com/p/8af8bfa4f11b</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[computing]]></category>
            <category><![CDATA[lambda-function]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Ormaman]]></dc:creator>
            <pubDate>Tue, 08 Sep 2020 14:38:11 GMT</pubDate>
            <atom:updated>2020-09-09T07:34:19.155Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*H73LB_fykO6aBbBDdI4upg.jpeg" /></figure><h3>The scenario</h3><p>Using an architecture based on target groups behind an application load balancer it’s a common practice for EC2 based applications.<br>But what happens when you have several applications that need to be accessible from the internet and need to communicate with each other maintaining the lowest possible latency?</p><h3>The problem</h3><p>As there are many applications that interact with each other and rely on vast intercommunication with each other, the problem of latency becomes a considerable issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*s9axHS7TiGpQkypfMmsgpw.png" /><figcaption>Case flowchart</figcaption></figure><h3>The solution</h3><p>Many solutions were examined until the right best formula was found:</p><blockquote>a) Add an internal load balancer</blockquote><blockquote>b) Create a private hosted zone on <strong>Route53 </strong>thus, enabling the usage of the same URLs for internal and external communications between application.</blockquote><blockquote>c) Sync both target groups using a Lambda function</blockquote><p>By adding an internal load balancer and configure a private hosted zone on <strong>Route53 </strong>we can resolve the latency issue, however, that brings us to face new challenges​ , For example:<br>If we have configured a <a href="https://medium.com/sela-devops-team/blue-green-deployment-for-autoscaling-groups-with-codepipeline-codebuild-and-codedeploy-part-1-7-9234169ee3d?source=friends_link&amp;sk=ed597589dccd83890efba67183ac6943"><strong>Blue/Green deployment process using AWS Developer Tool</strong>s</a> (linked to the post that explain the CI/CD process) which update the external load balancer target group we will need to update the internal load balancer target group as well. <br>To achieve this, we can use <strong>Cloudtrail </strong>to track the changes in the public target group, <strong>Cloudwatch </strong>to trigger an event for each change in the target group and a lambda function to mirror the changes in the internal load balancer target group.</p><p>The solution flowchart described as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*eccEm1sX__V_70vBtjoD_g.png" /><figcaption>Solution flowchart</figcaption></figure><h3>Technical solution step by step procedure</h3><p>In the upcoming section, I shall lead you to step by step on how to get this mechanism up and running.</p><h3>Route 53</h3><blockquote><strong><em>Definition</em></strong><em>- </em>Amazon Route 53 is a highly available and scalable cloud Domain Name System (DNS) web service. It is designed to give developers and businesses an extremely reliable and cost effective way to route end users to Internet applications by translating names like <a href="http://www.example.com/">www.example.com</a> into the numeric IP addresses like 192.0.2.1 that computers use to connect to each other. Amazon Route 53 is fully compliant with IPv6 as well.</blockquote><p>1. Go to “<strong>Route 53</strong>” service, select “<strong>Hosted zones</strong>” section, and press the “<strong>Create Hosted Zone</strong>” button.</p><p>2. Leave everything as default, besides these attributes:</p><p>· <strong>Domain name- </strong>Enter the domain that you wish to host<strong> (example.com)</strong></p><p>· <strong>Type- </strong>Select the “<strong>Private Hosted Zone for Amazon VPC</strong>” option</p><p>· <strong>VPC ID- </strong>Lookup<strong> </strong>for your internal load balancer VPC ID</p><p>3. Enter the new domain and click on the “Create Record Set” button</p><p>4. Leave everything as default, besides these attributes:</p><p>· <strong>Name- </strong>Enter the name of the site that you wish to publish (<strong>App</strong>.example.com<strong>)</strong></p><p>· <strong>Alias- </strong>Choose <strong>Yes </strong>and on <strong>Alias Target</strong> lookup for you internal load balancer name</p><p>· <strong>Type- </strong>Select the “<strong>Private Hosted Zone for Amazon VPC</strong>” option</p><p>5. Push on the <strong>Create </strong>button</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F8IfZg_bgeBo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D8IfZg_bgeBo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F8IfZg_bgeBo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6ab53b3b90fbb8fb7045cc7b20a436b0/href">https://medium.com/media/6ab53b3b90fbb8fb7045cc7b20a436b0/href</a></iframe><h3>Cloud Trail</h3><blockquote><strong><em>Definition</em></strong><em>- AWS CloudTrail is a service that enables governance, compliance, operational auditing, and risk auditing of your AWS account. With CloudTrail, one can log, continuously monitor, and retain account activity related to actions across your AWS infrastructure. CloudTrail provides event history of your AWS account activity, including actions taken through the AWS Management Console, AWS SDKs, command line tools, and other AWS service.</em></blockquote><p>1. Go to “<strong>Cloud trail</strong>” service, select “<strong>Trails</strong>” section and press the “<strong>Create trail</strong>” button.</p><p>2. Leave everything as default, besides these attributes:</p><p>· <strong>Apply trail to all regions </strong>— Choose “no” if you want the trail only one region</p><p>· <strong>S3 bucket </strong>— Select a name that would be indicative to your organization naming convention</p><p>3. Click on the “<strong>Create</strong>” button.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FYSiwfQOM-Mg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DYSiwfQOM-Mg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FYSiwfQOM-Mg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5bf0839f6d5f752946412ef51137e3c/href">https://medium.com/media/e5bf0839f6d5f752946412ef51137e3c/href</a></iframe><h3>Lambda</h3><blockquote><strong><em>Definition</em></strong><em>- AWS Lambda is a compute service that lets you run code without provisioning or managing servers. AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to thousands per second. You pay only for the compute time you consume — there is no charge when your code is not running. With AWS Lambda, you can run code for virtually any type of application or backend service — all with zero administration.</em></blockquote><p>1. Go to “<strong>Lambda</strong>” service, under “<strong>Functions</strong>” press on “<strong>Create Function</strong>”</p><p>2. Leave everything as default beside these attributes:</p><p>· <strong>Function name </strong>— Select a name that would be indicative to your organization naming convention</p><p>· <strong>Runtime </strong>— Python 3.6</p><p>3. Under the “<strong>Function code</strong>” section paste the following <a href="https://github.com/ormam/metirials/blob/master/Replicate%20target%20groups">code</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/75e2bfb3b6f233baa3a39349118e92b2/href">https://medium.com/media/75e2bfb3b6f233baa3a39349118e92b2/href</a></iframe><p>4. Press on the “<strong>Save</strong>” button</p><p>The Lambda function needs to have a suitable permission in order to deal with the Target group resources, therefor we will grant a suitable policy to its predefined role.</p><p>5. Go to “<strong>IAM</strong>” service and press on “<strong>Roles</strong>”.</p><p>6. Under “<strong>Roles” </strong>look for the following role name convention:<br>“The Lambda function name from step ‘2’ “<strong>-role-” </strong>random sequence<strong>”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/30/0*pI98a8DeCMNBLTk8" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F4kQJH3LdKzSVq6q7H7iXA.png" /><figcaption>Example of a role name</figcaption></figure><p>7. click on the “<strong>Roles</strong>”</p><p>8. click on “<strong>Attach policy</strong>”</p><p>9. Click on “<strong>Create policy” </strong>choose on <strong>“JSON” </strong>tab and enter the following text.</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;Stmt1588516194702&quot;,<br>            &quot;Action&quot;: [<br>                &quot;elasticloadbalancing:DeregisterTargets&quot;,<br>                &quot;elasticloadbalancing:DescribeTargetGroups&quot;,<br>                &quot;elasticloadbalancing:DescribeTargetHealth&quot;,<br>                &quot;elasticloadbalancing:RegisterTargets&quot;<br>            ],<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Resource&quot;: &quot;*&quot;<br>        }<br>    ]<br>}</pre><p>10. Click on “<strong>Review policy</strong>” button.</p><p>11. Enter the name of the policy and create it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FP6Afg3f_Ebo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DP6Afg3f_Ebo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FP6Afg3f_Ebo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba06e24b2eba1cbbca6add4b235952aa/href">https://medium.com/media/ba06e24b2eba1cbbca6add4b235952aa/href</a></iframe><h3>Cloud Watch</h3><blockquote><strong><em>Definition</em></strong><em>- CloudWatch collects monitoring and operational data in the form of logs, metrics, and events, providing you with a unified view of AWS resources, applications, and services that run on AWS and on-premises servers.</em></blockquote><p>1. Go to “<strong>Cloud Watch</strong>” service, under “<strong>Events</strong>” click on “<strong>Rules</strong>” and press the “<strong>Create rule</strong>” button.</p><p>2. In the “<strong>Event source</strong>” section, leave everything as default beside these attributes:</p><p>· <strong>Service Name- </strong>Elastic Load Balancers</p><p>·<strong> Event Type- </strong>AWS API Call via Cloud Trail</p><p>· In the radio button section pick: “<strong>Specific operation(s)”</strong> and enter “<strong>RegisterTargets</strong>” &amp; “<strong>DeregisterTargets</strong>” in the free text boxes</p><p>3. In the “<strong>Targets</strong>” section, leave everything as default beside these attributes:</p><p>· In the first Combobox select — “<strong>Lambda function</strong>”</p><p>· In the second Combobox select — your Lambda function’s name</p><p>4. Click on “<strong>Configure details</strong>” button</p><p>5. Enter a name for your rule</p><p>6. Click on “<strong>Create Rule</strong>”</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUGquhVeFwMg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUGquhVeFwMg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUGquhVeFwMg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd0143f8fc9def73a01850822c2dd2db/href">https://medium.com/media/dd0143f8fc9def73a01850822c2dd2db/href</a></iframe><h3>Conclusion</h3><p>Great, you did it!</p><p>With technological creativity and open minds, we can achieve great things and create great solutions.</p><p>Hope it was helpful,</p><p>Or Maman</p><p><a href="http://www.linkedin.com/in/ormaman">www.linkedin.com/in/ormaman</a><br>Orm@sela.co.il</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8af8bfa4f11b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudwithmore/mirroring-aws-target-groups-8af8bfa4f11b">Mirroring AWS Target Groups</a> was originally published in <a href="https://medium.com/cloudwithmore">CloudWithMORE</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>