Skip to content

Instantly share code, notes, and snippets.

View cescoferraro's full-sized avatar
🏠
Working from home

cesco cescoferraro

🏠
Working from home
View GitHub Profile
@cescoferraro
cescoferraro / deploy_docker.go
Created October 23, 2016 21:51
docker & kubernetes client example golang
package cmd
import (
"bitbucket.org/cescoferraro/api/util"
"github.com/fatih/color"
"github.com/spf13/cobra"
)
var (
logger = util.Block{
@cescoferraro
cescoferraro / Dockerfile.dev
Created October 11, 2016 13:20
GLIDE INSTALL DOCKERFILE
# GLIDE INSTALLATION
#WORKDIR /tmp
# RUN curl -sL https://github.com/Masterminds/glide/releases/download/v0.12.3/glide-v0.12.3-linux-amd64.tar.gz | tar xvz
# RUN chmod +x /tmp/linux-amd64/glide
# RUN mv /tmp/linux-amd64/glide /usr/local/bin/glide
# RUN chmod +x /usr/local/bin/glide
# RUN glide install
@cescoferraro
cescoferraro / kubelet wrapper
Last active September 16, 2016 00:47
core os
[Unit]
Description=Kubernetes Kubelet
After=docker.service
Requires=docker.service
[Service]
User=root
EnvironmentFile=/home/core/environment
Environment=KUBELET_VERSION=v1.3.6_coreos.0
Environment="RKT_OPTS=--volume=kubeconfig,kind=host,source=/home/core/.kube/config \
FROM ubuntu:14.04
MAINTAINER Francesco Ferraro <francescoaferraro@gmail.com>
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:masterminds/glide
RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ubuntu-lxc/lxd-stable
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git
---
apiVersion: v1
kind: Service
metadata:
name: tech-blog
namespace: blog
labels:
name: tech-blog
romulus/route: public
romulus/lb: vulcan
core@coreos2 ~ $ export ETCDCTL_CERT_FILE=/home/core/ssl/etcd1.pem
core@coreos2 ~ $ export ETCDCTL_KEY_FILE=/home/core/ssl/etcd1-key.pem
core@coreos2 ~ $ export ETCDCTL_CA_FILE=/home/core/ssl/ca.pem
core@coreos2 ~ $ export ETCDCTL_ENDPOINT=https://${MASTER_PRIVATE}:2379,https://${DATABASE_PRIVATE}:2379
@cescoferraro
cescoferraro / cloud-config kubernetes on coreos
Last active March 22, 2016 14:01
All necessary binaries to run Kubernetes on CoreOS from https://github.com/cescoferraro/kube/ because the original releases link keep crashing on Digital Ocean
# this clone the repo at /opt/bin which is under the $PATH buy may conflict \
with existing copies of these binaries on core os machines \
while on a shell environment. Service files should use absolute path anyway. \
Keep that in mind when sshing into the servers
TODO : Create a service that remove the installation binaries
- name: binaries.service
command: start
content: |
@cescoferraro
cescoferraro / README.md
Created March 15, 2016 15:38 — forked from andyshinn/README.md
CoreOS on Digital Ocean using Terraform

Terraform, CoreOS, and Digital Ocean

Let's use Terraform to easily get a CoreOS cluster up on Digital Ocean. In this example we will get a 5 node CoreOS cluster up and running on the Digital Ocean 8GB size.

Install Terraform

Grab a copy of Terraform for your platform from http://www.terraform.io/downloads.html. Follow the instructions at http://www.terraform.io/intro/getting-started/install.html by getting Terraform in your PATH and testing that it works.

Digital Ocean API Key

#cloud-config
coreos:
etcd2:
# generate a new token for each unique cluster from https://discovery.etcd.io/new:
discovery: https://discovery.etcd.io/XXXXX
# multi-region deployments, multi-cloud deployments, and Droplets without
# private networking need to use $public_ipv4:
advertise-client-urls: http://$private_ipv4:2379,http://$private_ipv4:4001
initial-advertise-peer-urls: http://$private_ipv4:2380
@cescoferraro
cescoferraro / docker-compose.yml
Last active January 28, 2016 13:53
docker-compose rc2
version: 2
services:
web:
build: webapp
depends_on: [postgres]
volumes:
- ${PWD}/webapp:/srv/app
- ${PWD}/webapp/supervisor/:/etc/supervisor/
postgres:
build: psql