Thursday, March 1, 2018

Building a working Kubernetes (k8s) reference implementations

I have been working with Kubernetes (k8s) off and on for about 2 years.   That being said, it's always been pretty topical and targeted to work that is going on.   Inevitably, I end up answering a bunch of the same questions over and over and building one-off samples.   Not very good of me if a say so myself 😳.

So, I figured I would take a step back and build a functioning application iteratively that uses most of the technology that I use on a daily basis.  However, I am approaching it as if I was going on the journey from scratch.   That way, if you follow it start to finish it should answer a lot of questions.

Part I -  Hello World
  1. A simple Hello World application using SpringBoot
  2. Dockerize said application using Maven
Part II - Basic Kube on AWS
  1. Install and configure k8s on AWS using kops
  2. Install and configure Jenkins on k8s
  3. CI/CD of Part I using Jenkins on Kube
Part III - Deployments
  1. Create a deployment with multiple services
    • REST Service
    • Local Cache (GemFire)
  2. Create a deployment of a backing database that #1 uses
Part IV - ConfigMaps (may move this up)
Part V - Ingress Routing

We shall see what else I want or need to tackle as this goes forward.



Thursday, November 8, 2012

AMQP?


Not going to spend a lot of time on this as there are a bunch of other resources out there that can provide a much deeper perspective on this than I can.  But, I do think its worthwhile to at least touch on why from my point of view.

When evaluating messaging systems, I consistently come across vendor specific implementations that aren't very portable.  One of my core philosophies is that nothing lasts for ever so you have to design for change.  Even if that change is 30 years down the road and some other schmuck is going to have to deal with it, its your responsibility as architect to at least think about how the transition will work and impact the business. Hopefully, you do much more than that and actually design and plan for it.  Wishful thinking I know but we can all dream.

As I was looking at a new messaging architecture, the aforementioned philosophy was forefront in my mind.  Not delving into the dirty details but this hadn't been a focus for previous revisions of our messaging systems so I as the new guy I was not going to repeat the sins of the past.  More importantly,   my role is to drive both technology and cultural changes so I must hold myself accountable to make decisions as I would expect others to make.  If not, credibility is out the window.

So, prefer open source, must be portable and must be extensible.  The choices just got really small really quick; DDS, OpenWire, Stomp and AMQP.

DDS

Data Distribution Service is a relatively new standard that is designed to address the distribution of data for real time systems.  DDS describes the protocol, message structure and component behavior.   Its not just a wire protocol.  It is built around the concept that systems publish data and other systems may have interest in that data.  Once an entity is published subscribers to that entity are notified of changes to that entity.  For event or state driven architectures that model fits very well. If you were designing system from scratch, you could model your system to fit these constructs.  However, many of us aren't that lucky. Secondly, there are very few implementations, although this isn't really a limiting factor.  The big issue is that with this architecture there really isn't a clear path forward to change it in the future.  

OpenWire

OpenWire is not really "open".  Its ActiveMQ's proprietary protocol that only works with ActiveMQ.  With that in mind, it wasn't a viable choice.

STOMP

Simple Text Oriented Messaging Protocol that used to provide a common protocol for non-heterorgenous messaging systems & clients to interact.   STOMP is client/server based protocol.  Clients can only be clients and servers can only be servers.   Its also a wrapper to a native API provided to the broker.  What this means is that there is no guarantee of behavioral characteristics of the broker itself.  Lastly, STOMP is not a standardized or ratified standard through a recognized body like OASIS or OMG, etc.

AMQP

Advanced Message Queueing Protocol is both wire level protocol and an interaction standard.   AMQP     is a binary protocol that is designed to be ubiquitous like HTTP, FTP, SSH etc.    In the AMQP model, there is no client or server but set of well defined interactions.  It defines the interaction between systems through routes and links.  Such that different AMQP providers could be linked together.  Lastly, AMQP is a ratified standard by the OAIS group so there is some level of governance over the standard. with input into leading technology and private sector companies.

Why AMQP?

