Showing posts with label cloud. Show all posts
Showing posts with label cloud. Show all posts

Wednesday, March 11, 2020

Infrastructure testing for Terraform with Clarity

DevOps Engineering is a reality. DevOps principles like Immutable Infrastructure, Infrastructure as Code, GitOps and Observability are the default building principles for any cloud computing serious initiative. However, Infrastructure, provisioning, automation it's not trivial, tools like Ansible and Terraform make the engineer's life easier, productivity and fun. As time goes by we have more and more infrastructure code, how we make sure we keep software rolling faster with stability and quality?  The answer is testing.  Infrastructure testing is a very tricky, mocking terraform it's not easy. There are some interesting solutions like LocalStackTestContainers, and molecule for Ansible. These tools are great but they are more towards Integration or E2E testing with are expensive, involve several other components and often super slow to run. A simple approach more towards unit testing could be achieved using Clarity.

Enter Clarity

Clarity is a BDD(Behavior Driven Development) framework for Terraform. Clarity is a simple, single binary written in Go. Clarity uses *gherkin* as syntax. Clarity has its own set of matchers and HCL
parser. Clarity has an extensive set of matchers like:

  • always equal
  • never equals
  • does not equal
  • is greater than
  • is less than
  • exists
  • occurs (at least, at most, exactly) x times

All the matchers can be used for Terraform attributes or even for terraform values. Clarity is great but you need to keep in mind that clarity will check for static values, it would get dynamic values, so it's a great tool to hook on your PR add-ons or even as part of your CI/CD/GitOps pipeline.

Sample Code & Usage

After downloading the binary, adding to the path and getting proper execution permissions you need to have the binary on the same folder as terraform files are located. So you do your terraform files(*.tf) as usual and them you create *.feature file where we will have our specs for testing. Then after having all that we can run the tests via console, i.g: clarity main.feature. Let's take a look at the following sample.


As you can see the syntax is pretty simple and straight forward you provide the attributes and the values you expect to have in your terraform files and clarity will check it for us. There is this interesting extension you can install for VSCode which will make your life easier.

Running clarity will output something as similar:


The complete sample is here in my github.

Cheers,
Diego Pacheco

Thursday, January 2, 2020

Amazon Builder Library: Review Notes

During AWS RE:Invent 2019 amazon release Amazon Builder's library. Which are world-class Distributed Systems, Engineering, Cloud-Architecture, DevOps class and lessons learned through experience on how to build reliable and scalable systems. The library is really great, some articles are a bit extensive like 30min read but they are really well crafted and provide great insight on amazon best practices. Today I want to share my review notes on the Library. I highly recommend you read the library. Amazon content has links with their products and also links to further readings in the sense of theory & tools. It took me a weekend to go through all the articles(13 so far) and this time was well invested I had lots of fun and learn a lot.



Review Notes

My Amazon Builder's Library Notes

Companion Deck



I hope you enjoy!

Cheers,
Diego Pacheco

Wednesday, January 1, 2020

Amazon Aurora: Papers Review

Amazon Aurora is a very interesting piece of engineering. I want to share my review notes on 2 papers related to amazon aurora. I was wondering for a long time, 2 years if I should start publishing my reviews or not. I do structure learning and study for a long time for more than 15+ years, however, I often take notes on the papers and videos I see in my Evernote. After 2 years of thinking I decided to share my papers review notes. I believe this decision will improve my learnings because I will write even more about the things I study and read and often do in my day-by-day work. I don't work at Amazon however I like amazon a lot, they are a reference for me in regards of SOA(Service Oriented Architecture), DevOps, Cloud, and NoSQL/NewSQL databases now, which aurora they proved to me that cloud-native database it's a real thing and its not BS marketing.

Papers

Engineers often dont read papers, which is a big mistake because they loose often Deep Dive tech content related to Algorithms, Datastructures, Techniques, and lessons learned. So If you are reading this, start reading papers. The 2 amazon papers I'm talking about are:

Amazon Aurora: On Avoiding Distributed Consensus for I/Os, Commits, and Membership Changes
https://dl.acm.org/doi/10.1145/3183713.3196937

Amazon Aurora: Design Considerations for High Throughput Cloud-Native Relational Databases
https://www.allthingsdistributed.com/files/p1041-verbitski.pdf

