Skip to content

Instantly share code, notes, and snippets.

View ihcsim's full-sized avatar

Ivan Sim ihcsim

View GitHub Profile
@ihcsim
ihcsim / vim-cheatlist.md
Last active November 19, 2017 17:54
vim cheat list
@ihcsim
ihcsim / keybase.md
Last active January 2, 2018 01:42
keybase.md

Keybase proof

I hereby claim:

  • I am ihcsim on github.
  • I am ihcsim (https://keybase.io/ihcsim) on keybase.
  • I have a public key ASBciUKqEsNDMqv-66pAyPMmK2Q8qQ5e-no_5416QIp7PQo

To claim this, I am signing this object:

kind: Service
apiVersion: v1
metadata:
name: redis
labels:
app: redis
spec:
selector:
app: redis
ports:
---
apiVersion: v1
kind: Namespace
metadata:
name: emojivoto
annotations:
linkerd.io/inject: enabled
---
apiVersion: apps/v1beta1
kind: Deployment

Test cases

The following is the list of test cases for the proxy config overrides feature (linkerd/linkerd/#2471).

auto-inject create

  • Specify the config annotations in the pod template. Expect pod's proxy config to be overridden.
  • Specify the config annotations in the namespace. Expect effects on all workloads in the same namespace.

auto-inject update

  1. Deploy a workload with no config annotations.
linkerd -n emojivoto tap deploy
```
req id=0:0 proxy=out src=172.17.0.13:52494 dst=172.17.0.12:80 tls=true :method=GET :authority=web-svc.emojivoto:80 :path=/api/list
req id=0:0 proxy=in src=172.17.0.13:49744 dst=172.17.0.12:80 tls=true :method=GET :authority=web-svc.emojivoto:80 :path=/api/list
req id=0:1 proxy=out src=172.17.0.12:50690 dst=172.17.0.10:8080 tls=true :method=POST :authority=emoji-svc.emojivoto:8080 :path=/emojivoto.v1.EmojiService/ListAll
req id=0:0 proxy=in src=172.17.0.12:50726 dst=172.17.0.10:8080 tls=true :method=POST :authority=emoji-svc.emojivoto:8080 :path=/emojivoto.v1.EmojiService/ListAll
rsp id=0:0 proxy=in src=172.17.0.12:50726 dst=172.17.0.10:8080 tls=true :status=200 latency=1739µs
end id=0:0 proxy=in src=172.17.0.12:50726 dst=172.17.0.10:8080 tls=true grpc-status=OK duration=157µs response-length=2140B
rsp id=0:1 proxy=out src=172.17.0.12:50690 dst=172.17.0.10:8080 tls=true :status=200 latency=3695µs
end id=0:1 proxy=out src=172.17.0.12:50690 dst=172.17.0.10:8080 tls=true gr
linkerd -n emojivoto tap deploy
req id=0:0 proxy=out src=172.17.0.13:52494 dst=172.17.0.12:80 tls=true :method=GET :authority=web-svc.emojivoto:80 :path=/api/list
req id=0:0 proxy=in src=172.17.0.13:49744 dst=172.17.0.12:80 tls=true :method=GET :authority=web-svc.emojivoto:80 :path=/api/list
req id=0:1 proxy=out src=172.17.0.12:50690 dst=172.17.0.10:8080 tls=true :method=POST :authority=emoji-svc.emojivoto:8080 :path=/emojivoto.v1.EmojiService/ListAll
req id=0:0 proxy=in src=172.17.0.12:50726 dst=172.17.0.10:8080 tls=true :method=POST :authority=emoji-svc.emojivoto:8080 :path=/emojivoto.v1.EmojiService/ListAll
rsp id=0:0 proxy=in src=172.17.0.12:50726 dst=172.17.0.10:8080 tls=true :status=200 latency=1739µs
end id=0:0 proxy=in src=172.17.0.12:50726 dst=172.17.0.10:8080 tls=true grpc-status=OK duration=157µs response-length=2140B
rsp id=0:1 proxy=out src=172.17.0.12:50690 dst=172.17.0.10:8080 tls=true :status=200 latency=3695µs
end id=0:1 proxy=out src=172.17.0.12:50690 dst=172.17.0.10:8080 tls=true grpc-
# control plane
linkerd install | k apply -f -
## data plane psp
cat <<EOF|k apply -f -
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: linkerd-data-plane
spec:

The following are test cases for linkerd/linkerd2#2987, which introduces global resources checks to linkerd check --pre and linkerd install.

Single control plane installation:

bin/linkerd version --client
Client version: git-b8ba3b26

# expect pre-check to succeed
bin/linkerd check --pre
bin/linkerd check --pre -l linkerd-dev
@ihcsim
ihcsim / .diff
Last active September 20, 2019 22:42
Linkerd StatAll PromQL Queries. See https://github.com/linkerd/linkerd2/pull/3440
--- queries-edge-19.9.3.md 2019-09-20 15:32:55.233035379 -0700
+++ queries-dev.md 2019-09-20 15:33:11.956921137 -0700
@@ -1,90 +1,50 @@
-edge-19.9.3:
+git-2cf17da3:
```
$ linkerd stat all
-histogram_quantile(0.99, sum(irate(response_latency_ms_bucket{direction=\"inbound\", namespace=\"default\"}[1m])) by (le, namespace, deployment))
-histogram_quantile(0.99, sum(irate(response_latency_ms_bucket{direction=\"inbound\", namespace=\"default\"}[1m])) by (le, namespace, daemonset))
-histogram_quantile(0.99, sum(irate(response_latency_ms_bucket{direction=\"inbound\", namespace=\"default\"}[1m])) by (le, namespace, replicationcontroller))