Skip to content

Instantly share code, notes, and snippets.

@olvesh
olvesh / grpcbin.proto
Last active April 23, 2018 14:50
grpcbin nginx ingress test
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 September 4, 2022 02:25
Kubernetes and Kops migrate from public to private topology

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 June 14, 2022 09:08
Configmap with subfolders in pod
apiVersion: v1
kind: ConfigMap
metadata:
name: testconfig
data:
file1: |
some stuff
file2: |
some other stuff in subdir
---
@olvesh
olvesh / bumpme
Last active March 19, 2017 18:51
Sun Mar 19 18:51:17 UTC 2017
@olvesh
olvesh / namespaces
Created November 21, 2016 20:48
Reappearing 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 October 19, 2016 07:53
Find ip, subnet etc on AWS metadata service
#!/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"}')
@olvesh
olvesh / keybase.md
Created September 20, 2016 19:48
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 April 6, 2022 12:30
Ansible docker rolling deploy

Ansible rolling update using docker

Include docker-deploy.yml:

[...]
- name: "Deploying {{ service_name }} "
  hosts: "{{ service_name }}"
  serial: 1
  max_fail_percentage: 50
 tasks: 
@olvesh
olvesh / ssh-multi.sh
Last active December 30, 2015 11:29 — forked from dmytro/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 March 20, 2013 13:43
java-driver dependency-tree is a bit much, what can be removed/excluded here?
(! 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