I highly recommend you read the papers if you want to learn more about cloud-native databases.

Reviews

Amazon Aurora: On Avoiding Distributed Consensus for I/Os, Commits, and Membership Changes
https://github.com/diegopacheco/notes/blob/master/paper_reviews/aws_aurora/diegopacheco_paper_review_Amazon_Aurora_On_Avoiding_Distributed_Consensus_for_IOs_Commits_and_Membership_Changes.pdf

Amazon Aurora: Design Considerations for High Throughput Cloud-Native Relational Databases
https://github.com/diegopacheco/notes/blob/master/paper_reviews/aws_aurora/diegopacheco_paper_review_Amazon_Aurora_Design_Considerations_for_High_Throughput_CloudNative_RelationalDatabases.pdf.pdf

I hope you enjoy it. More to come.

Cheers,
Diego Pacheco

Saturday, April 20, 2019

Reflections on Serverless:From SOA to Serverless part 3

This is the 3rd part and last one on the series: Reflections on Serverless from SOA to Serverless. On the previous parts 1 and 2 I was explaining how software architecture evolved in several movements and how much we need to change our mindset in the sense of Culture, Movements, and Experiments. Our tools are changing pretty quickly and multi/poly cloud will be soon a reality for most companies. Even if so few companies have this problem in sense of availability and active-active global biz, most of the companies can benefit from multi-poly cloud in sense of getting lock in free from cloud vendors, cost reduction for better and multi offerings, better solutions for specific problems and much much more.

The Deep Dive

For this last post, I want to cover more details around specific issues and promises around Serverless per se. At the end of the post, you will have access to a slide deck with more information and structure in a more fluid and clean way :D

Mind the Lock-in

Remember STATE is not part of serverless and you need to use state someplace else, so serverless could be a potential accelerator for cloud usage, therefore, you could get lock in pretty fast. There are solutions for that like - using open standards, open APIs, there we go on the SOA path again.

Cold Bootstrap 

We need to realize that Serverless has issues like Startup time(also know as cold bootstrap). This problem will be fixed soon and there are ways we can deal with the thios problem right now. So the first thing we need to know and mind startup times for all major serverless providers(aws, Google, and Azure). Secondly, we can use fast startup times in languages like Rust and Go. If you work with java you can use GraalVM and Kubernetes based serverless in order to fix this problem.

Do not use Serverless(FaaS) for

This does not mean you cannot do it but it means actually that this is not the best FIT:

  • High-frequency trading or extremely low latency applications. 
  • Large-Scale in memory Statefull solutions(could be done with Serverless if state if out)
  • Long-running stateful jobs(could be done with Serverless if state if out)

Serverless and FaaS: 2 Different Things

Serverless is a NoOPS cloud billing model where you may use or maybe not use FaaS(Function as a Service) abstraction, model. We can see Aurora for instance in AWS. Where you have a Serverless DB without any new abstraction model for programming, you actually can still use MySQL and PostgreSQL APIs.  FaaS is about runtime abstraction at least until the last google next 19. Now Google is offering a Serverless(with Docker) where you can control the language runtime - called Google Cloud Run.  Google Cloud runs with KVM and gVisor at a low level.

Portability with Serverless

There is a spec called cloudevents -  Which is supported by Azure in production already and allow you to have multi-cloud serverless(Faas) solutions talking to each other without lock-in. This spec still is in the early days but is getting traction as the time pass.

The Deck



Serverless is the future and it's here. We need to keep in mind that Serverless and FaaS are different things and that cloud(single, multi, poly) billing models are changing and we will need to adapt our solutions and thinking. Serverless might become the default model on the cloud. We need re-think our solutions and get ahead in order to take full benefit from the multi-poly cloud world. Serverless makes more sense now them ever.

Cheers,
Diego Pacheco

Tuesday, March 5, 2019

Reflections on Serverless:From SOA to Serverless part 1

