Preventing your Kubernetes volume from being deleted in GKE

The story This one caught off guard. I have this Kubernetes cluster I managed, and well, one day I was doing my thing. And I noticed that my laptop was low on resources, so I decided to clean things up. Cleared out a few namespaces and everything was good to go. Well, not 3 seconds later, someone pings on a chat channel that their dev environment is gone. Well…crap. I double-check my kubectl context, and yup, sure enough.
Read more

Terraform, Google Cloud, and Kubernetes working together

Here is the situation: I want a secret (let’s say a database password or any Kubernetes resource) stored inside a Kubernetes secret. The infrastructure is controlled by Terraform. So, how do I go about to keep those two things in sync? Well, recently I found out a neat pattern! You can connect Terraform with both GCP infrastructure, and Kubernetes at the same time, and you can keep them in sync! How do you say?
Read more

Step by Step: A simple Node.js, Docker, and Kubernetes setup

I’ve now been playing with Node.js, Docker, and Kubernetes for quite some time. And it just so happen that recently someone needed a good introduction to Node.js, Docker, and Kubernetes. However, after searching online I couldn’t find one that just had a few simple things to walk through. So, here this is. Hopefully this blog post will demonstrate how to create a simple Node.js, create a Docker container, demonstrate it running, then deploy that Docker container to a local Kubernetes setup.
Read more

Setting up a Docker container on a Container-Optimized OS running on the Google Cloud with Terraform

This blog post will expand on a previous blog post that sets up a Container-Optimized OS in Google Cloud. But instead of doing all the commands manually, here is what it would take to do this with Terraform. I won’t go into exactly what Terraform is or the benefits here. But I would highly recommend checking it out and using it to manage your cloud resources. This blog will focus on the Terraform file that would replicate the previous blog post functionality.
Read more

Setting up a Docker container on a Container-Optimized OS running on the Google Cloud

Wow, that title looks like a mouth full doesn’t it? So why do this? Isn’t there Kubernetes for running Docker containers? Well, sometimes I only need just one container running and I really don’t want to add the overhead of having to maintain another Kubernetes clusters. Lame excuse, but this works well for a small installation where I just don’t need the power of a full Kubernetes cluster. What exactly is a Container-Optimized OS (COS)?
Read more

Making Inspec with SSH work with Packer on the Google Cloud Platform

Background This blog post aims to help anyone trying to make a Packer image, tested with Inspec, on the Google Cloud Platform. I have recently been using the these tools for my day-to-day and I wanted to make these three tools work together, which was surprisingly difficult. This blog post will hopefully help anyone out there that may be trying todo the same. What I want from these tools is have Packer spin up a new VM, run all the build steps, then test that VM with Inspec.
Read more

Dockerize the Kotlin toolchain

Am I crazy? Yes, yes I am. For what ever reason, I love the idea of a project that I can literally move from computer to computer very few things installed and be able to be productive in that code base. By this, I mean I could install, one, maybe two tools and then I can be productive in a code base. Right now, Docker feels like maybe I can achieve this crazy dream.
Read more

Setting up a development workspace for Postgres and vault

My current line of work has led me to start getting into docker more and more. One of the neat things I’ve been getting to play with is using Postgres as my database and Vault for secrets management. I figured it was time to showcase what a basic development workspace looks like to help get someone up and running quickly. I’ve hopefully boiled this down into the smallest pieces needed to make things work.
Read more

Adding tests to Kotlin & JAX-RS (Jersey) project

I have a blog post about setting up a JAX-RS with Kotlin and one thing I neglected to show was how to test. So, let’s go back and fix this. For this, I will be using JUnit 5 for the test runner, AssertJ as the assertion library, and Mockito as the mocking framework. Let’s go over quickly what tests I’ve found valuable as I’ve created JAX-RS services. Well, in reality, there’s only two: one that exercises the HTTP interface (so, “integration test”) and one that tests the class and methods in isolation (so, “unit tests”).
Read more

Notes from experimenting with GraphQL and Kotlin

What is this GraphQL thing I have finally got time to try out GraphQL. I’ve been reading about it more and more and wanted to get a sense of how to build a data API with it. Now, if you don’t know what GraphQL is, here is my take on it. It is a way to create data APIs that allow clients to tell you what data they actually need. Instead of you trying to design up front all of your use cases and force clients to use that.
Read more