Skip to content

Instantly share code, notes, and snippets.

View fabiocruzcoelho's full-sized avatar
:octocat:

Fabio Coelho fabiocruzcoelho

:octocat:
View GitHub Profile
@fabiocruzcoelho
fabiocruzcoelho / coreos-cloud-config.yaml
Last active August 3, 2017 12:07
Modelo cloud-config para instalação CoreOS
#cloud-config
hostname: kube01
users:
- name: remoto
passwd: $1$o1aDRemK$CPPqN4hpl3TuYlZWjiBa.1
groups:
- sudo
- docker
@fabiocruzcoelho
fabiocruzcoelho / kubectl-config.sh
Created August 15, 2017 15:52
Comando kubectl config
# Configura Cluster com certificado CA
kubectl config set-cluster <cluster name> --server=https://master.exemplo.local:6443 \
--certificate-authority=${PWD}/ssl/prod/ca.pem
# Configura credenciais
kubectl config set-credentials prod-admin --certificate-authority=${PWD}/ssl/prod/ca.pem \
--client-key=${PWD}/ssl/prod/admin-docker01-key.pem --client-certificate=${PWD}/ssl/prd/admin-docker01.pem
# Configura Contexto para o cluster
@fabiocruzcoelho
fabiocruzcoelho / kubernetes-with-pv-pvc.yml
Created August 30, 2017 20:05
Modelo Volume Persistente: PV/PVC
apiVersion: v1
kind: PersistentVolume
metadata:
name: grafana-pv
namespace: fabio
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteMany
@fabiocruzcoelho
fabiocruzcoelho / kubernetes-with-svc-rc.yml
Last active August 30, 2017 20:06
Modelo de Service e ReplicationControl Kubernetes
apiVersion: v1
kind: Service
metadata:
name: grafana
namespace: fabio
labels:
app: grafana
spec:
ports:
- port: 80
@fabiocruzcoelho
fabiocruzcoelho / kubernetes-deploy.yml
Created August 30, 2017 20:08
Modelo deploy kubernetes com limits e volume host.
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: jobs
namespace: fabio
spec:
replicas: 1
template:
metadata:
labels:
@fabiocruzcoelho
fabiocruzcoelho / vhost.conf
Last active November 28, 2017 16:42
vhost nginx proxy
upstream confluence {
server sertver_backend:8090;
keepalive 300;
}
server {
listen haproxy.fabio.com.br:80;
server_name confluence.fabio.com.br;
access_log off;
error_log /dev/null crit;
@fabiocruzcoelho
fabiocruzcoelho / nginx.conf
Created November 28, 2017 17:14
Arquivo de configuração nginx proxy
user nginx;
worker_processes auto;
worker_rlimit_nofile 200000;
pid /var/run/nginx.pid;
events {
worker_connections 10000;
use epoll;
multi_accept on;
}
graph LR
A[Pubic VIP] --Floating Virtual IP Address--> B[VRRP]
B --> C{N Master}
B --> D[Private Network]
B --> E{N Backup}
D --> G(Pool Server A)
D --> H(Pool Server B)
@fabiocruzcoelho
fabiocruzcoelho / Docker containers
Last active December 14, 2017 15:03
Comandos mais utilizados docker
# Stop / remove all Docker containers
# Para todos containers
docker stop $(docker ps -a -q)
# Remove todos containers
docker rm -f $(docker ps -a -q)
# Remove todas imagnes
docker images -q | xargs docker rmi -f
# docker-compose.yml com traefik para cluster docker swarm
version: "3"
services:
grafana:
image: monitoringartist/grafana-xxl:latest
ports:
- "3000:3000"
networks: