Skip to content

Instantly share code, notes, and snippets.

@olvesh
olvesh / grpcbin.proto
Last active Apr 23, 2018
grpcbin nginx ingress test
View grpcbin.proto
syntax = "proto3";
package grpcbin;
service GRPCBin {
// This endpoint
rpc Index (EmptyMessage) returns (IndexReply) {
}
// Unary endpoint that takes no argument and replies an empty message.
rpc Empty (EmptyMessage) returns (EmptyMessage) {
@olvesh
olvesh / readme.md
Last active Apr 23, 2021
Kubernetes and Kops migrate from public to private topology
View readme.md

From public to private topology

Run kops get cluster -o yaml --full > cluster-full.yaml for reference and backup

Bastion and weave networking

kops edit cluster:

  • change networking to
    spec: 
      networking:
        weave: 
@olvesh
olvesh / configmapcase.yaml
Last active May 11, 2017
Configmap with subfolders in pod
View configmapcase.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: testconfig
data:
file1: |
some stuff
file2: |
some other stuff in subdir
---
View bumpme
Sun Mar 19 18:51:17 UTC 2017
@olvesh
olvesh / namespaces
Created Nov 21, 2016
Reappearing namespaces
View namespaces
# kubectl get ns -o wide
NAME STATUS AGE
cust1-first Terminating 6h
cust1-second Terminating 6h
default Active 6d
dev Terminating 6h
kube-system Active 6d
prod Terminating 6h
qa Terminating 6h
spinnaker Active 6d
@olvesh
olvesh / netinfo.sh
Created Oct 19, 2016
Find ip, subnet etc on AWS metadata service
View netinfo.sh
#!/usr/bin/env bash
DOMAIN=$(curl -s http://169.254.169.254/latest/meta-data/hostname | perl -n -e'/[A-Za-z0-9-]+\.(.*)/ && print $1')
IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
MAC=$(curl -s http://169.254.169.254/latest/meta-data/mac)
CIDR=$(curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/$MAC/vpc-ipv4-cidr-block)
RECURSOR=$( echo $CIDR | awk -F"." '{print $1 "." $2 "." $3 ".2"}')
View keybase.md

Keybase proof

I hereby claim:

  • I am olvesh on github.
  • I am olve (https://keybase.io/olve) on keybase.
  • I have a public key whose fingerprint is A193 3ED8 721B 01DF 619A 47F0 85BC BF60 88D6 BE0C

To claim this, I am signing this object:

@olvesh
olvesh / Ansible docker rolling deploy.md
Last active May 4, 2016
Ansible docker rolling deploy
View Ansible docker rolling deploy.md

Ansible rolling update using docker

Include docker-deploy.yml:

[...]
- name: "Deploying {{ service_name }} "
  hosts: "{{ service_name }}"
  serial: 1
  max_fail_percentage: 50
  tasks: 
View ssh-multi.sh
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
@olvesh
olvesh / java-driver-dependencies.
Created Mar 20, 2013
java-driver dependency-tree is a bit much, what can be removed/excluded here?
View java-driver-dependencies.
(! 525) ((1.0.0-beta1))# mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building DataStax Java Driver for Apache Cassandra - Core 1.0.0-beta1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ cassandra-driver-core ---
[INFO] com.datastax.cassandra:cassandra-driver-core:jar:1.0.0-beta1
[INFO] +- io.netty:netty:jar:3.6.2.Final:compile