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
package main | |
import ( | |
"errors" | |
"flag" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" | |
"strconv" |
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
package main | |
import ( | |
"crypto/x509" | |
"encoding/pem" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"time" |
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
kns() { | |
local CTX=$(kubectl config current-context) | |
local NAMESPACE=${1} | |
if [[ -z $NAMESPACE ]]; then | |
local OPTIONS=$(kubectl get namespaces -o jsonpath='{range .items[*].metadata.name}{@}{"\n"}{end}') | |
OPTIONS+=' EXIT' | |
local NS=$(kubectl config view -o jsonpath="{.contexts[?(@.name=='$CTX')].context.namespace}") | |
if [[ -z $NS ]]; then | |
NS="default" |
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
kctx() { | |
local CLUSTER_NAME=${1} | |
if [[ -z $CLUSTER_NAME ]]; then | |
local OPTIONS=$(kubectl config get-contexts -o name) | |
OPTIONS+=' EXIT' | |
local CTX=$(kubectl config current-context) | |
local NS=$(kubectl config view -o jsonpath="{.contexts[?(@.name=='$CTX')].context.namespace}") | |
if [[ -z $NS ]]; then | |
NS="default" |
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
k3ctx() { | |
local CLUSTER_NAME=${1} | |
# Show the current context/namespace | |
local CTX=$(kubectl config current-context) | |
local NS=$(kubectl config view -o jsonpath="{.contexts[?(@.name=='$CTX')].context.namespace}") | |
if [[ -z $NS ]]; then | |
NS="default" | |
fi | |
echo "Current ctx/ns: $CTX/$NS" |
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
if [ -d /usr/local/etc/bash_completion.d/docker-compose.bash-completion ]; then | |
. /usr/local/etc/bash_completion.d/docker-compose.bash-completion | |
fi | |
if [ -x "$(command -v _docker_compose)" ]; then | |
echo "docker-compose bash completion not found" | |
else | |
complete -F _docker_compose denv | |
fi |
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/sh | |
ROOT_DIR=$(git rev-parse --show-toplevel) | |
[ $? -eq 0 ] && docker-compose --file "${ROOT_DIR}/env/docker-compose.yaml" --project-directory "${ROOT_DIR}/env" $@ |
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 -e | |
if [ -z "${GOPATH}" ]; then | |
echo "GOPATH not set" | |
exit 1 | |
fi | |
TUSK_VERSION=${1:-latest} | |
echo "Will install tusk version ${TUSK_VERSION} to ${GOPATH}/bin" |
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
[Unit] | |
Description=CoreDNS | |
Requires=docker.service | |
After=docker.service | |
ConditionPathExists=/etc/coredns/Corefile | |
[Service] | |
ExecStartPre=/bin/bash -c "/usr/bin/docker container inspect coredns 2> /dev/null || /usr/bin/docker run -d --name coredns -p 53:53/udp --restart unless-stopped -v /etc/coredns:/conf coredns/coredns:1.6.0 -conf /conf/Corefile" | |
ExecStart=/usr/bin/docker start -a coredns | |
ExecStop=/usr/bin/docker stop coredns |
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 | |
# Based on: | |
# https://withblue.ink/2019/07/13/yes-you-can-run-docker-on-raspbian.html | |
set -e | |
sudo su | |
# Install some required packages first | |
apt-get update | |
apt-get install -y \ |