In our recent post on getting started with microservices and containers, Cloud Technology Partners VP and principal cloud architect Mike Kavis shared what might sound like good news: “It’s very easy to deploy a container.”
Of course, we’re just sound-biting what Kavis actually said: “The bottom line: Although it is very easy to deploy a container, much thought should be put into the operations of these systems.”
You could dive headlong into a production environment with containerized microservices, but most experts wouldn’t recommend it, especially if it’s your first go-around with this powerful pair of technologies.
There are considerable advantages to container-based microservices: As Red Hat technology evangelist Gordon Haff recently wrote, “Even Match.com couldn’t have found a better partner for microservices.” But making the most of that match made in IT heaven requires a strong, flexible plan for ongoing management of your containerized microservices architecture. There’s likely to be a learning curve in your organization, and you’ll want to implement smart best practices to ensure efficient operations over time.
[ Don't let common misunderstandings sabotage your efforts to get IT buy-in. Read 5 misconceptions about microservices. ]
“Everything becomes more complex after Day 1,” says Kong Yang, head geek at SolarWinds.
So we asked Yang, Kavis, and others for their best advice on effectively managing containerized microservices on Day 2 and beyond. Read on for what they had to say about doing containers and microservices right over the long haul.
1. Keep “KISS” top of mind
Want to keep things efficient and productive in the face of increasing complexity? Keep it simple, stupid. This design and engineering principle, generally credited to aeronautical and systems engineer Clarence “Kelly” Johnson, serves as an apt guide here, according to Yang.
KISS was as much a management philosophy as an engineering principle for Johnson, who once said of his Skunk Works division at Lockheed Martin: “Our aim is to get results cheaper, sooner, and better through application of common sense to tough problems. If it works, don’t fix it.” And of course: “Keep it simple, stupid – KISS – is our constant reminder.”
There’s a visible translation of those ideas for IT teams, especially with microservices and containers.
“To ensure operational success for Day 2 and beyond, apply the KISS principle. Microservices are loosely coupled, so keep them that way,” Yang says. “Let each microservice do one thing and do it terribly well. Don’t scope in additional features to existing microservices that are executing well.”
2. Put your management plan into place – early
Microservices and containers can enable faster, more agile, more flexible, and more responsive software teams. But first things first. “Have a plan before deploying to production,” Kavis advises. He shares an example framework for such a plan:
- Develop best practices in deployments, security, and operations
- Leverage modern logging and monitoring solutions for microservices and containers
- Explore container management tools (a.k.a. orchestration platforms, like Kubernetes) to gain visibility into your environment across cloud and non-cloud endpoints
- Practice blameless post-mortems regularly, to continuously learn and improve
3. Tap into an orchestration platform
Yes, we recently discussed orchestration platforms in our related article, Microservices and containers: 6 things to know at start time. It gets its due here as well, because orchestration – sometimes referred to as container management – will be crucial to your long-term success with containerized microservices.
“Each microservice needs to share its status with a management application. From there, decisions can be made about the lifecycle of microservices,” says Manuel Nedbal, CTO at ShieldX Networks. “For example, as soon as a microservice is not reporting in or is getting overloaded, it can be replaced with a new one or get replicated.”
4. Develop a minimum set of operational capabilities
A container management platform isn’t going to do all the work for you. Nic Grange, CTO at Retriever Communications, says that in addition to an orchestration system like Kubernetes, you need to ensure that each containerized microservice adheres to a “minimum set of operational capabilities” so that it works well within such an environment. He offers the following list of key examples of these table-stakes capabilities:
- The orchestration system will need to be able to access APIs on each microservice to determine whether it is ready to receive traffic [and] whether it is healthy or not.
- It will need a way to tell the microservice when to gracefully shut down.
- It will need the microservice to expose metrics and logging in a standard way.
- In most cases, the microservice will need to be able to be scale horizontally, and in some cases, it will need to be cluster-aware.
Grange also shares some good news for developers: Language-specific microservice template libraries like go-kit for Go and dropwizard for Java can save a lot of up-front work in developing these minimum capabilities.
“These make it easier for your developers to do the right thing as they will get a number of capabilities out of the box without having to write any or much code at all,” Grange says.
5. Implement continuous integration and continuous delivery
Continuous integration and continuous delivery practices can be a huge boon for the long-term management of container-based microservices, according to Kevin McGrath, senior CTO architect at Sungard Availability Services, especially as a bedrock that underpins your orchestration tool.
“Without CI/CD, the maintenance of microservices will become overburdened with manual processes, will fail to scale as intended, and will ultimately cost more than a monolith application in both infrastructure and human resources,” McGrath says.
Over time, CI/CD will help your team unlock the potential of an orchestration or management tool, especially when it comes to managing how CPUs, memory, and storage are allocated across a pool of hosts.
“Management systems are great once CI/CD is a natural part of the product life cycle, as they take care of ugly infrastructure requirements and present them as logical configuration parameters to the engineer,” McGrath explains. “For operations, it will eventually be necessary to have a holistic view of the hosts, containers, and services’ resource consumption to better see where more resources are necessary. This is most important when services are no longer tied to a specific infrastructure but to infrastructure requirements.”
6. Continuously revisit and reinvest in your operations
Containers and microservices are not set-it-and-forget-it technologies. To properly wield their power, you need to constantly reinvest in how you’re operating container-based microservices, advises Mac Browning, engineering manager at DigitalOcean. This advice may be applicable widely across your people, processes, and tools, but a good place to start – yep, you guessed it – is your orchestration platform.
“If you're investing fully and using an orchestration platform like Kubernetes, that means committing time and resources to keeping up with projects and updates, and reflecting those changes in your own deployments,” Browning says. “Since your microservices are now [running in] containers, this investment will have a positive impact across all the services that will be running, as opposed to one or two specific monolithic services.”