Skip to content

Instantly share code, notes, and snippets.

@jsilberm
jsilberm / PX Stack Query
Last active February 1, 2017 21:13
Query IP Addrs from an AWS CF Stack
REGION=us-east-1
STACK_NAME="PX-STACK"
aws --region ${REGION} ec2 describe-instances --filters "Name=tag:aws:cloudformation:stack-name,Values=${STACK_NAME}" --query 'Reservations[*].Instances[*].{IP:PublicIpAddress,ID:InstanceId}' --output text
@jsilberm
jsilberm / mkloopdevs
Last active March 1, 2017 23:10
mkloopdevs
#!/bin/bash
HOSTS="147.75.196.115 147.75.196.93 147.75.64.85 147.75.196.117 147.75.196.101"
for i in $HOSTS
do
ssh core@$i sudo mknod -m660 /dev/dm6 b 7 18
ssh core@$i sudo touch /var/loop_device_file
ssh core@$i sudo truncate -s 64G /var/loop_device_file
ssh core@$i sudo losetup /dev/dm6 /var/loop_device_file
done
Kube-Master
----------
docker run --restart=always \
--name kube -d --net=host \
--privileged=true \
-v /run/docker/plugins:/run/docker/plugins \
-v /var/lib/osd:/var/lib/osd:shared \
-v /dev:/dev \
-v /etc/pwx:/etc/pwx \
-v /opt/pwx/bin:/export_bin:shared \
Clone Forked Repo
git clone https://..../repo.git
cd repo
git remote add upstream https://github.com/Azure/acs-engine.git
git remote -v
git fetch upstream
git checkout master
git merge upstream/master
git push origin
@jsilberm
jsilberm / mssql.yml
Last active July 19, 2017 20:24
MS SQL Server on Kubernetes with Portworx
##### Portworx storage class
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: px-mssql-sc
provisioner: kubernetes.io/portworx-volume
parameters:
repl: "3"
snap_interval: "70"
io_priority: "high"
@jsilberm
jsilberm / liquidweb.md
Last active August 2, 2017 13:22
mysql / wordpress stack on Portworx

Deploys a complete "Portworx-ready" Kubernetes cluster in GCP. Configurable elements:

  • Kubernetes version (default 1.7)
  • number of Minions (default 3)
  • volume size per minion (default 10GB)
  • machine type (default n1-standard-2 )
  • region (default us-central1)
  • region-zone (default us-central1-f)
@jsilberm
jsilberm / Restore MSSQL Adventureworks.md
Last active July 20, 2017 23:13
Restore instructions for AdventureWorks Database on Kubernetes

Copy Adventureworks to master

scp Adventureworks.bak to the master

Copy Into Container

POD=mssql-1121156913-8sms4
kubectl cp /root/AdventureWorks2016CTP3.bak $POD:/root/AdventureWorks2016CTP3.bak
#!/bin/bash
#
# Use this script to deploy an entire stack on Kubernetes:
# - etcd cluster
# - px daemonset
# - influxdb on pvc
# - Lighthouse
#
# Assumes running instance of Kubernetes 1.6 or above
#
@jsilberm
jsilberm / ready4px.py
Created August 9, 2017 05:33
Take a cluster that has been deployed through Tectonic, and make it ready to run/deploy Portworx
#!/usr/bin/env python3.6
#
# ready4px: Take a cluster that has been deployed through Tectonic,
# and make it ready to run/deploy Portworx
#
# Inputs:
# Environment:
# CLUSTER : Corresponds to CLUSTER from Tectonic
# AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID, AWS_REGION : Amazon credentials and region
#!/usr/local/bin/python3.6
"""
pxify-gke:
This program takes an existing GKE cluster and makes it "Portworx-ready"
by adding one additional non-root, non-mounted disk.
[Specifying a GKE local SSD disk results in having it automatically mounted]
Prereqs: