Fire up an interactive bash Pod within a Kubernetes cluster

In those cases where you need a throw-away interactive shell within your cluster:

$ kubectl run my-shell --rm -i --tty --image ubuntu -- bash

You may, of course, use a different image or shell. Some of the arguments explained:

  • my-shell: This ends up being the name of the Deployment that is created. Your pod name will typically be this plus a unique hash or ID at the end.
  • --rm: Delete any resources we've created once we detach. When you exit out of your session, this cleans up the Deployment and Pod.
  • -i/--tty: The combination of these two are what allows us to attach to an interactive session. 
  • --: Delimits the end of the kubectl run options from the positional arg (bash).
  • bash: Overrides the container's CMD. In this case, we want to launch bash as our container's command.

Note that you'll need to update your apt cache before you can install packages:

$ apt update
$ apt install cowsay

Once you are done with your tinkering:

$ exit

Post-exit, the Deployment and Pod that kubectl created will both be stopped and deleted, taking with it our container and anything we did within it.

Example Drone CI Kubernetes manifests

I've been evaluating Drone for CI at work, with the goal to get it running on Kubernetes. I figured I'd share some very preliminary manifests, for anyone who else may be tinkering. How to use these is outside of the scope of this article, but Google Container Engine is an easy way to get going.

Read on for some minimal Kubernetes manifests for Drone CI.

Read More

Where does Google Cloud fit in the IaaS market?

Where does Google Cloud fit in the IaaS market?

After spending the last five years working almost exclusively within the Amazon Web Services ecosystem, 2015 has been full of lots of Google Cloud (GC) work for me. This wasn't necessarily a conscious decision, but more a side effect of a new job.

After making the switch my initial impression was lukewarm. In many ways, Google Cloud is following in the footsteps of AWS, but trails by a substantial margin. It was difficult to anticipate what differentiating niche they'd carve out as recently as Q1 of 2015. Sure, Google was able to look at some of the mistakes AWS made and do slightly better. I just didn't see a lot that would make me recommend GC over AWS for general-purpose usage cases.

However, the last few months have brought some interesting developments that have brightened my outlook on Google Cloud's future. Read on to see the madness explained...

Read More