Skip to content

Instantly share code, notes, and snippets.

View gabrtv's full-sized avatar

Gabe Monroy gabrtv

View GitHub Profile
$ kubectl help
kubectl controls the Kubernetes cluster manager.
Find more information at https://github.com/kubernetes/kubernetes.
Basic Commands (Beginner):
create Create a resource by filename or stdin
expose Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service
run Run a particular image on the cluster
set Set specific features on objects
ruby_block "stop-services-in-parallel" do
block do
threads = []
targets.each { |s, f|
threads << Thread.new { |t|
s.run_action(:stop)
f.run_action(:delete)
}
}
threads.each { |t| t.join }
gabriel@delta:~$ deis formations:create test
Creating formation... done, created test
See `deis help layers:create` to begin building your formation
gabriel@delta:~$ deis layers:create
Usage: deis layers:create <formation> <id> <flavor> [options]
gabriel@delta:~$ deis layers:create test runtime static
Creating runtime layer... done in 3s
gabriel@delta:~$ deis layers:info
Usage: deis layers:info <formation> <id>
@gabrtv
gabrtv / gist:6452526
Created September 5, 2013 16:24
Example: Finishing a feature with HubFlow
gabriel@delta:~/workspace/deis$ git hf feature finish
Fetching origin
remote: Counting objects: 1, done.
remote: Total 1 (delta 0), reused 1 (delta 0)
Unpacking objects: 100% (1/1), done.
From github.com:opdemand/deis
b22cf85..242ac17 develop -> origin/develop
Switched to branch 'develop'
Your branch is behind 'origin/develop' by 2 commits, and can be fast-forwarded.
Updating b22cf85..242ac17
@gabrtv
gabrtv / gist:6451734
Created September 5, 2013 15:28
Example: Creating a new feature branch using HubFlow
gabriel@delta:~/workspace/deis$ git hf feature start chef-api-retries
Fetching origin
Switched to a new branch 'feature/chef-api-retries'
Total 0 (delta 0), reused 0 (delta 0)
To git@github.com:opdemand/deis.git
* [new branch] feature/chef-api-retries -> feature/chef-api-retries
Summary of actions:
- A new branch 'feature/chef-api-retries' was created, based on 'develop'
- The branch 'feature/chef-api-retries' has been pushed up to 'origin/feature/chef-api-retries'
@gabrtv
gabrtv / Failing (exec over SSH)
Created August 20, 2013 17:46
Docker run hangs over SSH
execve("/usr/bin/docker", ["docker", "run", "-v", "/opt/deis/runtime/slugs/docile-i"..., "deis/buildstep", "ls", "-la"], [/* 12 vars */]) = 0
arch_prctl(ARCH_SET_FS, 0x982330) = 0
sched_getaffinity(0, 128, {1, 0, 0, 0}) = 32
clock_gettime(CLOCK_REALTIME, {1377020251, 252416433}) = 0
mmap(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd226e01000
mmap(NULL, 268480448, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd216df6000
mmap(0xc000000000, 65536, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xc000000000
munmap(0xc000000000, 65536) = 0
mmap(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd216dd6000
mmap(0xc200000000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xc200000000
@gabrtv
gabrtv / gist:6107881
Last active December 20, 2015 09:29
Deis 0.0.4 Sneak Peek
$ deis register https://dev.deis.io/
username: gabrtv
password:
email: gabriel@opdemand.com
Registered gabrtv
Logged in as gabrtv
Found the following SSH public keys:
1) id_rsa.pub
2) deis_test.pub
@gabrtv
gabrtv / gist:1342256
Created November 6, 2011 00:36
Gabrtv's Node.js Build Script
#!/bin/sh -e
# bootstrap application repository
cat > /tmp/bootstrap-app <<EOF
#!/bin/sh -e
git clone https://github.com/gabrtv/nodejs-sandbox.git app
cd app
npm install
EOF
chmod +x /tmp/bootstrap-app
@gabrtv
gabrtv / gist:1342246
Created November 6, 2011 00:22
Node.js Build Script
#!/bin/sh -e
# bootstrap application repository
cat > /tmp/bootstrap-app <<EOF
#!/bin/sh -e
git clone https://github.com/opdemand/c2-nodejs-helloworld.git app
cd app
npm install
EOF
chmod +x /tmp/bootstrap-app
@gabrtv
gabrtv / gist:1342227
Created November 5, 2011 23:59
Node.js Upgrade Script
#!/bin/sh -e
# upgrade packages
sudo apt-get update && sudo apt-get dist-upgrade -y --force-yes
# upgrade node application
cat > /tmp/upgrade <<EOF
#!/bin/sh
cd app
git pull --rebase