Skip to content

Instantly share code, notes, and snippets.

View olix0r's full-sized avatar
🍓

Oliver Gould olix0r

🍓
View GitHub Profile
@olix0r
olix0r / flat-network.sh
Last active October 3, 2023 19:04 — forked from alpeb/flat-network.sh
2 k3d clusters with 3 nodes each, using the same flat network
#!/usr/bin/env bash
set -xeuo pipefail
k3d_api_ready() {
name=$1
for i in {1..6} ; do
if kubectl --context=k3d-$name cluster-info >/dev/null ; then return ; fi
sleep 10
done
@olix0r
olix0r / strest-blue-green.yml
Last active August 29, 2020 19:05
traffic split rotator
---
kind: Namespace
apiVersion: v1
metadata:
name: strest
labels:
app: strest
# target.strest.svc.cluster.local receives all strest traffic.
---
use super::Error;
use async_stream::try_stream;
use futures::{prelude::*, stream};
// Flattens a stream-of-streams until an unrecoverable error is encountered.
pub fn flatten<S, T, R>(
mut stream_of_streams: S,
recover: R,
) -> impl TryStream<Ok = T::Ok, Error = Error> + 'static
where
@olix0r
olix0r / k3d-l5d-multi.sh
Last active May 20, 2020 00:06
K3d + L5d Multicluster test
#!/bin/bash
set -eu
set -x
# Requires:
#
# - k3d v3: https://github.com/rancher/k3d/releases/tag/v3.0.0-beta.1
# - smallstep/cli: https://github.com/smallstep/cli/releases
# - linkerd:edge-20.5.3: https://github.com/linkerd/linkerd2/releases/tag/edge-20.5.3
@olix0r
olix0r / dargo
Last active November 4, 2019 03:28
#!/bin/sh
if [ $# -eq 0 ]; then
echo "usage: $0 [cargo options]" >&2
exit 64
fi
if [ ! -r Cargo.lock ]; then
echo "Not a cargo project: missing Cargo.lock" >&2
exit 1
---
kind: Namespace
apiVersion: v1
metadata:
name: strest
labels:
buoyant.io/test: strest-leak
annotations:
linkerd.io/inject: enabled
web-565bf88c8-mncck linkerd-proxy DBUG proxy-api.ver-linkerd.svc.cluster.local:8086 dns=proxy-api.ver-linkerd.svc.cluster.local trust_dns_proto::xfer::dns_handle querying: proxy-api.ver-linkerd.svc.cluster.local.emojivoto.svc.cluster.local. A
web-565bf88c8-mncck linkerd-proxy TRCE proxy-api.ver-linkerd.svc.cluster.local:8086 dns=proxy-api.ver-linkerd.svc.cluster.local trust_dns_resolver::name_server_pool polling response inner
web-565bf88c8-mncck linkerd-proxy DBUG proxy-api.ver-linkerd.svc.cluster.local:8086 dns=proxy-api.ver-linkerd.svc.cluster.local trust_dns_resolver::name_server_pool connecting: Udp { socket_addr: V4(10.233.0.3:53), timeout: 5s }
web-565bf88c8-mncck linkerd-proxy DBUG proxy-api.ver-linkerd.svc.cluster.local:8086 dns=proxy-api.ver-linkerd.svc.cluster.local trust_dns_proto::xfer enqueueing message: [Query { name: Name { is_fqdn: true, labels: [proxy-api, ver-linkerd, svc, cluster, local, emojivoto, svc, cluster, local] }, query_type: A, query_class: IN }]
web-565bf88c8-mncck linkerd-proxy
# Examples:
#
# # Deploy everything
# :; kubectl apply -f strest.yml --prune -l 'app=strest'
#
# # Add server instances
# :; kubectl -n strest scale -l 'strest-server-profile=fast' --replicas=10
---
kind: Namespace
#!/bin/sh
set -eu
DEFAULT_URL="http://localhost:4191/metrics"
DEFAULT_CURL="curl"
curl="${CURL:-$DEFAULT_CURL}"
url="${1:-$DEFAULT_URL}"
while true ; do
---
apiVersion: v1
kind: Namespace
metadata:
name: bot
---
apiVersion: v1
kind: Service
metadata: