Skip to content

Instantly share code, notes, and snippets.

View markusthoemmes's full-sized avatar

Markus Thömmes markusthoemmes

View GitHub Profile
@markusthoemmes
markusthoemmes / results.md
Last active September 1, 2021 13:07
Results of measuring the effectiveness of our startup probe optimization

Readiness probe optimization results

All of these measurements are taken on my local machine using kind. The usual disclaimers apply. YMMV.

Note: "Adjusted" means HEAD without startup probe on the queue-proxy but HTTP probe on user-container. The following patch is applied to podspeed

diff --git a/pkg/pod/types/knative.go b/pkg/pod/types/knative.go
index 59b2c8d..1aab20b 100644
--- a/pkg/pod/types/knative.go
@markusthoemmes
markusthoemmes / bench.go
Created October 29, 2020 06:58
TCP vs Unix connection with no keepalive benchmark
func BenchmarkConnection(b *testing.B) {
tests := []struct {
proto string
addr string
}{{
proto: "unix",
addr: unixSocketPath,
}, {
proto: "tcp",
addr: ":8888",
@markusthoemmes
markusthoemmes / continue.go
Last active June 8, 2020 12:12
Had a little play with how the http.StatusContinue behavior works in a potential Knative setup.
package main
import (
"fmt"
"io"
"io/ioutil"
"math/rand"
"net/http"
"net/http/httptest"
"net/http/httputil"

Knative Serving release v0.15.0

Meta

Serving release artifact deprecations

serving.yaml and serving-cert-manager.yaml will be shipped for the last time in this release. They have been broken out into separate artifacts. Please refer to the current installation docs for guidance on how to install Knative Serving and its optional components.

Minimum supported Kubernetes version bumped to 1.16

As per the Kubernetes minimum version principle - our current minimum supported Kubernetes version is now 1.16.

@markusthoemmes
markusthoemmes / spoof.go
Created April 20, 2020 12:23
Basic Golang example for host spoofing on HTTP requests.
package main
import (
"context"
"fmt"
"io/ioutil"
"net"
"net/http"
)
@markusthoemmes
markusthoemmes / README.md
Last active April 16, 2020 10:08
HTTPS Proxy testing with mitmproxy

HTTPS Proxy testing with mitmproxy

Basic functionality test

  1. Get a machine to run mitmproxy. Anything that can get an IP will work.
  2. Download mitmproxy: wget https://snapshots.mitmproxy.org/5.0.1/mitmproxy-5.0.1-linux.tar.gz
  3. Unpack: tar -xf mitmproxy-5.0.1-linux.tar.gz
  4. Just run mitmproxy: ./mitmproxy --set block_global=false. Disabling block_global is important to allow any traffic.
  5. Get the relevant certificate: cat ~/.mitmproxy/mitmproxy-ca-cert.pem
  6. Try out it works: curl --proxy $IP:8080 --cacert mitmproxy-ca-cert.pem https://www.canihazip.com/s
kind: ConfigMap
apiVersion: v1
metadata:
name: serverless-operator
data:
customResourceDefinitions: |-
- apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:

Profiling Knative Serving

Knative Serving allows for collecting runtime profiling data expected by the pprof visualization tool. Profiling data is available for the autoscaler, activator, controller, webhook and for the queue-proxy container which is injected into the user application pod. When enabled Knative serves profiling data on the default port 8008 through a web server.

Steps to get profiling data:

@markusthoemmes
markusthoemmes / repro.yaml
Last active January 11, 2019 10:09
Istio graceful shutdown reproducer
apiVersion: v1
kind: Service
metadata:
name: test-service
spec:
ports:
- port: 8080
name: http
selector:
app: test
@markusthoemmes
markusthoemmes / .gitconfig
Last active August 20, 2018 19:56
Mac Setup
[user]
name = Markus Thömmes
email = markusthoemmes@me.com
[push]
default = matching
[alias]
pr = "!sh -c \"git fetch upstream pull/$1/head:pr-$1\" -"
update-fork = "!sh -c \"git fetch upstream; git rebase upstream/master; git push origin master\" -"
[core]
excludesfile = ~/.gitignore