Skip to content

Instantly share code, notes, and snippets.

- task: Bash@3
name: AutoApprovalTest
displayName: Auto-Approval Test
inputs:
targetType: 'inline'
workingDirectory: $(System.DefaultWorkingDirectory)/$(tf_directory)
failOnStderr: true
script: |
# If no changes, no-op and don't continue
if terraform show plan.out | grep -q " 0 to add, 0 to change, 0 to destroy"; then
@angstwad
angstwad / signals.py
Created October 14, 2020 18:00
A simple script to catch any valid OS signals and simulate an action in response to a signal
import argparse
import functools
import logging
import os
import signal
import sys
import time
_LOG_FORMAT = "%(levelname)s:%(asctime)s:%(name)s:%(message)s"
logging.basicConfig(stream=sys.stdout, format=_LOG_FORMAT)

Upgrading Kubernetes Cluster with Kops, and Things to Watch Out For

Alright! I'd like to apologize for the inactivity for over a year. Very embarrassingly, I totally dropped the good habit. Anyways, today I'd like to share a not so advanced and much shorter walkthrough on how to upgrade Kubernetes with kops.

At Buffer, we host our own k8s (Kubernetes for short) cluster on AWS EC2 instances since we started our journey before AWS EKS. To do this effectively, we use kops. It's an amazing tool that manages pretty much all aspects of cluster management from creation, upgrade, updates and deletions. It never failed us.

How to start?

Okay, upgrading a cluster always makes people nervous, especially a production cluster. Trust me, I've been there! There is a saying, hope is not a strategy. So instead of hoping things will go smoothly, I always have bias that shit will hit the fan if you skip testing. Plus, good luck explaining to people

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active November 7, 2025 09:39
set -e, -u, -o, -x pipefail explanation
@salrashid123
salrashid123 / iamcredentials.py
Created July 1, 2018 18:52
GCP impersonation with IAMCredentials
#!/usr/bin/python
# https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials
import logging
import os
import sys
import json
import time
import pprint
@matthewpalmer
matthewpalmer / pod.yaml
Created June 9, 2018 21:23
Example Kubernetes YAML for the multi-container adapter design pattern
# Example YAML configuration for the adapter pattern.
# It defines a main application container which writes
# the current date and system usage information to a log file
# every five seconds.
# The adapter container reads what the application has written and
# reformats it into a structure that a hypothetical monitoring
# service requires.
@evantoli
evantoli / GitConfigHttpProxy.md
Last active November 2, 2025 09:57
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like: