Skip to content

Instantly share code, notes, and snippets.

View fabiocruzcoelho's full-sized avatar
:octocat:

Fabio Coelho fabiocruzcoelho

:octocat:
View GitHub Profile
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 / 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;
}
@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 / 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 / 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 / registry+kubernetes.md
Last active January 19, 2018 18:51
Passos de configuração do registry para um cluster kubernetes
Passos para configurar um resgitry private em um cluster kubernetes
# Gerando os certificados para o registry private
$ openssl genrsa -out "/etc/pki/tls/private/regitry.key" 4096
$ openssl req -x509 -sha512 -nodes -newkey rsa:4096 -days 730 -keyout /etc/pki/tls/private/registry.key \
 -out /etc/pki/tls/certs/registry.crt
$ openssl req -new -x509 -text -key registry.key -out gitlab-registry.cert
@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 / comando-kubectl.md
Last active May 30, 2019 16:07
Sobre o comando kubectl

Sobre kubectl

O utilitário kubectl permite que você interfira com o gerenciador de cluster Kubernetes. Por exemplo, você pode adicionar e excluir nós, pods, controladores de replicação e serviços. Você também pode verificar seu status, e assim por diante.

Comandos Basicos

#Exemplos
kubectl get pv
kubectl get pvc
kubectl get pods
@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