This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package manifest | |
import ( | |
"fmt" | |
"github.com/stretchr/objx" | |
) | |
// Manifest describes a single Kubernetes manifest. Manifests should only ever be | |
// constructed using the NewManifest method, to ensure the resource is well-formed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
_images+:: { | |
external_dns: "registry.opensource.zalan.do/teapot/external-dns:v0.5.17", | |
}, | |
_config+:: { | |
external_dns: { | |
namespace: "external-dns", | |
domain_filter: [ | |
"lawrjone.xyz", | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "logger" | |
require "values" | |
module App | |
module Logger | |
class ContextualLogger < Value.new(:logger, :context) | |
def log(**kwargs) | |
logger.info(context.merge(kwargs)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
λ (lab) ~> kl stolon-main-sentinel-backend-stolon-main-sentinel-78d4d597c2lsv -f | |
2019-05-16T02:57:57.750Z INFO cmd/sentinel.go:1962 sentinel uid {"uid": "f3e6c1b3"} | |
2019-05-16T02:57:57.850Z INFO cmd/sentinel.go:80 Trying to acquire sentinels leadership | |
2019-05-16T07:19:41.806Z ERROR cmd/sentinel.go:100 election loop error {"error": "lost watcher waiting for delete"} | |
2019-05-16T07:19:51.806Z INFO cmd/sentinel.go:80 Trying to acquire sentinels leadership | |
2019-05-16T07:25:43.371Z ERROR cmd/sentinel.go:1815 error retrieving cluster data {"error": "context deadline exceeded"} | |
SIGQUIT: quit | |
PC=0x45ae01 m=0 sigcode=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
all-databases() { | |
cd /tmp && sudo -u postgres psql -U pgbouncer pgbouncer -c 'show databases;' -p 6432 | grep -Po '^ gc_\S+' | |
} | |
disable-databases() { | |
xargs -n1 -I _DATABASE_ sudo -u postgres psql -U pgbouncer pgbouncer -p 6432 -c 'disable _DATABASE_;' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2.6.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"os" | |
"os/signal" | |
"sync" | |
"sync/atomic" | |
"syscall" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ACCESS_TOKEN="$(gcloud auth print-access-token)" | |
PROJECT="gc-prd-effc" | |
# Parameters | |
REGION="europe-west1" # "europe-west4" | |
DATABASE_VERSION="MYSQL_5_6" | |
DATABASE_TIER="D2" # "db-n1-standard-2" | |
CERTIFICATE_FILE="rds-ca-2015-root.pem" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
λ (lab) ~> aws route53 list-resource-record-sets --hosted-zone-id Z1B93ASNBC3G25 | |
{ | |
"ResourceRecordSets": [ | |
..., | |
{ | |
"Name": "something.directli.co.uk.", | |
"Type": "A", | |
"TTL": 300, | |
"ResourceRecords": [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"net/http" | |
"os" | |
kitlog "github.com/go-kit/kit/log" | |
"github.com/lawrencejones/theatre/pkg/signals" |