New technology is great. It's very important to open space for new ideas, better solutions, cheaper, faster and exciting new things. However, even with technology, there are principles and lessons learned with previous technologies we need to carry on otherwise we will keep making the same mistakes and we might not take full advantage of new tech. Why? Because often new tech requires a new way of things and often times also require to keep some things from the previous movements. Companies want to do Serverless now a day, often because cloud vendors are pushing that hard and because of the short term cost benefit. However, in the long run, Serverless solutions might be way more expensive than in-house solutions using OSS. There is no silver bullet, you need to understand what you are doing in order to take full benefit from new approaches, techs, and ideas rather than just moving everything from on-trend to another.  I want to share some thoughts from several architecture models and principles that was evolving from SOA to Apis to Microservices to Cloud-Native Microservices to Serverless.  For instance, Serverless is going forward following some SOA Principles, did you know? For this blog post, I will provide a set of explanations on my view of the architecture evolution and at the end of the post you will have access to a 40min video, explaining some ideas on the post but with a video.

From SOA to Serverless

SOA is not about technology(SOA is not about ESB), SOA is about principles, these principles are alive nowadays more than you can imagine.




SOA was the foundations of everything. SOA is about abstractions(contract) and the big picture(Service Orientation - SO), seeing the whole system spectrum and it should not be used or a simple Service alone or single project alone. One of the main benefits of SOA is the Backward compatibility(BC) approach. Soa is not a specific technology neither just an ESB.


 
Microservices are a kind of SOA with 2 different aspects. First of all the granularity which is smaller than SOA, SOA never gave a prescription on who granular a service might be but in my experience often was quite big. Seconds Microservices are about isolation. In other words, having they dedicated OS, Servers, Git repository, Build the pipeline, and so on and on. Microservices requires lots of DevOps work. Microservices are not the silver bullet there are problem domains where it does not make sense to have small granularity and therefore this could lead to bad design and coupling. It's very important to talk about SOA in Microservices and Serverless context because these architecture models evolve from one to another and if you just see Serverless as a self-contained thing (meaning: not learning from SOA and Microservices) you most likely will be doing it wrong.

Microservices required DevOps Engineering. When we are doing microservices on the cloud, we can use most of the benefits from the cloud by doing cloud-native microservices which you can be done by using NetflixOSS / Spring Boot Stacks or nowadays you can use Kubernetes with Istio.

What is Serverless?

FaaS and Serverless are different things. Often people think Serverless is about FaaS only. Often Serverless is related to FaaS. However you most likely to have Serverless when you are doing FaaS but you might be doing Serverless and have no FaaS. Because Serverless is a cloud model, where often the cloud provider takes care of the operation for you. This is the case for Managed Services for Databases like Aurora but also for other engines like Kafka, MongoDB and much more.  FaaS(which was called microservices for a brief moment - for some people) is the evolution of microservices, however, FaaS is Event driven and microservices can be Event driven but also can be RPC.

Serverless and Kubernetes



Kubenetes is the cloud multi-cloud / poly-cloud way to go. Ks is the open source / open standard cloud spec, which means, you can use cloud without getting locked-in by a cloud vendor. Kubernetes allow you to run all kinds o workloads from RPC, Analytics / Batch / Streaming, Machine Learning Training and also Serverless. The cool thing about running Serverless in kubernetes is the fact that is all portable, not only the code running in Serverless but also the whole infrastructure which is great. Somewhere in the future cloud should be about COST them being able to move things around is better not only for better usage of cloud reservation but also for strategic negotiations.

Serverless Require less DevOps work, it does not mean you can do NoOPS. It means you have less DevOps / Ops work. You still need to automate the deploy of your functions(in case you are doing Serverless with Faas), if you think about CloudSQL or RDS you will have more things to automate. Serverless end up has less moving pieces from you and more pieces for the cloud provider whoever is providing the Service.

There is an open spec for Serverless called *Cloud Events*. Cloud events describe the events(inputs, outputs) in a standard way. Does this sound like an SOA Contract? Yes. We also see the same willing to have portability like we saw in SOA Manifesto. IF you don't think this is the future you don't need to take my word from granting take Kelseys.

Video

Next, you will see a brief story about the evolution of Service architectures, starting from SOA and getting into Serverless on Kuberntes. You also will see some benefits and trade-offs of each wave of technology evolution.

Reflections on Serverless from Diego Pacheco on Vimeo.


Slides



Doing Serverless without Kubernetes is a recipe for Lock In. Serverless need to embrace SOA values like Open Standards, Contracts(Cloud Events) and API Versioning / Backward Compatibility features otherwise your system will continue to break and you might take full advantage of Serverless.

