Skip to content

Instantly share code, notes, and snippets.

View tsaarni's full-sized avatar

Tero Saarni tsaarni

  • Ericsson
  • Finland
  • 17:11 (UTC +03:00)
View GitHub Profile
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoserver
spec:
selector:
matchLabels:
app: echoserver
template:
metadata:
@tsaarni
tsaarni / README.md
Last active April 20, 2023 14:03
Step-by-step development tutorial: making a code change to Contour

Step-by-step development tutorial: making a code change to Contour and seeing live results

This tutorial is a step-by-step guide to making a small code change to Contour. It shows how to run Contour locally on your laptop and have it control Envoy(s) running in a Kind cluster. It allows for a very fast feedback cycle and easy debugging.

Preparation

Create a Kind cluster, for example by running:

@tsaarni
tsaarni / 00-readme.md
Last active October 4, 2022 19:17
Manual test procedure for slow start mode

Manual test procedure for slow start mode

This document describes manual test procedure for PR projectcontour/contour#4772

The test is executed by using k6. Additionally, it uses InfluxDB to record the performance test results and Grafana to visualize them.

Preparations

Spin up influxdb and grafana using docker-compose:

@tsaarni
tsaarni / timeout-server.py
Last active September 21, 2022 12:30
How to simulate TCP connect timeout
#!/bin/env python3
#
# This script can be used as a server when you need to test the handling of
# TCP connection establishment timeouts of your client.
#
# The protocol can be HTTP, HTTPS or just about anything else, since connection
# will never be established. It will hang in TCP handshake.
#
import socket

How to use debug containers

Following K8s feature-gate must be enabled in kind (kubeadm) config file to access the feature

featureGates:
  EphemeralContainers: true

First we start debug / emphemeral container and attach it to contour shutdown-manager container.

proto_print /tmp/tmpoyvg8bdx/b/envoy/api/v2/ratelimit/ratelimit.proto
proto_print /tmp/tmpoyvg8bdx/b/envoy/api/v2/core/health_check.proto
proto_print /tmp/tmpoyvg8bdx/b/envoy/api/v2/cluster/outlier_detection.proto
proto_print /tmp/tmpoyvg8bdx/b/envoy/admin/v2alpha/tap.proto
proto_print /tmp/tmpoyvg8bdx/b/envoy/api/v2/rds.proto
proto_print /tmp/tmpoyvg8bdx/b/envoy/api/v2/listener/udp_listener_config.proto
proto_print /tmp/tmpoyvg8bdx/b/envoy/api/v2/cluster/filter.proto
proto_print /tmp/tmpoyvg8bdx/b/envoy/admin/v2alpha/server_info.proto
proto_print /tmp/tmpoyvg8bdx/b/envoy/api/v2/listener/quic_config.proto
Please apply following patch to directory './api'
@tsaarni
tsaarni / upload-as-uncompressed.py
Last active June 9, 2021 17:39
Upload image to registry with uncompressed layers
#!/usr/bin/env python3
import os
import subprocess
import requests
import json
import gzip
import hashlib
SOURCE_IMAGE = 'docker://alpine:latest'
@tsaarni
tsaarni / 01-README.md
Last active September 5, 2023 04:56
Running Kubernetes with Kind
@tsaarni
tsaarni / README.md
Last active September 17, 2020 06:08
Manual test procedure for client cert authentication for backend TLS
@tsaarni
tsaarni / make-client-auth-invisible.patch
Created March 18, 2020 07:13
disabling external client cert validation
diff --git a/apis/projectcontour/v1/httpproxy.go b/apis/projectcontour/v1/httpproxy.go
index 2c7a323d..5ee30820 100644
--- a/apis/projectcontour/v1/httpproxy.go
+++ b/apis/projectcontour/v1/httpproxy.go
@@ -120,12 +120,12 @@ type TLS struct {
// backing cluster.
// +optional
Passthrough bool `json:"passthrough,omitempty"`
- // ClientValidation defines how to verify the client certificate. This setting:
- // 1. Enables TLS client certificate validation.