An Example Upgrade and Rollback of a Deployment image in Kubernetes
In this article, I’m going to show you how to bootstrap a local kubernetes cluster with a custom image, debug it, deploy a new image, then rollback to the old image.
In this article, I’m going to show you how to bootstrap a local kubernetes cluster with a custom image, debug it, deploy a new image, then rollback to the old image.
kind is a tool that spins up a kubernetes cluster of arbitrary size on your local machine. It is, in my experience, more lightweight than minikube, and also allows for a multi node setup.
Sample code associated with this post can be found on Github.
Rest Assured is a library that makes it easy to write api based automated tests in java. Recently I needed to find a way to record the latency of each request as well as some metadata about it [request path, method, things of that nature]. I found a nice way to do this with rest assured filters, and I’m going to share that with you in this article.
There is some [hacky] code for this post on Github.
The number of hystrix configuration options, as of this writing, is about 34. In reality, you don’t need to worry about most of them, as the defaults are perfectly reasonable. This article discusses those parameters that, in my experience, you typically need to pay attention to and tune, and I have provided some examples using spring boot’s support for hystrix via the javanica library.
You can see the source code for this post on Github.
Following up on the last post [ How to Expose Meaningful Prometheus Metrics In a Spring Boot 2.x Application], if we have metrics exposed but they don’t go anywhere, are there metrics exposed at all?
The source code for this post can be found on Github.
Prometheus is a metrics aggregator with its own presumed format. The basic idea is to have the application gather a set of custom metrics, then periodically collect (or “scrape”) the metrics and send them off to a prometheus server. This server will store the data in its database, and you can thus view the evolution of your application’s metrics over time.
The nginx map module is a nifty tool that allows you to programmatically change behavior based on things like http headers that come in.
Jasypt is a simple encryption library. You can use it to encrypt anything, but one good use case is just encrypting your application configuration directly in your config file, so that if someone obtained access to your source control directory or had a copy of your source code, they would not also have access to any of your secrets.
The source code for this post can be found on Github.
Kubernetes has democratized the cloud more than any piece of software before or since. What used to be proprietary APIs by AWS, Azure, or GCP for things like auto scaling groups, load balancers, or virtual machines is now abstracted away behind never ending yaml configuration. Combine this wonderful abstraction with the pricing model of Digital Ocean and you’ve got all the makings of a developer party.
The source code for this post can be found on Github.
Terraform lets you define your infrastructure, e.g. a virtual machine, in code. Used properly, this saves you a lot of time, makes infra easier to manage, and will generally limit your ability to do something dumb, like delete or modify something your infrastructure is dependent on.
Reactive Programming is a very different way of thinking about doing work in a microservices environment. Anyone who has worked with a GUI, dating back to even to windows forms, is familiar with the event based model, but what does that mean when there is unpredictable latency involved? How does handing off to a thread to make a remote call differ from this new “reactive web”?
Spring Boot’s WebFlux programming model is pretty neat, but there isn’t a lot by way of explaining how to best leverage it to get the results you need. I wrote this blog post after tinkering with the configuration of Reactor Netty on Spring Boot.