Skip to content

Instantly share code, notes, and snippets.

View JonJam's full-sized avatar

Jonathan Harrison JonJam

View GitHub Profile
@JonJam
JonJam / install-helm.sh
Created February 27, 2018 08:01
k8s infrastructure - install helm
#!/bin/bash
# Setting -e and -v as pert https://docs.travis-ci.com/user/customizing-the-build/#Implementing-Complex-Build-Steps
# -e: immediately exit if any command has a non-zero exit status
# -v: print all lines in the script before executing them
# -o: prevents errors in a pipeline from being masked
set -euo pipefail
# IFS new value is less likely to cause confusing bugs when looping arrays or arguments (e.g. $@)
IFS=$'\n\t'
@JonJam
JonJam / .travis.yml
Created February 27, 2018 08:06
k8s infrastructure - travis
before_install:
- echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
- sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893
- sudo apt-get -qq update
- sudo apt-get install -qq apt-transport-https
- sudo apt-get install -qq azure-cli
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
- chmod +x ./kubectl
- sudo mv ./kubectl /usr/local/bin/kubectl
- curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
@JonJam
JonJam / validate-rg.sh
Created February 27, 2018 08:17
k8s infrastructure - validate-rg.sh
#!/bin/bash
# Setting -e and -v as pert https://docs.travis-ci.com/user/customizing-the-build/#Implementing-Complex-Build-Steps
# -e: immediately exit if any command has a non-zero exit status
# -v: print all lines in the script before executing them
# -o: prevents errors in a pipeline from being masked
set -euo pipefail
# IFS new value is less likely to cause confusing bugs when looping arrays or arguments (e.g. $@)
IFS=$'\n\t'
@JonJam
JonJam / deploy.sh
Created February 27, 2018 08:22
k8s infrastructure - deploy.sh
#!/bin/bash
# Setting -e and -v as pert https://docs.travis-ci.com/user/customizing-the-build/#Implementing-Complex-Build-Steps
# -e: immediately exit if any command has a non-zero exit status
# -v: print all lines in the script before executing them
# -o: prevents errors in a pipeline from being masked
set -euo pipefail
# IFS new value is less likely to cause confusing bugs when looping arrays or arguments (e.g. $@)
IFS=$'\n\t'
@JonJam
JonJam / themeparks-bot-secret.yaml
Created March 6, 2018 09:07
k8s helm - secret
apiVersion: v1
kind: Secret
metadata:
name: {{ include "themeparks-bot.fullname" . }}
labels:
app: {{ include "themeparks-bot.name" . }}
chart: {{ include "themeparks-bot.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
@JonJam
JonJam / themeparks-bot-service.yaml
Created March 6, 2018 09:08
k8s helm - service
apiVersion: v1
kind: Service
metadata:
name: {{ include "themeparks-bot.fullname" . }}
labels:
app: {{ include "themeparks-bot.name" . }}
chart: {{ include "themeparks-bot.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
@JonJam
JonJam / themeparks-bot-ingress.yaml
Created March 6, 2018 09:08
k8s helm - ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ include "themeparks-bot.fullname" . }}
labels:
app: {{ include "themeparks-bot.name" . }}
chart: {{ include "themeparks-bot.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
@JonJam
JonJam / themeparks-bot-deployment.yaml
Created March 6, 2018 09:09
k8s helm - deployment
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ include "themeparks-bot.fullname" . }}
labels:
app: {{ include "themeparks-bot.name" . }}
chart: {{ include "themeparks-bot.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
@JonJam
JonJam / values.yaml
Created March 6, 2018 09:20
k8s helm - values
# replicaCount is the number of replicas for the themeparks-bot container.
replicaCount: 3
image:
# repository is the repository for the themeparks-bot container image.
repository: jonjam/themeparks-bot
# tag is the tag for the themeparks-bot container image.
tag: 0.0.1
# resources is the requests and limits for the themeparks-bot container.
@JonJam
JonJam / _helpers.tpl
Created March 7, 2018 08:33
k8s helm - _helpers
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "themeparks-bot.name" -}}
{{- .Chart.Name -}}
{{- end -}}
{{/*
Create a default fully qualified app name.