Skip to content

Instantly share code, notes, and snippets.

@andrewjjenkins
Last active August 20, 2019 21:48
Show Gist options
  • Save andrewjjenkins/d50230a505d8004d9c47d10458ff2c3a to your computer and use it in GitHub Desktop.
Save andrewjjenkins/d50230a505d8004d9c47d10458ff2c3a to your computer and use it in GitHub Desktop.
Build oneliners

Just a list of one-liners I keep using, forgetting and hunting for in history when building Envoy

bazel test //test/common/upstream/...
bazel test --test_output=errors //test/common/upstream:health_checker_impl_test
tools/bazel-test-gdb //test/common/upstream:health_checker_impl_test -c dbg --test_arg=--gtest_filter=TcpHealthCheckerImplTest.TimeoutAfterDisconnect
tools/bazel-test-gdb //test/common/upstream:health_checker_impl_test -c dbg
bazel build //source/exe:envoy-static -c dbg
bazel-bin/source/exe/envoy-static --config-path configs/google_com_proxy.v2.yaml --component-log-level connection:debug,upstream:debug

Other Istio debugging commands:

Get the listener config for a particular pod kafka-0s' own Pod IP:

PODIP=$(kubectl get pod kafka-0 -o jsonpath="{.status.podIP}") && \
kubectl exec -it kafka-0 -c istio-proxy -- curl -s localhost:15000/config_dump | \
jq ".configs[] |\
  select(.\"@type\"==\"type.googleapis.com/envoy.admin.v2alpha.ListenersConfigDump\").dynamic_active_listeners[] | \
  select(.listener.name == \"${PODIP}_9094\")\
" 

Flagger:

kubectl port-forward -n istio-system $(kubectl get pod -n istio-system -l app=prometheus -o jsonpath='{.items[0].metadata.name}') 9090
go install ./cmd/flagger/... && flagger -kubeconfig=$KUBECONFIG -metrics-server http://localhost:9090
kubectl -n test set image deployment/podinfo podinfod=stefanprodan/podinfo:2.0.1
kubectl exec -it $(kubectl get pod -n test -l app=flagger-loadtester -o jsonpath='{.items[0].metadata.name}') -- /bin/sh -c "hey -z 1m -q 10 -c 2 http://podinfo.test:9898/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment