This file contains 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
# Cluster management tools. | |
# See https://github.com/grampelberg/k8s-clusters for updates and documentation. | |
export CLUSTER_NAME ?= $(shell cat tmp/current 2>/dev/null || echo $$(whoami)-dev) | |
export MACHINE_TYPE ?= n1-standard-2 | |
export DISK_SIZE ?= 100 | |
export MAX_NODES ?= 10 | |
export NETWORK ?= dev | |
export PROJECT ?= foobar | |
export VERSION ?= latest |
This file contains 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 python3 | |
import io | |
import re | |
import subprocess | |
import sys | |
import uuid | |
from contextlib import contextmanager |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>com.openssh.ssh-agent-brew</string> | |
<key>ProgramArguments</key> | |
<array> |
This file contains 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 | |
# Take all the positional parameters ($*) and normalize them | |
# -ab1 becomes -a -b 1 or -b1 -a becomes -b 1 -a | |
# Note that the : after b means that it should have a value instead of | |
# just being the boolean flag that a is. | |
args=`getopt ab: $*` | |
# Rewrite ARGV with the output of getopt | |
set -- $args |
This file contains 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 | |
set -o errexit -o nounset -o pipefail | |
cfg="${HOME}/.oprc" | |
required_cfg=( | |
'OP_ADDRESS' | |
'OP_EMAIL' | |
'OP_ACCOUNT_KEY' |
This file contains 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
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) | |
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH)))) | |
include $(CURRENT_DIR)/.env | |
include $(CURRENT_DIR)/mk/dependency.mk | |
include$(CURRENT_DIR)/mk/other.mk | |
main: dependency-one other-two |
This file contains 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
SHELL := bash | |
.ONESHELL: | |
.SHELLFLAGS := -eu -o pipefail -c -x | |
.DELETE_ON_ERROR: | |
MAKEFLAGS += --warn-undefined-variables | |
MAKEFLAGS += --no-builtin-rules | |
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) | |
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH)))) |
This file contains 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
for ctx in west east; do | |
echo "Checking cluster: ${ctx} .........\n" | |
linkerd --context=${ctx} check || break | |
echo "-------------\n" | |
done |
This file contains 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
linkerd install \ | |
--identity-trust-anchors-file root.crt \ | |
--identity-issuer-certificate-file issuer.crt \ | |
--identity-issuer-key-file issuer.key \ | |
| tee \ | |
>(kubectl --context=west apply -f -) \ | |
>(kubectl --context=east apply -f -) |
This file contains 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
#!/bin/bash | |
set -o errexit -o nounset -o pipefail | |
function -h { | |
cat <<USAGE | |
USAGE: demo | |
USAGE | |
}; function --help { -h ;} # A nice way to handle -h and --help | |
export LC_ALL=en_US.UTF-8 # A locale that works consistently |
NewerOlder