Search

Test Drive Your First Istio Deployment using Play with Kubernetes Platform- Cloud Computing

As a full stack Developer, if you have been spending a lot of time in developing apps recently, you already understand a whole new set of challenges related to Microservice architecture. Although there has been a shift from bloated monolithic apps to compact, focused Microservices for faster implementation and improved resiliency but the fact is  developers have to really worry about the challenges in integrating these services in distributed systems which includes accountability for service discovery, load balancing, registration, fault tolerance, monitoring, routing, compliance, and security.Let us understand the challenges faced by the developers and operators with the Microservice Architecture in details. Consider a 1st Generation simple Service Mesh scenario. As shown below, Service (A) communicates to Service (B). Instead of communicating directly, the request gets routed via Nginx. The Nginx finds a route in Consul (A service discovery tool) and automatically retries to form the connection on HTTP 502’s happen.                                                                    Figure: 1.0 – 1st Gen Service Mesh                                                      Figure:1.1 – Cascading Failure demonstrated with the increase in the number of servicesBut, with the advent of microservices architecture, the number is growing ever since. Below are the  listed challenges encountered by both developers as well as operations team:How to make these growing microservices communicate with each other?Enabling the load balancing architectures over these microservices.Providing role-based routing for the microservices.How to implement outgoing traffic on these microservices and test canary deployment?Managing complexity around these growing pieces of microservices.Implementation of fine-grained control for traffic behavior with rich-routing rules.Challenges in implementing Traffic encryption, service-to-service authentication, and strong identity assertions.In a nutshell, although you could enable service discovery and retry logic into application or networking middleware, the fact is that service discovery becomes tricky to make it right.Enter Istio’s Service Mesh“Service Mesh” is one of the hottest buzzwords of 2018. As the name suggests, it’s a configurable infrastructure layer for a microservices app. It lays out the network of microservices that make up applications and enables interactions between them. It makes communication between service instances flexible, reliable, and fast. The mesh provides service discovery, load balancing, encryption, authentication and authorization, support for the circuit breaker pattern, and other capabilities.Istio is completely an open source service mesh that layers transparently onto existing distributed applications. Istio v1.0 got announced last month and is ready for production. It is written completely in Go Language and its a fully grown platform which provides APIs that let it integrate into any logging platform, or telemetry or policy system. This project adds a very tiny overhead to your system. It is being hosted on GitHub. Istio’s diverse feature set lets you successfully, and efficiently, run a distributed microservice architecture, and provides a uniform way to secure, connect, and monitor microservices.Figure-1.2: Istio’s CapabilityThe Istio project adds a very tiny overhead to your system. It is being hosted on GitHub. Last month, Istio 1.0 release went public and ready for production environment.What benefits does Istio bring?Istio lets you connect, secure, control, and observe services.It helps to reduce the complexity of service deployments and eases the strain on your development teams.It provides developers and DevOps fine-grained visibility and control over traffic without requiring any changes to application code.It provides CIOs with the necessary tools needed to help enforce security and compliance requirements across the enterprise.It provides behavioral insights & operational control over the service mesh as a whole.Istio makes it easy to create a network of deployed services with automatic Load Balancing for HTTP, gRPC, Web Socket & TCP Traffic.It provides fine-grained control of traffic behavior with rich routing rules, retries, failovers, and fault injection.It enables a pluggable policy layer and configuration API supporting access controls, rate limits and quotas.Istio provides automatic metrics, logs, and traces for all traffic within a cluster, including cluster ingress and egress.It provides secure service-to-service communication in a cluster with strong identity-based authentication and authorization.If you want to deep-dive into Istio architecture, I highly recommend the official Istio website.It’s Demo Time !!!Under this blog post, I will showcase how Istio can be setup on Play with Kubernetes (PWK) Platform for a free of cost. In case you’re new, Play with Kubernetes rightly aka PWK is a labs site provided by Docker. It is a playground which allows users to run K8s clusters in a matter of seconds. It gives the experience of having a free CentOS LinuxVirtual Machine in the browser. Under the hood Docker-in-Docker (DinD) is used to give the effect of multiple VMs/PCs.Open  to access Kubernetes Playground.Click on the Login button to authenticate with Docker Hub or GitHub ID.Once you start the session, you will have your own lab environment.Adding First Kubernetes NodeClick on “Add New Instance” on the left to build your first Kubernetes Cluster node. It automatically names it as “node1”. Each instance has Docker Community Edition (CE) and Kubeadm already pre-installed. This node will be treated as the master node for our cluster.Bootstrapping the Master NodeYou can bootstrap the Kubernetes cluster by initializing the master (node1) node with the below script. Copy this script content into bootstrap.sh file and make it executable using “chmod +x bootstrap.sh” command.When you execute this script, as part of initialization, the kubeadm write several configuration files needed, setup RBAC and deployed Kubernetes control plane components (like kube-apiserver, kube-dns, kube-proxy, etcd, etc.). Control plane components are deployed as Docker containers.Copy the above kubeadm join token command and save it for the next step. This command will be used to join other nodes to your cluster.Adding Worker NodesClick on “Add New Node” to add a new worker node.Checking the Cluster StatusVerifying the running PodsInstalling Istio 1.0.0Istio is deployed in a separate Kubernetes namespace istio-system. We will verify it later. As of now, you can copy the below content in a file called install_istio.sh and save it. You can make it executable and run it to install Istio and related tools.You should be able to see screen flooding with the below output.As shown above, it will enable the Prometheus, ServiceGraph, Jaeger, Grafana, and Zipkin by default.Please note – While executing this script, it might end up with the below error message –unable to recognize "install/kubernetes/istio-demo.yaml": no matches for admissionregistration.k8s.io/, Kind=MutatingWebhookConfigurationThe error message is expected.As soon as the command gets executed completely, you should be able to see a long list of ports which gets displayed at the top center of the page.Verifying the ServicesExposing the ServicesTo expose Prometheus, Grafana & Servicegraph services, you will need to delete the existing services and then use NodePort instead of ClusterIP so as to access the service using the port displayed on the top of the instance page. (as shown below)You should be able to access Grafana page by clicking on “30004” port and Prometheus page by clicking on “30003”.You can check Prometheus metrics by selecting the necessary option as shown below:Under Grafana Page, you can add “Data Source” for Prometheus and ensure that the dashboard is up and running:Congratulations! You have installed Istio on Kubernetes cluster. Below listed services have been installed on K8s playground:Istio Controllers and related RBAC rulesIstio Custom Resource DefinitionsPrometheus and Grafana for MonitoringJeager for Distributed TracingIstio Sidecar Injector (we'll take a look next section)Installing IstioctlIstioctl is configuration command line utility of Istio. It helps to create, list, modify and delete configuration resources in the Istio system.Deploying the Sample BookInfo ApplicationNow Istio is installed and verified, you can deploy one of the sample applications provided with the installation- BookInfo. This is a simple mock bookstore application made up of four services that provide a web product page, book details, reviews (with several versions of the review service), and ratings - all managed using Istio.Deploying BookInfo ServicesDefining the Ingress Gateway:Verifying BookInfo ApplicationAccessing it via Web URLYou should now be able the BookInfo Sample as shown below:Hope, this Istio deployment Kubernetes tutorial helped you to successfully install Istio on Kubernetes. In the future blog post, I will deep dive into Istio Internal Architecture, traffic management, policies & telemetry in detail.
Rated 4.5/5 based on 1 customer reviews

Test Drive Your First Istio Deployment using Play with Kubernetes Platform- Cloud Computing

2K
Test Drive Your First Istio Deployment using Play with Kubernetes Platform- Cloud Computing

As a full stack Developer, if you have been spending a lot of time in developing apps recently, you already understand a whole new set of challenges related to Microservice architecture. Although there has been a shift from bloated monolithic apps to compact, focused Microservices for faster implementation and improved resiliency but the fact is  developers have to really worry about the challenges in integrating these services in distributed systems which includes accountability for service discovery, load balancing, registration, fault tolerance, monitoring, routing, compliance, and security.

Let us understand the challenges faced by the developers and operators with the Microservice Architecture in details. Consider a 1st Generation simple Service Mesh scenario. As shown below, Service (A) communicates to Service (B). Instead of communicating directly, the request gets routed via Nginx. The Nginx finds a route in Consul (A service discovery tool) and automatically retries to form the connection on HTTP 502’s happen.
                                                                    Figure: 1.0 – 1st Gen Service Mesh
Cascading Failure demonstrated with the increase in the number of services                                                      Figure:1.1 – Cascading Failure demonstrated with the increase in the number of services

But, with the advent of microservices architecture, the number is growing ever since. Below are the  listed challenges encountered by both developers as well as operations team:

  • How to make these growing microservices communicate with each other?
  • Enabling the load balancing architectures over these microservices.
  • Providing role-based routing for the microservices.
  • How to implement outgoing traffic on these microservices and test canary deployment?
  • Managing complexity around these growing pieces of microservices.
  • Implementation of fine-grained control for traffic behavior with rich-routing rules.
  • Challenges in implementing Traffic encryption, service-to-service authentication, and strong identity assertions.

In a nutshell, although you could enable service discovery and retry logic into application or networking middleware, the fact is that service discovery becomes tricky to make it right.

Enter Istio’s Service Mesh

“Service Mesh” is one of the hottest buzzwords of 2018. As the name suggests, it’s a configurable infrastructure layer for a microservices app. It lays out the network of microservices that make up applications and enables interactions between them. It makes communication between service instances flexible, reliable, and fast. The mesh provides service discovery, load balancing, encryption, authentication and authorization, support for the circuit breaker pattern, and other capabilities.

Istio is completely an open source service mesh that layers transparently onto existing distributed applications. Istio v1.0 got announced last month and is ready for production. It is written completely in Go Language and its a fully grown platform which provides APIs that let it integrate into any logging platform, or telemetry or policy system. This project adds a very tiny overhead to your system. It is being hosted on GitHub. Istio’s diverse feature set lets you successfully, and efficiently, run a distributed microservice architecture, and provides a uniform way to secure, connect, and monitor microservices.
Istio’s Capability

Figure-1.2: Istio’s Capability

The Istio project adds a very tiny overhead to your system. It is being hosted on GitHub. Last month, Istio 1.0 release went public and ready for production environment.

What benefits does Istio bring?

  • Istio lets you connect, secure, control, and observe services.
  • It helps to reduce the complexity of service deployments and eases the strain on your development teams.
  • It provides developers and DevOps fine-grained visibility and control over traffic without requiring any changes to application code.
  • It provides CIOs with the necessary tools needed to help enforce security and compliance requirements across the enterprise.
  • It provides behavioral insights & operational control over the service mesh as a whole.
  • Istio makes it easy to create a network of deployed services with automatic Load Balancing for HTTP, gRPC, Web Socket & TCP Traffic.
  • It provides fine-grained control of traffic behavior with rich routing rules, retries, failovers, and fault injection.
  • It enables a pluggable policy layer and configuration API supporting access controls, rate limits and quotas.
  • Istio provides automatic metrics, logs, and traces for all traffic within a cluster, including cluster ingress and egress.
  • It provides secure service-to-service communication in a cluster with strong identity-based authentication and authorization.

If you want to deep-dive into Istio architecture, I highly recommend the official Istio website.
benefits does Istio bringIt’s Demo Time !!!

Under this blog post, I will showcase how Istio can be setup on Play with Kubernetes (PWK) Platform for a free of cost. In case you’re new, Play with Kubernetes rightly aka PWK is a labs site provided by Docker. It is a playground which allows users to run K8s clusters in a matter of seconds. It gives the experience of having a free CentOS Linux
Virtual Machine in the browser. Under the hood Docker-in-Docker (DinD) is used to give the effect of multiple VMs/PCs.

Open  to access
 Kubernetes Playground.
Click on the Login button to authenticate with Docker Hub or GitHub ID.
Once you start the session, you will have your own lab environment.

Adding First Kubernetes Node

Click on “Add New Instance” on the left to build your first Kubernetes Cluster node. It automatically names it as “node1”. Each instance has Docker Community Edition (CE) and Kubeadm already pre-installed. This node will be treated as the master node for our cluster.
Bootstrapping the Master Node

You can bootstrap the Kubernetes cluster by initializing the master (node1) node with the below script. Copy this script content into bootstrap.sh file and make it executable using “chmod +x bootstrap.sh” command.
Bootstrapping the Master NodeWhen you execute this script, as part of initialization, the kubeadm write several configuration files needed, setup RBAC and deployed Kubernetes control plane components (like kube-apiserver, kube-dns, kube-proxy, etcd, etc.). Control plane components are deployed as Docker containers.
Copy the above kubeadm join token command and save it for the next step. This command will be used to join other nodes to your cluster.

Adding Worker Nodes
Click on “Add New Node” to add a new worker node.
Adding Worker NodesChecking the Cluster Status

Checking the Cluster Status

Verifying the running Pods
Verifying the running PodsInstalling Istio 1.0.0

Istio is deployed in a separate Kubernetes namespace istio-system. We will verify it later. As of now, you can copy the below content in a file called install_istio.sh and save it. You can make it executable and run it to install Istio and related tools.
Installing Istio 1.0.0You should be able to see screen flooding with the below output.

As shown above, it will enable the Prometheus, ServiceGraph, Jaeger, Grafana, and Zipkin by default.

Please note – While executing this script, it might end up with the below error message –

unable to recognize "install/kubernetes/istio-demo.yaml": no matches for admissionregistration.k8s.io/, Kind=MutatingWebhookConfiguration

The error message is expected.

As soon as the command gets executed completely, you should be able to see a long list of ports which gets displayed at the top center of the page.
Verifying the Services
Verifying the ServicesExposing the Services

To expose Prometheus, Grafana & Servicegraph services, you will need to delete the existing services and then use NodePort instead of ClusterIP so as to access the service using the port displayed on the top of the instance page. (as shown below)
Exposing the ServicesYou should be able to access Grafana page by clicking on “30004” port and Prometheus page by clicking on “30003”.
You can check Prometheus metrics by selecting the necessary option as shown below:
Under Grafana Page, you can add “Data Source” for Prometheus and ensure that the dashboard is up and running:
Congratulations! You have installed Istio on Kubernetes cluster. Below listed services have been installed on K8s playground:

  • Istio Controllers and related RBAC rules
  • Istio Custom Resource Definitions
  • Prometheus and Grafana for Monitoring
  • Jeager for Distributed Tracing
  • Istio Sidecar Injector (we'll take a look next section)


Installing Istioctl

Istioctl is configuration command line utility of Istio. It helps to create, list, modify and delete configuration resources in the Istio system.
Deploying the Sample BookInfo Application

Now Istio is installed and verified, you can deploy one of the sample applications provided with the installation- BookInfo. This is a simple mock bookstore application made up of four services that provide a web product page, book details, reviews (with several versions of the review service), and ratings - all managed using Istio.

Deploying BookInfo Services
Defining the Ingress Gateway:

Verifying BookInfo Application

Accessing it via Web URL
Accessing it via Web URLYou should now be able the BookInfo Sample as shown below:

Hope, this Istio deployment Kubernetes tutorial helped you to successfully install Istio on Kubernetes. In the future blog post, I will deep dive into Istio Internal Architecture, traffic management, policies & telemetry in detail.

Ajeet Singh

Ajeet Singh Raina

Blog Author

Ajeet Singh Raina is a Docker Captain & {code} Catalysts by DellEMC. He is currently working as Technical Lead Engineer in Enterprise Solution Group @ Dell R&D. He has over 10+ years of solid understanding of a diverse range of IT infrastructure, systems management, systems integration and quality assurance.  He is a frequent blogger at www.collabnix.com and have 150+ blogs contributed on new upcoming Docker releases and features. His personal blog attracts roughly thousands of visitors and tons of page-views every month. His areas of interest includes Docker on Swarm Mode, IoTs, and Legacy Applications & Cloud. 

Join the Discussion

Your email address will not be published. Required fields are marked *

1 comments

Mohan Pawar 02 Sep 2018

Amazing guide... Thank you.

Suggested Blogs

Business Transformation through Enterprise Cloud Computing

The Cloud Best Practices Network is an industry solutions groups and best practices catalogue of how-to information for Cloud Computing. While we cover all aspects of the technology our primary goal is to explain the enabling relationship between this new IT trend and business transformation, where our materials include: Core Competencies – The mix of new skills and technologies required to successfully implement new Cloud-based IT applications. Reference Documents – The core articles that define what Cloud Computing is and what the best practices are for implementation, predominately referring to the NIST schedule of information. Case studies – Best practices derived from analysis of pioneer adopters, such as the State of Michigan and their ‘MiCloud‘ framework . Read this article ‘Make MiCloud Your Cloud‘ as an introduction to the Cloud & business transformation capability. e-Guides – These package up collections of best practice resources directed towards a particular topic or industry. For example our GovCloud.info site specializes in Cloud Computing for the public sector. White papers – Educational documents from vendors and other experts, such as the IT Value mapping paper from VMware. Core competencies The mix of new skills and technologies required to successfully implement new Cloud-based IT applications, and also the new capabilities that these platforms make possible: Virtualization Cloud Identity and Security – Cloud Privacy Cloud 2.0 Cloud Configuration Management Cloud Migration Management DevOps Cloud BCP ITaaS Procurement Cloud Identity and Security Cloud Identity and Security best practices (CloudIDSec) provides a comprehensive framework for ensuring the safe and compliant use of Cloud systems. This is achieved through combining a focus on the core references for Cloud Security, the Cloud Security Alliance, with those of Cloud Identity best practices: IDaaS – Identity Management 2.0 Federated Identity Ecosystems Cloud Privacy A common critcal focus area for Cloud computing is data privacy, particularly with regards to the international aspects of Cloud hosting. Cloud Privacy refers to the combination of technologies and legal frameworks to ensure privacy of personal information held in Cloud systems, and a ‘Cloud Privacy-by-Design’ process can then be used to identify the local legislated privacy requirements of information. Tools for designing these types of privacy controls have been developed by global privacy experts, such as Ann Cavoukian, the current Privacy Commissioner for Ontario, who provides tools to design and build these federated privacy systems. The Privacy by Design Cloud Computing Architecture (26-page PDF) document provides a base reference for how to combine traditional PIAs (Privacy Impact Assessments) with Cloud Computing. As this Privacy Framework presentation then explains these regulatory mechanisms that Kantara enables can then provide the foundations for securing the information in a manner that encompasses all the legacy, privacy and technical requirements needed to ensure it is suitable for e-Government scenarios. This then enables it to achieve compliance with the Cloud Privacy recommendations put forward by global privacy experts, such as Ann Cavoukian, the current Privacy Commissioner for Ontario, who stipulates a range of ‘Cloud Privacy By Design‘ best practices Cloud 2.0 Cloud is as much a business model as it is a technology, and this model is best described through the term ‘Cloud 2.0′. As the saying goes a picture tells a thousand words, and as described by this one Cloud 2.0 represents the intersection between social media, Cloud computing and Crowdsourcing. The Social Cloud In short it marries the emergent new online world of Twitter, Linkedin et al, and the technologies that are powering them, with the traditional, back-end world of mainframe systems, mini-computers and all other shapes and sizes of legacy data-centre. “Socializing” these applications means moving them ‘into the Cloud’, in the sense of connecting them into this social data world, as much as it does means virtualizing the application to run on new hardware. This a simple but really powerful mix, that can act as a catalyst for an exciting new level of business process capability. It can provide a platform for modernizing business processes in a significant and highly innovative manner, a breath of fresh air that many government agency programs are crying out for. Government agencies operate many older technology platforms for many of their services, making it difficult to amend them for new ways of working and in particular connecting them to the web for self-service options. Crowdsourcing Social media encourages better collaboration between users and information, and tools for open data and back-end legacy integrations can pull the transactional systems informtion needed to make this functional and valuable. Crowdsourcing is: a distributed problem-solving and production process that involves outsourcing tasks to a network of people, also known as the crowd. Although not a component of the technologies of Cloud Computing, Crowdsourcing is a fundamental concept inherent to the success of the Cloud 2.0 model. The commercial success of migration to Cloud Computing will be amplified when there is a strong focus on the new Web 2.0 type business models that the technology is ideal for enabling. Case study – Peer to Patent One such example is the Whitehouse project the Peer to the Patent portal, a headline example of Open Government, led by one its keynote experts Beth Noveck. This project illustrates the huge potential for business transformation that Cloud 2.0 offers. It’s not just about migrating data-center apps into a Cloud provider, connecting an existing IT system to a web interface or just publishing Open Data reporting data online, but rather utilizing the nature of the web to entirely re-invent the core process itself. It’s about moving the process into the Cloud. In this 40 page Harvard white paper Beth describes how the US Patent Office was building up a huge backlog of over one million patent applications due to a ‘closed’ approach where only staff from the USPTO could review, contribute and decide upon applications. To address this bottleneck she migrated the process to an online, Open version where contributors from across multiple organizations could help move an application through the process via open participation web site features. Peer to Patent is a headline example of the power of Open Government, because it demonstrates its about far more than simply publishing reporting information online in an open manner, so that they public can inspect data like procurement spending numbers. Rather it’s about changing the core decision-making processes entirely, reinventing how Government itself works from the inside out, reinventing it from a centralized hierarchical monolith to an agile, distributed peer to peer network. In essence it transforms the process from ‘closed’ to ‘open’, in terms of who and how others can participate, utilizing the best practice of ‘Open Innovation‘ to break the gridlock that had occured due the constraints caused by private, traditional ways of working. Open Grantmaking – Sharing Cloud Best Practices Beth has subsequently advised further on how these principles can be applied in general across Government. For example in this article on her own blog she describes ‘Open Grantmaking‘ – How the Peer To Patent crowdsourcing model might be applied to the workflows for government grant applications. She touches on what is the important factor about these new models, their ability to accelerate continual improvement within organizations through repeatedly sharing and refining best practices: “In practice, this means that if a community college wins a grant to create a videogame to teach how to install solar panels, everyone will have the benefit of that knowledge. They will be able to play the game for free. In addition, anyone can translate it into Spanish or Russian or use it as the basis to create a new game to teach how to do a home energy retrofit.” Beth describes how Open Grantmaking might be utilized to improve community investing in another blog, describing how OG would enable more transparency and related improvements. Cloud 2.0 As the underlying technology Cloud 2.0 caters for both the hosting of the software and also the social media 2.0 features that enable the cross-enterprise collaboration that Beth describes. Cloud Configuration Management CCM is the best practice for change and configuration management within Cloud environments, illustrated through vendors such as Evolven. Problem Statement One of the key goals and perceived benefits of Cloud computing is a simplified IT environment, a reduction of complexity through virtualizing applications into a single overall environment. However complexity actually increases.  Virtual Machines (VMs) encapsulate application and infrastructure configurations, they package up a combination of applications and their settings, obscuring this data from traditional configuration management tools. Furthermore the ease of self-service creation of VMs results in their widespread proliferation, and so actually the adoption of Cloud technologies creates a need for a new, extra dimension of systems management. This is called CCM, and incorporates: Release & Incident Management The increased complexity therefore increases the difficulties in trouble-shooting technical problems, and thus requires an updated set of tools and also updates to best practices like the use of ITIL procedures. ‘Release into Production’ is a particularly sensitive process within software teams, as major upgrades and patches are transitioned from test to live environments. Any number of configuration-related errors could cause the move to fail, and so CCM software delivers the core competency of being better able to respond quicker to identify and resolve these issues, reducing the MTTR significantly. DevOps DevOps is a set of principles, methods and practices for communication, collaboration and integration between software development and IT operations. Through the implementation of a shared Lean adoption program and QMS (Quality Management System) the two groups can better work together to minimize downtimes while improving the speed and quality of software development. It’s therefore directly linked to Business Agility. The higher the value of speed and quality = a faster ability to react to market changes, deploy new products and processes and in general adapt the organization, achieved through increasing the frequency of ‘Release Events’: It’s therefore directly linked to Business Agility. The higher the value of speed and quality = a faster ability to react to market changes, deploy new products and processes and in general adapt the organization, achieved through increasing the frequency of ‘Release Events’: ITaaS Procurement The fundamental shift that Cloud Computing represents is illustrated in one key implementation area: Procurement. Moving to Cloud services means changing from a financial model for technology where you buy your own hardware and software, and pay for it up front, to an approach where instead you access it as a rental, utility service where you “PAYG – Pay As You Go”. To encompass all the different ‘as a Service’ models this is known at an overall level as ‘ITaaS’ – IT as a Service. Any type of IT can be virtualized and delivered via this Service model.
Rated 4.0/5 based on 20 customer reviews
Business Transformation through Enterprise Cloud C...

The Cloud Best Practices Network is an industry ... Read More

How To Configure Jenkins With BITBUCKET - Cloud Computing

PURPOSE:This article will provide you a complete detailed knowledge of configuring Jenkins with Bitbucket repository which will help in automating the deployment process and will help to set the path for the interaction of Jenkins continuous integration tool with bitbucket repository.INTRODUCTION:As a part of the continuous integration and deployment process, it is a requirement that the code repository should have an interaction with the build automation and continuous integration tool. In this article, we are working with bitbucket and Jenkins to achieve the same, but this could be similar to the other tools that are available in the market. Let’s see the steps to integrate a Bitbucket with the Jenkins.Ways for Enabling Jenkins with Bitbucket:STEP 1: Login to your Jenkins and then select Manage Jenkins->Plugin Manager and on the tab available select the option bitbucket plugin and click on install without restart. In my case, this is installed already hence it’s showing under the Installed section.Step 2: Once the installation is done, configure a sample project and in build triggers section during the creation of a new project select build when a change is pushed to bitbucket and click apply and save to enable trigger Jenkins with bitbucket:Step 3: Now, visit Bitbucket URL: https://bitbucket.org/ and create your own repository, if you haven’t created yet else visit your own bitbucket repository for the purpose of this course. I have LearnShareKnowledge as the repository-Step 4: Click on the clone and copy the repository URL which you want to configure with Jenkins from bitbucket:Step 5: Go back to Jenkins and click on the project which you have to create and click on configure under the Source Code Management section, select the repository type which you have in your bitbucket repository. In my case, it is git and paste the URL by removing git clone to connect Jenkins with bitbucket. Click on save to reflect the changes:Step 6: Select the credentials if it is not a public repository for configuring the credentials, you can click the Add button on credentials section and proceed with username and password under global credentials domain and click Add.Step 7: Now, again visit the bitbucket repository which you want to configure. For that, click on settings under that repository:Step 8: Under settings, click on webhooks highlighted in the picture:Step 9: Click on add webhook and give the title to that webhook and paste the URL of Jenkins which you have configured with bitbucket and then select active and repository push and save the changes. If you want to make this more secure, then you can verify this with SSL certificate but in my case,  I used a secure key which provides a security to this setup:Now with the Jenkins setup for Bitbucket, we are ready to test the complete configuration. As soon as you do commit to the repository, you will be having an automated build triggered initiating a job inside the Jenkins project which you have configured with the repository.
Rated 4.0/5 based on 3 customer reviews
How To Configure Jenkins With BITBUCKET - Cloud Co...

PURPOSE:This article will provide you a complete d... Read More

SSHing into Ubuntu EC2 instance post blocking port 22 with UFW - Cloud Computing

IntroductionThis blog is in reference to a troubleshooting situation in Amazon Web Services when you have configured firewall setting in your ubuntu ec2 or remote instance and is not able to login via PuTTY through SSH as the instance. Here, we will see how to insert SSH into the instance in a certain situation when you are logged out of that instance.During configuration of SSL security, we may accidentally or purposely block SSH for the instance to make the instance secure. But, what if we again want the same instance to SSH for certain changes.  Below is the highlighted configuration of the instance. Here, you can see that all the instances have all ports opened to everything.Here are the configuration changes which you have made on the login into instance:$ sudo apt-get update $ sudo apt-get install nginx $ sudo apt-get install ufw  Check UFW Status and Rules At any time, you can check the status of UFW with this command:$ sudo ufw status verbose By default, UFW will be disabled so you should see something like this:Output: Status: inactive If UFW is active, the output will say that it's active, and it will list the rules that are set. For example, if the firewall is set to allow SSH (port 22) connections from anywhere, the output might look something like this:Output: Status: active Logging: on (low) Default: deny (incoming), allow (outgoing), disabled (routed) New profiles: skip To                         Action      From --                         ------      ---- 22/tcp                     ALLOW IN Anywhere $ sudo ufw deny ssh $ sudo ufw status verbose Output: Status: active Logging: on (low) Default: deny (incoming), allow (outgoing), disabled (routed) New profiles: skip To                         Action      From --                         ------      ---- 22/tcp                     DENY    Anywhere If you kicked or logged out of the instance once the changes are done, you will be seeing the below results.On SSH into the instance with your Public DNS through PuTTY below are the results which you are seeing as an error i.e. Network error: Connection Timed Out  Below error shows that even after all ports were opened outside, the instance is not able to SSH because of firewall software of Ubuntu at the system level. Let’s see how to resolve this kind of system related issue.Solution to the issue:Step 1: Take an image of the EC2 instance by selecting the instance ->Image-Create ImageStep 2: Provide specification Image name, tick on no reboot and push the create image buttonStep 3: Then Select the image and click on launchStep 4: Go to instance type, select and click on NextStep 5: In the configuration instance, write the below commands under Advanced Details and click on next:#!/bin/bash sudo ufw allow ssh sudo ufw allow 22 sudo ufw allow 443 sudo ufw allow 8080 sudo ufw allow 80 sudo ufw status  sudo ufw enable Step 6: Click next and next tab and add security group similar as providedStep 7: Review and launch the instance and then try to SSH to the instance through PuTTY. You will be now able to add SSH inside the instance with this and you can terminate the old instance as the new instance with all the setup same as that of the old instance without any issue except the public IP and private IP change.Best Practices of Firewall Configuration & Port Blocking:Ensure that the Security Groups will allow a specific IP addresses which are within the VPN Range of the Environment.Use of NACL for allowing and blocking the IP addresses or subnets for a specific Port by using allow and deny rules. A network ACL contains a numbered list of rules that we evaluate in order, starting with the lowest numbered rule. This helps to determine whether traffic is allowed in or out of any subnet associated with the network ACL. The highest number that you can use for a rule is 32766. We recommend that you start by creating rules in increments (for example, increments of 10 or 100) so that you can insert new rules.Use of Bastion Host for accessing critical servers and environment is always a better option to increase the security of the system or environment. 
Rated 4.0/5 based on 3 customer reviews
SSHing into Ubuntu EC2 instance post blocking port...

IntroductionThis blog is in reference to a trouble... Read More

Useful links