Cheers,
Diego Pacheco

Sunday, March 3, 2019

Kubernetes Everywhere with k3s

Kubernetes is becoming the truly cloud-native specification for the cloud. However not all software runs on the cloud, there are other uses cases like embedded software(IoT and microcontrollers) besides IoT there is another kind of computation that is growing more a more nowadays called Edge, thanks to the low latency and facility capabilities. Would be great run the same infrastructure for the edge/IoT as we do for the cloud? Well, rancher folks addressed that with k3s. A super lightweight kubernetes distribution where they replace things and remove features instead of adding, This is great not only for the IoT/Edge uses cases but also for folks who study the cluster in the academia and for the developers in 2 fronts. First on the CI/CD front, so we can spin up a lightweight cluster to run all kinds of tests, this also has a perfect fit with GitOPS model.

Another developer use case is the local machine scenario. For developer is very important to have a set of lightweight solutions, so they can run on the local machines this is important for a lot of reasons like:

  • A sandbox to play and do experiments
  • Learn effectively
  • Debug and Troubleshoot
  • Simulate some kinds of bugs in order to add tests

Not all scenarios can be covered with the local environment and that does not kill the need to have a cloud environment for development. However, this is a powerful tool for the developer and speeds up things a lot. 

Running k3s Locally

k3s is super lightweight and super fast. The solutions are pretty new but have lots of potentials. There are some limitations in k3s like there is no ALPHA specs support.

Running the Server



















Echo App Spec



Get Pods







Running a service in kubernetes using k3s

















cheers,
Diego Pacheco

Thursday, February 14, 2019

Istio & Kubernetes: Developer Productivity and freedom to deliver your OKRs

Innovation is a must have for companies today and work with the product mindset. Given the digital transformation, we live in, having a product mindset is more than delivering software but it is empowering teams and working with OKR-based management models that focus on Business Objectives rather than what teams have to do.

Development teams are motivated by challenges and they should have the freedom to make choices. But these choices can often have a very high cost for the business and low return. Cloud usage is certainly a great disruptive force for all digital businesses. 

There are many ways to architect Cloud-Native solutions (get the most out of cloud) often for a short-term view many companies are opting for Managed Services solution. These solutions, which are often database solutions, but not limited to the database, give a lot of speed for software development but bring two major problems in the long run.




Managed Services Issue 1 - Cloud Vendor Lock-in

When using managed services there is a cost reduction and bottleneck of DevOps, which is a difficult skill set to hire. However, when using managed services proprietary APIs, you are certainly thinking that you are taking a lot of value out of your cloud vendor, based on usage. Using 100% of a service does not mean better value for the business. In the long term it costs more but often these decisions are taken by lack of software architecture knowledge to support in making the best technical decision.

Managed Services Issue 2 - Cost

Increasingly there are more and more cloud providers and the cost is more and more a central issue not just for software architecture but for the business as well. It is necessary to have solutions that are COST-EFFECTIVE but often this math is made only considering the initial cost of OPS that the cloud provider absorbs. But in the long run, it is much cheaper to run this kind of solution on Compute layers than to run as a managed service. However, when using computer solution many times it is necessary to perform many integrations and development of cloud-native architectures to enable digital products. Soon this equation becomes complex and once again it is common for companies to tend to managed services for cost reduction and simplicity of execution even if this sacrifices portability in the long run.

Istio & Kubernetes: Changing the Rules of the Game

The Market changes fast, nowadays we no longer need to choose between productivity, low initial cost, and profitability because with Kubernetes and Istio we can have the 3. That same we can have the maximum of productivity giving total freedom for the technical teams, low cost of ramp up and still be portable to work multi/poly cloud solution.

