Skip to content

Instantly share code, notes, and snippets.

@digitalronin
digitalronin / notes.md
Created November 4, 2020 12:31
Connection timeout errors investigation

Theory: LB sends pods traffic after they've moved off a node

This would explain a few errors when the node recycler replaces a node which happens to have an ingress controller pod running on it.

Test

In a test cluster (3 worker nodes)

  • deploy a "hello world" ruby app
# frozen_string_literal: true
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "aws-sdk-route53", "~> 1.40"

Deploy a Golang web application to Heroku

The [Go programming language], often referred to as "golang", has a lot of well-deserved traction in the devops community. Many of the most popular tools such as [docker], [kubernetes], and [terraform] are written in go, but it can also be a great choice for building web applications and APIs.

In this post, I'm going to show you how to develop a simple web application in go, package it as a lightweight docker image, and deploy it to [Heroku].

Go Modules

I'm going to use go's built in module support for this article.

package main
cost_centers := [
"marketing",
"hr"
]
array_contains(arr, elem) {
arr[_] = elem
}
apiVersion: v1
kind: Namespace
metadata:
name: hello-world-test
annotations:
awesome-company/cost-center: non-existent-cost-center
package main
cost_centers := [
"marketing",
"hr"
]
array_contains(arr, elem) {
arr[_] = elem
}

Automated testing tools for Infrastructure as Code

In software development, automated testing has long been accepted as best practice.

Test-driven development (TDD) or behavior-driven development (BDD) approaches often go as far as writing tests for functionality before it is implemented, and continuous integration and continuous delivery (CI/CD) pipelines are commonplace, automatically running tests against your codebase whenever a change is pushed to version control.

Build a GraphQL-powered blog wth Dgraph and Slash GraphQL

In this article, I'm going to walk you through building a proof of concept blog powered by Slash GraphQL.

Graph databases are a fascinating way to model the information in a system where the relationships (edges) between pieces of data (nodes) are first-class entities of the system. This is a different approach to the more common relational database (RDBMS) model, where the relationships between records are implied. For example, "this user owns this post because `user.id ==

apiVersion: cert-manager.io/v1alpha3
kind: Certificate
metadata:
name: helloworld-dstest.live-1.cloud-platform.service.justice.gov.uk
namespace: dstest
spec:
secretName: dstest-ssl-cert
issuerRef:
name: letsencrypt-production
kind: ClusterIssuer
@digitalronin
digitalronin / git-nuclear
Created August 19, 2020 14:05
Abandon this working copy and get a fresh one
#!/bin/bash
# Erase the current working copy and start again from a fresh one.
# WARNING: Very destructive, with no undo.
REPO=$(basename $(git rev-parse --show-toplevel))
CHECKOUT_URL=$(cat .git/config | grep url | sed 's/.*= //')
cd ..