Skip to content

Instantly share code, notes, and snippets.

Everett Toews etoews

View GitHub Profile
View ca.crt
-----BEGIN CERTIFICATE-----
MIIDhDCCAmygAwIBAgIQNu0nhr9HM4pbXdU27a2hFTANBgkqhkiG9w0BAQsFADBc
MQkwBwYDVQQGEwAxCTAHBgNVBAgTADEJMAcGA1UEBxMAMQkwBwYDVQQREwAxETAP
BgNVBAoTCGJvb3RrdWJlMQkwBwYDVQQLEwAxEDAOBgNVBAMTB2t1YmUtY2EwHhcN
MTcxMTA2MTUxMzAxWhcNMjAxMTA1MTUxMzAxWjBcMQkwBwYDVQQGEwAxCTAHBgNV
BAgTADEJMAcGA1UEBxMAMQkwBwYDVQQREwAxETAPBgNVBAoTCGJvb3RrdWJlMQkw
BwYDVQQLEwAxEDAOBgNVBAMTB2t1YmUtY2EwggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQCuZf9T+FHGHoQSWMtLeYfFworEKercP1iOK4jK+JB3Suehu+aE
7cwGkTWDJfyuIV4jQ0hbKMvbMtTnjnWLHp3+TcoPjaHT8jDD8xLLY/sEU5E30dzc
GhB6JZrp+8OsqifhtMwq/DBE6oGDNkNKsZCh6Fqws+NmWWeAF6lDHECH3qTFmvoC
View app.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: app
data:
MYSQL_HOST: "db"
MYSQL_DATABASE: "auth"
MYSQL_USER: "app"
MYSQL_PASSWORD: "password"
MYSQL_ROOT_PASSWORD: "rootpassword"
@etoews
etoews / .gitignore
Last active Aug 27, 2017
Code for Inject an Executable Script into a Container in Kubernetes http://blog.phymata.com/2017/08/27/managing-env-vars-and-secrets-in-kubernetes/
View .gitignore
*
!.gitignore
!README.md
!template.sh
View deployment-first-crack.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ghost
labels:
role: blog
spec:
replicas: 1
template:
metadata:
@etoews
etoews / croc-hunter.sh
Created May 21, 2017
Rough notes on getting this "Zero to Kubernetes CI/CD in 5 minutes with Jenkins and Helm" demo https://www.youtube.com/watch?v=eMOzF_xAm7w running on MS Azure Container Service.
View croc-hunter.sh
# https://github.com/Microsoft/azure-docs/blob/master/articles/container-service/container-service-kubernetes-walkthrough.md
alias az="docker run --rm --volume ${HOME}:/root azuresdk/azure-cli-python az"
az login
RESOURCE_GROUP=kubernetes
LOCATION=southcentralus
DNS_PREFIX=phymata
CLUSTER_NAME=kubernetes
View Dockerfile
FROM alpine:3.5
COPY cat-etc-hosts.sh .
RUN chmod u+x cat-etc-hosts.sh
CMD ["./cat-etc-hosts.sh"]
@etoews
etoews / remote-diff.sh
Last active Apr 12, 2017
remote-diff: a bash function to diff a local file with a remote file
View remote-diff.sh
# Usage: remote-diff foo.yaml https://raw.githubusercontent.com/some-org/some-repo/master/foo.yaml
# Note: It ignores lines that begin with a '#' (comments)
function remote-diff()
{
FILE=${1}
FILENAME=$(basename ${FILE})
TMP_FILE="/tmp/${FILENAME}"
REMOTE_FILE=${2}
@etoews
etoews / prat.sh
Created Mar 31, 2017
prat: a bash function to rapidly submit a pull request
View prat.sh
# Usage: prat my-feature-branch "My commit (and pull request message)"
# Requirements: https://hub.github.com/
function prat()
{
BRANCH=${1:-}
MESSAGE=${2:-}
git diff
@etoews
etoews / .bash_profile
Created Mar 30, 2017
A PS1 with Docker context and Kubernetes context (including namespace)
View .bash_profile
PS1='(k:$(kubernetes-context) | d:$(docker-context "%s") | g:$(__git_ps1 "%s"))\n\W $ '
function docker-context()
{
if [ -z "$DOCKER_HOST" ]; then
printf "localhost"
else
local HOSTNAME_REGEX=".*//(.*):.*"
[[ $DOCKER_HOST =~ $HOSTNAME_REGEX ]]
printf ${BASH_REMATCH[1]}
View k8s-deployment-options.md
  1. kubeadm
  1. bootkube
  • https://github.com/kubernetes-incubator/bootkube
  • a helper tool for launching self-hosted Kubernetes clusters. when launched, bootkube will act as a temporary Kubernetes control-plane (api-server, scheduler, controller-manager), which operates long enough to bootstrap a replacement self-hosted control-plane.
  1. kops
You can’t perform that action at this time.