With Kubernetes and Istio it is possible to develop microservices in a disconnected form of any cloud provider. Because Kubernetes in conjunction with Istio and Envoy (Lyft's open source proxy solution - Uber Concurrent Us) uses the kubernetes abstraction translation service for the cloud provider. That way your solution is not stuck with any specific cloud vendor.

There are solutions to create, run, update, maintain and destroy kubernetes clusters of in multiple clouds like AWS (Amazon) and GCP (Google) like Kops. Kops is an open source software that does all this for us still being able to generate Terraform templates for the translation of specific solutions from Google's cloud(GCP) or AWS. For example, in Kubernetes there is the concept of gateway that is used for transfer data and with Kops, this concept will be translated into an Elastic Load Balancer (ELB) in AWS for example.

Why Use Istio?

Istio allows the developer to use any language and any server. There is no such thing as a binary coupling as there was in the NetflixOSS Stack that forced the use of Java and a series of intrusive dependencies in the classpath. With Istio we have the same abstractions that exist in the NetflixOSS Stack but at the platform level, thus leaving the very productive developer and much more focused on business, digital products, without losing all the benefits of a cloud-native architecture.

Business Benefits

By using Kubernetes and Istio the business can deliver digital products with extreme productivity and at the same time not be locked-in by cloud vendors. So in the future, if the business realizes it more economically viable to migrate to another cloud-provider this is possible in a transparent way. In addition, it is less sensitive to the cloud provider's cost variations and has the strategic freedom to go where it makes more sense and has the best cost.

There is another great benefit that is in the motivation part of the technical team that helps keep the professionals motivated and the turn-over low because that way the technical team can try out new servers, new languages independently and delivering value to the business. Engineers are motivated by challenges and new technologies, often tied systems do not allow experimentation what is bad for the motivation of the technical team as well as experimenting with new technologies to solve problems and create new business models. With istio, everyone wins.

For the Devops Team

Creating digital Stacks in the cloud is not a simple task and is expensive. Often the Devops team is under-resourced and cannot keep up with internal demand. The solution to this problem lies in, building and releasing tools for the developers to be more productive. Building self-service tools and services and thus freeing the Devops team to focus on improving tools and availability of digital products.

Solutions such as Kubernetes, Kops, and Istio help to remove a lot of manual work from the business engineer and thus deliver a high-profit stack to the business with little effort. Istio provides a complete solution with Observability (Logs, Metrics, Traces) of the entire Kubernetes stack.

For Developers

In addition to being able to use any language at the end of the day is not bound to the decisions that come from above and is free to reach the OKRs in the best way they understand besides having the possibility to experiment new technologies of easy integration to the stack of existing services. Another advantage is that with the setup time fast and complete isolation is very simple to have more environments and debottleneck platforms teams to release components.

Kubernetes and Istio have great potential and this is just the beginning of the journey. If you are doing digital transformation or starting a new project you need to consider this solution as it has many advantages compared to previous approaches of First Wave of Microservices with Stack of NetflixOSS, ManagedServices using proprietary APIs of cloud providers. We are actually talking about something that is "Game Changing" for the business and for the technical teams.

Cheers,

Diego Pacheco

Monday, February 11, 2019

Running Istio on EKS

Besides all network overhead, Istio offers very interesting trade-off for sacrificing latency and network overhead for developer productivity and stack independence. In previous posts, I blogged a lot about kubernetes, Istio, Aws, Kops, Eksctl and EKS. Today I will show how to run Istio in AWS using EKS. Keep in mind EKS don't support Alpha* Specs right now(v1,v2 or v3) so some demos from the istio best selection of slideware won't work. But is possible to have istio installed and booking app running.




Running Istio in AWS with EKS and eksctl



Cheers,
Diego Pacheco

Wednesday, February 6, 2019

Running k8s on EKS

EKS is the new AWS managed Service for Kubernetes launched at last Re-Invent 2018.  EKS is not available in all regions right now. EKS an option for those who don't want to use KOPS.  For this blog post, I will show how to easily set up a kubernetes cluster in AWS using EKS.  EKS has some benefits, first of all, is a managed service that you are not locked in since the API is kubernetes based so you can easily migrate to other kubernetes installation or even other kubernetes installation in other cloud vendor or on-premises.




EKS Benefits
  • Managed Service without lock-in (Kubernetes API, specs, kubectl)
  • There is no Control Plane management (Multi-AZ, Automatic patches, and updates)
  • Secure by Default (Secure and encrypted communications between worker nodes and master)
  • Conformant and Compatible (EKS runs certified kubernetes. Compatible with standard k8s envs)
IMHO this is what most of the companies are looking for, in other words, *Serverless*. 

The Pain Points

I don't want to paint a rosy picture of EKS like any new technology there are problems such as:
  • Poor Documentation - very few docs
  • Lack of Observability - It's a kind of black blocks compared with Kops.
  • When you do something wrong and har to figure it what you did it wrong.
  • Error-Prone - Is very easy to make mistakes(eksctl fix that)
  • In a Long Run is more expensive than running on EC2 with Kops
  • Alpha APIS is not supported. 
It's important to keep in mind that EKS is a very new service and it should get better and the time passes. 

Running Kubernetes in EKS using EKSCTL

EKSCTL is a great tool. Written in go, makes eks cluster creatin way less error-prone and many simples to get a cluster up and running. So let's get started! Basically, we will install the AWS Authenticator and EKSCTL them we can create the cluster and deploy nginx in kubernetes after that we can access the nginx application in the browser(before that you will need to enable the SG access for your IP). Them we destroy the cluster.


Creating a cluster














 Deploying nginx in Kubernetes












Nginx up and running on AWS(Need to enable 80 port SG access)

















Nginx AWS ELB Created by EKS and K8s with EKSCTL



 K8s Nodes Running on EC2 via EKS and EKSCTL





















Destroying the cluster







Cheers,
Diego Pacheco

Tuesday, February 5, 2019

Running Istio on AWS with Kops

In previous posts, I show how to run Istio in Minikube and with Docker-Compose/Consul in local env, today I will show how to run on AWS using KOPS.

This installation is Linux based(Ubuntu), I'm running all commands from my local-desktop, if you don't use Linux(shame on you) you can create a virtual-machine on AWS with ubuntu and run this commands there, also is possible to run Vagrant with Linux and them run this commands on Vagrant box as well. Istio runs smoothly in AWS with Kops. You don't need much, pretty much 3 machines(1 master node, 2 minions).  Keep in mind this is not a production-grade setup, for production, you should be running with 3 masters at least for High Availability.




Installing and Running Istio with Kops



Master and Worker nodes on AWS EC2 Console










Istio Metrics in Grafana

















Jaeger - Distributed Tracing






















Kiali - Observability

















BookInfo ServiceMesh (4 microservices) running on Istio / Kubernetes in AWS

Prometheus(Cloud-Native Observability) - Metrics, Dashboards, and Alerts 

















ServiceGraph























That's it - I hope you enjoyed.

Cheers,
Diego Pacheco

Running Kubernetes on AWS with KOPS

Kops is the best way to have Kubernetes running in AWS. Kops allow us to install kubernetes in EC2. Kops is written in Go. Kops helps us to create, update, maintain and destroy kubernetes clusters on aws. Kops also supports GCP(Google Could Platform). Kops has some interesting ability to generate terraform files if that's your you thing :-).  For this blog post, we will be using AWS ELB as DNS so we won't be using public DNS records which are done by setting carefully the name of the cluster - which need to end with .k8s.local. Right now is way faster to spin up a kubernetes cluster with Kops rather than EKS.



Installing and running Kubernetes in AWS with KOPS



Cheers,
Diego Pacheco

Monday, February 4, 2019

Getting Started with Istio and Minikube

Istio is the new standard for microservices in Kubernetes. Around 2014 Netflix defined before everybody else how to do proper microservices using they brand new stack called NetflixOSS. Introducing game-changing concepts for the Cloud Native microservice components such as Mid-tier load balancing, fault tolerance, circuit breaking, retry/timeouts, service registry and discoverability and much more. NetflixOSS was super important and still is in the cloud-native microservices world. Today the great majority of companies who do Java development use



NetflixOSS Stack directly or via Spring Cloud Abstractions. IMHO the main benefit Spring Cloud added was documentation. Today several NetflixOSS components are deprecated or like how Netflix like to call it MANTAINCE_MODE you can check that in any NetflixOSS project on Github by looking the file OSSMETADATA. As you can see here Hystrix is in mantaince mode. One of the reasons is because there is a better way to deal with the problem, for Hystrix there are adaptive thresholds but also because the world is changing fast. Today in 2019 Kubernetes makes more sense them ever as becoming the true multi-poly cloud solution. Kubernetes with Istio(using Envoy) fix some of the problems of the NetflixOSS Stack such as being binary coupled and very hard to work without java. Today I will show a quick DEMO on how to run istio in Minikube(local env) and also a quick presentation on some k8s and istio concepts. Hoje you All enjoy.

Why Istio?

Basically, all that the NetflixOSS stack for microservices was doing was moved to the platform and outside of your classpath. So this means Kubernetes, Istio, and Envoy are doing all the heavy lifting for you. Also, you still have the same cloud-native game-changing capabilities but now you are free to use any language, any server, any architecture as long and you pack your image with Docker. This pattern introduces greater flexibility to the developer and you still benefit from kubernetes abstractions meaning your code easily run multi-cloud.
Istio Slide Deck



Istio Video presentation + DEMO



Installing Istio on Minikube(gist)

Thatś it guys. I will be posting more about Kubernetes and Istio soon. I hope you enjoy and take care.

cheers,
Diego Pacheco

Friday, September 29, 2017

Lessons Learned with DevOps Engineering Experiences

Lessons Learned with DevOps Engineering Experiences


Almost 20 years ago an Agile movement was born. After 20 years there are still lots of confusion and misunderstanding on principles, practices, and mindsets. DevOps barely have 10 years but does not have a method like a scrum, Kanban or XP. However, DevOps rely on Lean / Agile there is no strict definition, method or formal guidance how to do proper DevOps.  


Like everything in life, this is good and bad at same time. DevOps is a movement about experiences that made some for some companies and people in order to have or practice better ways to develop and operate the software. Currently, DevOps is a mess. DevOps is a mess is Brazil but is also a Mess in the USA. For lots of people, DevOps means Ops doing code. For other companies DevOps means Cloud Ops Team doing ops. There are DevOps folks from Development background like me and there are much more.


There is so much confusion on the market that you really need be careful to make sure you are talking about the same thing when you are talking about DevOps. The software is a pretty big industry when you stop to think about. It's very hard and unlikely to have someone that is good in all disciplines.


IMHO is easier to code for Developers but is hard to have developers worry about stability and availability. That's default on Ops, however, there are lots of folks that don't want to code or that will not learn proper design or software engineering. There are struggles on both sides.  I just give trying to define DevOps, since there are some many branches and at the end of the day it does not matter - what is matter is to get the job done and get better.


Here are some lessons learned in the last few years on my experiences working with DevOps Engineering.  This is my personal experiences and you might disagree and have different experiences. I'm not pitching for a specific flavor of DevOps or anything like that.


Self-Service the ultimate bottleneck killer


When we talk about scaling people often try to fix this problem with Process. That happened before and after agile, look Safe for instance. Lots of people(including myself) argue that culture is another important element when we talk about scaling something at corporate level.


What I think few people talk the-the role of Software Architect on Scaling people and teams. Is your software is coupled you end up doing lots of branches and merges and that's now how you can scale(add more people).


Speeding up thing depends on good, decoupled, modular architecture which several teams could mean SOA(Service Oriented Architecture) or Microservices(to be more precise nowadays). However that's not enough, that's only an enabler. We need build software that enables people to do things faster with you having to interact with other people. This is the very definition of Self Service to me. In order words, some kind of abstraction that gives you more productivity and reduce time. This also can be seen is simple automation. However is the automation is not done right it could be easily a pain(remember what happens with poorly designed and maintained software?).


So let's say you need to create users for someone in one of your tools. Let's say git for instance. The old way it would be open a Jira ticket and let people do some manual work and track people process every day to see how things are going, in other words, we are adding people so we are adding latency. The right way to do it it would be and a UI or chat interface where are developer or non-developer could self-service and create the user by himself using a software. This could be done in several ways like just using a simple Jenkins job or by using a provisioning tool like Ansible.


Observability is a must have


Telemetry is important but we need to go beyond the basics. Microservice is the standard the facto way to develop software currently. In other words, this means more distribution and more network calls. Failure is very normal in this context because:
  • Breaking change in any API
  • Timeout
  • Throttling
  • Bugs


How do we know what's going on? Observability is the path to understanding. However, this process of understanding what happens is not straightforward by any means. Metrics like CPU, Disk, Network and Memory and too much basic nowadays. This metrics might serve us well on monolith times however now we need more and we can do better. Observability means:
  • Having distributed logs - And lot important things
  • Know all your network calls - Zipkin, X-ray, and Jaeger can help you with that.
  • Control your thread pools
  • Cap / Limit everything - don't have unbounded queues
  • Have application metrics like Exception counters, latency percentiles, and specific business counters.


Beyond automation - Design Matters


It's not hard to find Ops guys coding today. Today everything become an API. Hardware is an API. Infrastructure became an API. The network is API. However, software engineering is not only about coding but is also about:
  • Configuration Management
  • Proper Naming
  • Design
  • Architecture
  • Testing
  • Data Structures
  • Algorithms
  • Abstractions


Automation can be tricky like any software. Is your automation solution proper designed and tested? Are you using something like Serverspec─? How easy is to create a new microservice in your pipeline how much code is required.


Automation is just one part of the problem. Don't get me wrong. Automation is hard and takes time to perfect it. However how much abstraction your automation provide? How easy is to change. This is important things because in the end of the day it's software.


Don't Build everything - Build X Buy


There are lots of gaps and space to create tools. Today there are way more tools than we had 3 years ago. As the time pass, we should have more and more open source solution for DevOps Engineering. However, there are some great tools you can leverage. I'm in favor of Open Source but also in favor of focus. Not all problems are interesting or deserve your energy, something is better to buy something and focus your energy on strategy problems. That decision is not simple and changes from company to company.


Build X Buy exercises are important and you should not consider always build neither always buy. Are you do a Build X Buy evaluation with requirements and Pocs you definitely will be in a better place to build is that's is what makes more sense.


Their software you build is like a Kid. It will become your responsibility and something makes more sense to use managed services or buy SaaS solutions and remove some of the burden and responsibilities. Again this really depends on your business and priorities but this is a trade-off that needs to be thought thoroughly.


Stability Mindset


Finally the last but not least. How is the developer experiences? How easy is to develop new things? How often things break? We can't avoid bugs and mistakes but we can reduce lots of issues having the right mindset.


This is hard. Especially for developers. We are not used to not break things. But as you get responsibility for the things you do this start to sounds right and normal after some time. This really change your way to see the code and make calls.


There are several ways to address the stability mindset when we talk about solutions. You can have ways to ISOLATE solutions and make easy ways to test, deploy and rollback code. You should do that however you always will have SHARED things that are not microservices and that is where things will get more tricky and fun I can say.  I do take retrospectives very seriously and every 30 days I do tech retrospectives with the teams I work and this is also a very important way to imprint things.  People tend to see retrospectives as a Managerial practice to talk about the product, people, attitudes, and feedbacks and that's fine however they are an important tool to review, asset and improve your tech solutions. You can read more on the Stability Mindset here.


Cheers,
Diego Pacheco

Dynomite Eureka Registry with Prana

Dynomite it's a great solution for clustering with NoSQL Databases like Redis. Eureka is a nice Registry & Discoverability Solution.

We can get best of both worlds using Prana. Prana is a sidecar that enables non-JVM applications to register in Eureka.

Sometimes we could easily use multiple discoverability solutions like DNS, ETCD, Eureka etc... However not all discoverability provide the same benefits some tools are better suited for some jobs them other. I like ETCD and make sense onKubernetes world but if you are doing Java Microservices eureka makes more sense.

The triad(Eureka, Prana, Dynomite) is great, This is great because then you can do discoverability on your database nodes, this is not great for several reasons like:
  • Use the same tool for Registry / Discoverability
  • Enable all sorts of dynamic programming which is great for DevOps Engineering
  • Avoid AWS Throttling issues
  • Make dyno clients more dynamic and this is a better solution them DNS like route53
I made a simple video with a simple presentation and live demo how to do this work on the server side with Dynomite 0.5.9. I hope you enjoy, have fun.


Slides from the presentation



Update: After talking with a Netflix Engineer, I got some new information about the state of Prana which can be found here. If you are using Dynomite-manager you should let DM do the Registry for you so there is no need to use Prana. For DM case you check this out. IF you are using Dynomite without DM you can still use Prana however you would consider DM in case you are running on AWS.

Cheers,
Diego Pacheco

Chuyên mục văn hoá giải trí của VnExpress

.

© 2017 www.blogthuthuatwin10.com

Tầng 5, Tòa nhà FPT Cầu Giấy, phố Duy Tân, Phường Dịch Vọng Hậu, Quận Cầu Giấy, Hà Nội
Email: nguyenanhtuan2401@gmail.com
Điện thoại: 0908 562 750 ext 4548; Liên hệ quảng cáo: 4567.