It really boils down to a couple things.  From an implementation perspective, I work for a public company so at some point you need to have support.  AMQP has implementations supported by both RedHat and VMWare.  The other options were limited to either niche providers or small startups that don't have the breadth and influence.  AMQP is designed for high volume low latency financial systems, hmm... sound familiar.   AMQP is not a wrapper to something else or an add on like STOMP as such its a first class citizen in the architecture.  The specification outlines both the message protocol but how things are supposed to behave which is important developing a portable solution.  Lastly, the AMQP implementations out there are wickedly fast in comparison to everything else in the list but DDS.  There are host of other reasons but these were the biggies that drove my increased interest and many of the topics forthcoming.

So picked a standard now an implementation...

RabbitMQ versus Apache Qpid (RedHat MRG)

This was actually a pretty trivial selection, I know should have spent more time looking at the actual code.  Patterns in the brokers, clients, how systems details are implemented, etc.  Frankly, the bullets just didn't justify the extra work.  Might have been fun but we all have deadlines.  So, the basics were this.  RabbitMQ has very limited support C++ which is one of the core decision points, it was a conversation around we will support you on a custom basis, etc.  Custom but not comforting while Qpid is written in C++.  RabbitMQ has extended AMQP quite significantly whereas the C++ (there is a Java version as well) conforms much closer to the spec.  The implementation base in financial services had a much deeper penetration, so I wasn't treading new ground.   Qpid had a much larger community of developers and RedHat is a key member of the AMQP working group.   Lastly, we already had it as it is part of the RHEL distro or at least most of it.  So, the path to adoption by the operational folks is much easier.  

So, off I go into the R&D on how does this stuff work.  More to come.

What am I working on... deja vu

For the past year or so, I have been focusing on transforming our service and messaging technology.   Fortunately, I have been able to really role my sleeves up and dive deep into the technology.  Coming from my last company, this has been a welcome change.   At prior companies, technology evaluation meant lining up a group of vendors and picking the most compatible suitor.  In many instances, it felt like an arranged marriage where you really didn't know what you were getting into.  My current company has provided the opportunity to really understand the technology, its implications and how it fits the business goals.  As an architect, I couldn't be happier.   Okay, for the most part as there is always something to bitch about but all and all good.

In financial services, particularly around money movement and trading platforms, most things are done asynchronously.  Swipe your card at Wal-Mart, its asynchronous.  Go to the ATM for  some fast cash, its asynchronous.  Execute that trade on eTrade, its asynchronous.   Go to your nearest branch and deposit a check, clearly asynchronous.  In reality, most of us have a synchronous (request/reply) experience with our financial institutions but the implementation behind the experience is most likely asynchronous.  

With that in mind,  a lot of the focus is the messaging platforms that financial systems depend on.  How to scale, how to make them faster, how to make them more stable, etc.   The options have been around for a while in the likes of IBM MQ Series, TibcoRv, etc.  The main issue with these is that they are proprietary.  There is no common wire protocol, API or even a well defined interaction model.  As result, we all wrote wrappers to encapsulate the interaction or just dealt with it.   So, when posed with the same question in my new role, I ran back to mama per se.  However, the constraints were different. 

  • Strongly prefer Open Source
  • Cross language support; Java, C++, Python (No Cobol or Assembly!)
  • Extremely low latency
  • Flexible & extensible security model
  • Open interfaces & wire protocols
So, the usual suspects were drawn into the fray but a couple of new ones or not so new ones as well; ActiveMQ, RabbitMQ and Apache Qpid.  With different constraints, I was drawn to Apache Qpid which is where I have been spending a lot of my free R&D time.   

Funny part, I remember nearly this exact same conversation with Brian Stevens & Joe Ferrell at RedHat a few years back during an executive briefing.  So, guess its come full circle that I would be working on Qpid.  Or is it deja vu?

Back writing again

Been awhile since I had done any public writing, lots of presentations, internal documentation and work products but little in blogosphere.   Finally, found a subject that both interests and frustrates me enough to get going again.  My goal for this blog is to share experiences, solutions and opinions that others may find of interest.  If they don't fine, its also a good venue for me to vent and keep some public work products for future reference.