Category: Systems Admin

  • Golang and Docker Multi-Stage Build

    I have noticed a common pattern amonst some new utilities such as kubectl, kops and terraform: There’s only 1 single executable file to install, and by ‘install’ it can be put anywhere as long as it’s in $PATH. This was before I learned some Golang but it’s easy to find out that the reason behind…

  • Home VPN with OpenVPN

    Here are step to run a simple OpenVPN service at home, so that I can access home network easily while not at home. First, clone the git repo for OpenVPN docker container: git clone https://github.com/kylemanna/docker-openvpn.git I can use the pre-built docker image from docker hub but it has just been breached so I’d rather build…

  • Ansible, CloudFormation and Jinja2

    CloudFormation is the corner stone to provision infrastructure in AWS with code, however it’s not very DRY, ie. poor modularization, almost static variables and templates. So here comes Ansible. However at the moment Ansible’s CloudFormation module doesn’t support Jinja2 in templates, like other modules do. Luckily there’s a work-around to get the Ansible-CloudFormation-Jinja2 trio working…

  • Working with a Big Corporation

    So it’s been a while since I started this job in a big corporation. I always enjoy new challenges, now my wish got granted. Not in a very good way. The things work in a quite different manner here. There are big silos and layers between teams and departments, so the challenges here are not…

  • Nicer Deployment with Kubernetes

    The default strategy to do rolling update in a Kubernetes deployment is to reduce the capacity of current replica set and then add the capacity to the new replica set. This probably means total processing power for the app could be hindered a bit during the deployment. I’m a bit surprised to find that the…

  • Ansible, Packer and Configurations

    I use Ansible as provisioner for Packer, to build AMIs to be used as a base image of our development environment. When Ansible is used by Packer, it’s not quite intuitive whether it’s using the same ansible.cfg when I run ansible-playbook command in a terminal. Here’s how to make sure Ansible in Packer session will…

  • Don’t Panic When Kubernetes Master Failed

    It was business as usual when I was upgrading our Kubernetes cluster from 1.9.8 to 1.9.10, until it isn’t. From AWS console I can see the new instance for the master is running and the old one has been terminated. There’s 1 catch though, the IP yy.yy.yy.yy is not the IP of the new master…

  • Use Python to Check Difference between Directories Recursively

    I needed to track differences between software release packages, so that if anything changed dramatically, eg. some file missing or much smaller than expected, I can then get a notification to review the new potentially flawed package. I found that filecmp.dircmp class in Python is spot on for this job. Here’s my snippet to compare…