Skip to content

Instantly share code, notes, and snippets.

@cpretzer
cpretzer / commands.sh
Created December 28, 2021 18:57
Commands to install Linkerd 2.11 on RedHat OpenShift
#!/bin/bash
# These commands must be run by a user with the cluster-admin role
# and assume that you've already provisioned the cluster and logged
# in with the oc login command
#################################
# Deploy the Linkerd CNI Plugin #
#################################
@cpretzer
cpretzer / 21.1.3_proxy_trace.log
Created January 29, 2021 18:34
proxy log trace output
This file has been truncated, but you can view the full file.
2021-01-28T00:22:36.406152138Z [ 281.917866s] DEBUG ThreadId(01) outbound: linkerd_cache: Caching new service target=Accept { orig_dst: 10.4.0.218:5432, protocol: () }
2021-01-28T00:22:36.406337165Z [ 281.918047s] TRACE ThreadId(01) outbound:poll_profile: linkerd_service_profiles::client: disconnected
2021-01-28T00:22:36.406380064Z [ 281.918100s] TRACE ThreadId(01) outbound:poll_profile: linkerd_service_profiles::client: waiting
2021-01-28T00:22:36.406469555Z [ 281.918193s] DEBUG ThreadId(01) outbound: linkerd_timeout::failfast: TCP Server service has become unavailable
2021-01-28T00:22:36.406501307Z [ 281.918238s] TRACE ThreadId(01) outbound: linkerd_timeout::failfast: Pending
2021-01-28T00:22:36.406617892Z [ 281.918320s] TRACE ThreadId(01) dst: linkerd_buffer::dispatch: Dispatching request
2021-01-28T00:22:36.406717710Z [ 281.918399s] TRACE ThreadId(01) poll_profile: linkerd_service_profiles::client: waiting
2021-01-28T00:22:36.406768313Z [ 281.918495s] DEBUG ThreadId(01) dst: linkerd_dns: r
@cpretzer
cpretzer / data.sql
Created January 29, 2021 18:28
Postgres Connection Hang
--------------------------------------------------------------
-- Practical SQL: A Beginner's Guide to Storytelling with Data
-- by Anthony DeBarros
-- Chapter 11 Code Examples
--------------------------------------------------------------
-- Listing 11-1: Extracting components of a timestamp value using date_part()
SELECT
@cpretzer
cpretzer / deployment.yml
Last active January 21, 2021 01:23
Linkerd Proxy with LINKERD2_PROXY_DNS_CANONICALIZE_TIMEOUT
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app.kubernetes.io/name":"voting","app.kubernetes.io/part-of":"emojivoto","app.kubernetes.io/version":"v11"},"name":"voting","namespace":"emojivoto"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"voting-svc","version":"v11"}},"template":{"metadata":{"labels":{"app":"voting-svc","version":"v11"}},"spec":{"containers":[{"env":[{"name":"GRPC_PORT","value":"8080"},{"name":"PROM_PORT","value":"8801"}],"image":"buoyantio/emojivoto-voting-svc:v11","name":"voting-svc","ports":[{"containerPort":8080,"name":"grpc"},{"containerPort":8801,"name":"prom"}],"resources":{"requests":{"cpu":"100m"}}}],"serviceAccountName":"voting"}}}}
generation: 1
labels:
app.kubernetes.io/name: voting
@cpretzer
cpretzer / linkerd-proxy-es-zen.log
Created December 15, 2020 19:53
Trace logging from Linkerd Proxy handling Elasticsearch Zen Discovery traffic
[ 69240.418802s] DEBUG ThreadId(01) outbound:accept{peer.addr=10.0.0.15:34466 target.addr=10.0.2.16:9300}: linkerd2_proxy_transport::metrics: client connection open
[ 69240.418812s] TRACE ThreadId(01) outbound:accept{peer.addr=10.0.0.15:34466 target.addr=10.0.2.16:9300}: linkerd2_duplex: poll
[ 69240.418816s] TRACE ThreadId(01) outbound:accept{peer.addr=10.0.0.15:34466 target.addr=10.0.2.16:9300}: linkerd2_duplex: reading
[ 69240.418821s] TRACE ThreadId(01) outbound:accept{peer.addr=10.0.0.15:34466 target.addr=10.0.2.16:9300}: linkerd2_duplex: read 348B
[ 69240.418825s] TRACE ThreadId(01) outbound:accept{peer.addr=10.0.0.15:34466 target.addr=10.0.2.16:9300}: linkerd2_duplex: writing 348B
[ 69240.418862s] TRACE ThreadId(01) outbound:accept{peer.addr=10.0.0.15:34466 target.addr=10.0.2.16:9300}: linkerd2_duplex: wrote 348B
[ 69240.418869s] TRACE ThreadId(01) outbound:accept{peer.addr=10.0.0.15:34466 target.addr=10.0.2.16:9300}: linkerd2_duplex: reading
[ 69240.418879s] TRACE ThreadId(01) outbound:accept{peer.add
@cpretzer
cpretzer / emojivoto-all-topologies.yml
Last active November 3, 2020 00:40
Emojivoto YAML files for testing ServiceTopologies and EndpointSlices in Linkerd 2.9
apiVersion: v1
kind: Namespace
metadata:
name: emojivoto
annotations:
linkerd.io/inject: enabled
---
apiVersion: v1
kind: ServiceAccount
metadata:
2020/08/27 18:37:03 Tracing this script execution as [1598553423]
2020/08/27 18:37:03 State of iptables rules before run:
2020/08/27 18:37:03 > iptables -t nat -vnL
2020/08/27 18:37:03 < Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluentd-elasticsearch
namespace: kube-system
labels:
k8s-app: fluentd-logging
spec:
selector:
matchLabels:
$ ./sbt namer-zk-leader/compile:doc
[info] Loading global plugins from /Users/cpretzer/.sbt/0.13/plugins
[info] Loading project definition from /Users/cpretzer/projects/linkerd/linkerd/project
[info] Compiling 1 Scala source to /Users/cpretzer/projects/linkerd/linkerd/project/target/scala-2.10/sbt-0.13/classes...
[info] Resolving key references (63111 settings) ...
[info] Set current project to all (in build file:/Users/cpretzer/projects/linkerd/linkerd/)
[info] Updating {file:/Users/cpretzer/projects/linkerd/linkerd/}namer-zk-leader...
[info] Resolving jline#jline;2.14.1 ...
[info] Done updating.
[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
@cpretzer
cpretzer / curl-linkerd-2.6.1-injected.yml
Last active May 18, 2020 19:26
Squid repro files using https_proxy
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: curl-261
name: curl-261
namespace: default
spec:
progressDeadlineSeconds: 600
replicas: 1