Skip to content
View gist:ad267f92d93d8e5e0a8a9fbbe30681c0
aws route53 list-resource-record-sets --hosted-zone-id=/hostedzone/Z2KVJKNS01RHGO | jq -c '.ResourceRecordSets[] | select(.Name | contains("jenkins"))' | while read -r line; do
read NAME DNS_NAME HOSTED_ZONE_ID HEALTH <<<$(echo "$line" | jq -r '.Name + " " + .AliasTarget.DNSName + " " + .AliasTarget.HostedZoneId + " " + (.AliasTarget.EvaluateTargetHealth | tostring)');
CHANGE_BATCH=$(cat <<SETVAR
{
"Changes": [
{
"Action": "DELETE",
"ResourceRecordSet": {
"Name": "${NAME}",
"Type": "A",
View gist:232ed3d51a69128e79c295e96ee71042

The kubernetes cluster has nodes of m3.medium and only have a emphemeral storage capacity of 4gb.

This is easily utilized, and therefore need to increase the total size.

I've allocated the following so technically the LVM group could utilise the following. However its unclear how to automatically get it to expand the volume.

export MASTER_DISK_TYPE='gp2';
export MASTER_DISK_SIZE=250
View gist:d10a17e51ca808ca82733f8f307de297
function kubernetes::deployment::wait {
deployment=$1
ns=${2:-'default'};
k_cmd="kubectl --namespace=$ns get deployments $deployment";
while true; do
observed=$($k_cmd -o 'jsonpath={.status.observedGeneration}');
generated=$($k_cmd -o 'jsonpath={.metadata.Generation}');
[ "$?" -ne 0 ] && break;
[ "${observed}" -ge "${generated}" ] && {
updated_replicas=$($k_cmd -o 'jsonpath={.status.updatedReplicas}');
View ingress-pod
$ kubectl exec --tty -i nginx-ingress-controller-9xccu -- ls -alh --color
total 6.2M
drwxr-xr-x 46 root root 4.0K May 1 12:47 .
drwxr-xr-x 46 root root 4.0K May 1 12:47 ..
-rwxr-xr-x 1 root root 0 May 1 12:46 .dockerenv
-rwxr-xr-x 1 root root 0 May 1 12:46 .dockerinit
drwxr-xr-x 2 root root 4.0K Apr 28 00:50 bin
drwxr-xr-x 2 root root 4.0K Nov 27 13:59 boot
drwxr-xr-x 5 root root 380 May 1 12:46 dev
drwxr-xr-x 45 root root 4.0K May 1 12:46 etc
View example.py
import boto3
r53_client = boto3.client('route53')
hosted_zone = 'alias.photobox.com.'
def lambda_handler(event = {}, context = {}):
aws_region = event['detail']['awsRegion']
elb_client = boto3.client('elb', region_name=aws_region)
View bootstrap.sh
export KUBE_AWS_ZONE=eu-west-1c
export NUM_NODES=4
export MASTER_SIZE=m3.xlarge
export NODE_SIZE=m3.medium
export AWS_S3_REGION=eu-west-1
export AWS_S3_BUCKET=photobox-kubernetes-artifacts
export INSTANCE_PREFIX=k8s
export KUBERNETES_PROVIDER=aws;
export MULTIZONE=1;
export AWS_SSH_KEY=~/.ssh/photobox-eu
View index.js
'use strict';
console.log('Loading event');
var logGroupName = 'vpc-flow-logs',
region = 'eu-west-1';
var AWS = require('aws-sdk'),
Promise = require('bluebird'),
async = require('async'),
View gist:328055f3713eeeb2eb32
andrew@andrew-office:~/Desktop/projects/github/photobox/services-operations/aws/sparkleformation/cloudformation$ export KUBERNETES_PROVIDER=aws; wget -q -O - https://get.k8s.io | bash
Downloading kubernetes release v1.1.2 to /home/andrew/Desktop/projects/github/photobox/services-operations/aws/sparkleformation/cloudformation/kubernetes.tar.gz
--2015-12-01 15:40:33-- https://storage.googleapis.com/kubernetes-release/release/v1.1.2/kubernetes.tar.gz
Resolving storage.googleapis.com (storage.googleapis.com)... 64.233.184.128, 2a00:1450:400c:c0b::80
Connecting to storage.googleapis.com (storage.googleapis.com)|64.233.184.128|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 191474443 (183M) [application/x-tar]
Saving to: ‘kubernetes.tar.gz’
100%[======================================================================================================================================================================================================================================================
View create-elbs.sh
ELBS="`aws elb describe-load-balancers`";
echo "$ELBS" | jq -c '.LoadBalancerDescriptions[] | select(.LoadBalancerName|contains("production-services"))' | tr -d '^J' | while read line; do
NAME=$(echo $line | jq -r '.LoadBalancerName')
echo $NAME | grep tmp$ && continue;
LISTENERS=$(echo $line | jq -c '.ListenerDescriptions[].Listener'| tr -d '^J' | tr '\n' ',' | sed 's/^/\[/g;s/,$/]/g');
SCHEME=$(echo $line | jq -r '.Scheme')
aws elb create-load-balancer --load-balancer-name "${NAME}tmp" --listeners "${LISTENERS}" --scheme "${SCHEME}" --security-groups sg-3c7df658 --subnets subnet-f598ee9d
done;
View docker
9e38d6183e86 docker.photobox.com:443/photobox/services-shipping:v_182 "bash /run.sh" 32 hours ago Up 32 hours 8080-8081/tcp, 0.0.0.0:8096->8096/tcp ecs-production-services-shipping-15-production-services-shipping-9ca3c0e2b792879ce601
Something went wrong with that request. Please try again.