Skip to content

Instantly share code, notes, and snippets.

View lwolf's full-sized avatar

Sergii Nuzhdin lwolf

View GitHub Profile
kubectl get pods -w -l release=stolon-kube
NAME READY STATUS RESTARTS AGE
stolon-kube-stolon-ht89t 0/1 Completed 0 1m
stolon-kube-stolon-keeper-0 1/1 Running 0 1m
stolon-kube-stolon-keeper-1 1/1 Running 0 1m
stolon-kube-stolon-keeper-2 1/1 Running 0 59s
stolon-kube-stolon-proxy-c87c57676-h8pxj 1/1 Running 0 1m
stolon-kube-stolon-proxy-c87c57676-rcbdz 1/1 Running 0 1m
stolon-kube-stolon-proxy-c87c57676-zdcrc 1/1 Running 0 1m
stolon-kube-stolon-sentinel-5dc5fd564f-56z89 1/1 Running 0 1m
@lwolf
lwolf / cleanup
Created September 16, 2017 10:21
Error adding network: no IP addresses available in network: cbr0”
$ cd /var/lib/cni/networks/kubenet
$ ls
10.180.2.2 10.180.2.3 10.180.2.4 last_reserved_ip
$ echo foobar > 10.180.2.244
$ for hash in $(tail -n +1 * | grep '^[A-Za-z0-9]*$' | cut -c 1-8); do if [ -z $(docker ps -a | grep $hash | awk '{print $1}') ]; then grep -ir $hash ./; fi; done
./10.180.2.244:foobar
$ for hash in $(tail -n +1 * | grep '^[A-Za-z0-9]*$' | cut -c 1-8); do if [ -z $(docker ps -a | grep $hash | awk '{print $1}') ]; then grep -ilr $hash ./; fi; done | xargs rm
@lwolf
lwolf / cloud-config.yml
Created June 22, 2017 13:13 — forked from socketwiz/cloud-config.yml
CoreOS cloud-config for DigitalOcean with iptables firewall
#cloud-config
coreos:
etcd2:
# generate a new token for each unique cluster from https://discovery.etcd.io/new?size=3
# specify the initial size of your cluster with ?size=X
discovery: https://discovery.etcd.io/<token>
# multi-region and multi-cloud deployments need to use $public_ipv4
advertise-client-urls: http://$private_ipv4:2379,http://$private_ipv4:4001
initial-advertise-peer-urls: http://$private_ipv4:2380
#!/bin/sh
########
# originaly from https://github.com/mlafeldt/chef-runner/blob/v0.7.0/script/coverage
#######
# Generate test coverage statistics for Go packages.
#
# Works around the fact that `go test -coverprofile` currently does not work
# with multiple packages, see https://code.google.com/p/go/issues/detail?id=6909
#
# Usage: script/coverage [--html|--coveralls]
@lwolf
lwolf / iptables_rules.sh
Created December 5, 2016 09:30 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-load-balancer-conf
data:
body-size: "0"
proxy-connect-timeout: "10"
proxy-read-timeout: "360"
proxy-send-imeout: "360"
@lwolf
lwolf / env2secret.py
Created April 22, 2016 12:30
Script to convert docker-compose compatible environment files into kubernetes secrets
"""
requires click package:
- pip install click
Example usage:
- python env2secret.py --src=production-ru.env --dst=production-ru-secret.yaml --fmt=yaml --name=my-app-secret
"""
import base64
import click