Skip to content

Instantly share code, notes, and snippets.

View gianrubio's full-sized avatar

Giancarlo Rubio gianrubio

View GitHub Profile
@gianrubio
gianrubio / serviceMonitor-example.yaml
Last active February 13, 2020 18:52
serviceMonitor-example.yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
namespaceSelector:
matchNames:
@gianrubio
gianrubio / K8s Cheat sheet.md
Last active May 9, 2019 16:20
Deploy prometheus using helm

k8s cheat sheet

aws s3api create-bucket --bucket my-kops-bucket --location- eu-west-1 --create-bucket-configuration LocationConstraint=eu-west-1
export NAME=my-kops-cluster-name
export KOPS_STATE_STORE=s3://my-kops-bucket-name 
kops create cluster --zones eu-west-1a,eu-west-1b --name $NAME --node-count=2 --node-size=t2.medium  --authorization=RBAC   --networking=calico --encrypt-etcd-storage --kubernetes-version=v1.7.10 
kops update cluster --yes
kops validate cluster
// Place your settings in this file to overwrite the default settings
{
"workbench.colorTheme": "Solarized Light",
"git.confirmSync": false,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
@gianrubio
gianrubio / launch.json
Created July 13, 2017 08:15
debug ingress on vstudio
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "debug",
"remotePath": "",
@gianrubio
gianrubio / Increase
Created May 9, 2017 07:21
K8s increase nf_conntrack_max
or i in `kubectl get nodes |grep -v "NAME"| awk '{print $1}'`; do ssh -t core@$i "sudo sysctl net.netfilter.nf_conntrack_max=1000000" ;done
import logging
import time
logger = logging.getLogger()
logger.setLevel(logging.INFO)
ch = logging.StreamHandler(sys.stdout)
ch.setFormatter(logging.Formatter("%(levelname)s %(asctime)s %(funcName)s %(lineno)d %(message)s"))
logger.addHandler(ch)
FROM alpine:3.3
# Here we install GNU libc (aka glibc) and set C.UTF-8 locale as default.
ENV LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8
RUN ALPINE_GLIBC_BASE_URL="https://github.com/andyshinn/alpine-pkg-glibc/releases/download" && \
ALPINE_GLIBC_PACKAGE_VERSION="2.23-r1" && \
ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && \
echo 127.0.0.1 localhost > /etc/hosts
echo `ifconfig eth0 | awk '/inet addr/{print substr($2,6)}'` `hostname` >> /etc/hosts
@gianrubio
gianrubio / circle.yml
Last active December 17, 2023 22:01
Socks proxy to connect private hosts with circleci
machine:
services:
- docker
post:
- wget https://gist.githubusercontent.com/gianrubio/dce37ee9b9c024937832d776597e2603/raw/4cdb30e5075e8e6064ac48a258e05f518f8c88c0/circleci-tunnel.sh ~/ && chmod +x ~/circleci-tunnel.sh
- ~/circleci-tunnel.sh start:
background: true
import json
from botocore.exceptions import ClientError
import boto3
import sys
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
from zabbix.api import ZabbixAPI