Skip to content

Instantly share code, notes, and snippets.

View cardil's full-sized avatar

Chris Suszynski cardil

View GitHub Profile
@cardil
cardil / serverless-chaostest.sh
Last active September 10, 2021 09:18
This is a prototype of a Serverless Operator chaos test, suited directly to check for SRVKE-927, (looking for failures different then SRVKE-911)
#!/usr/bin/env bash
set -Eexuo pipefail
if ! [ -d serverless-operator ]; then
git clone https://github.com/cardil/serverless-operator.git --branch srvke-927
fi
cd serverless-operator
env SYSTEM_NAMESPACE=knative-serving \
@cardil
cardil / heartbeats-cronjob.yml
Created September 3, 2021 21:52
Example of cronjob that sends CloudEvents to K_SINK
apiVersion: batch/v1
kind: CronJob
metadata:
name: heartbeat-cron
spec:
# Run every minute
schedule: "*/1 * * * *"
jobTemplate:
metadata:
labels:
func waitForUser() pkgupgrade.BackgroundOperation {
file, err := homedir.Expand(
fmt.Sprintf("~/.cache/waitForUser-%s.sock", uuid.NewString()),
)
ensure.NoError(err)
var mod time.Time
check := func() (bool, error) {
res, err := os.Stat(file)
if err != nil {
return false, err
@cardil
cardil / remote-sleep.go
Created January 29, 2021 12:51
Reporduction for Wathola sender is affected by Coordinated Omission Problem
package main
import (
"fmt"
"html"
"log"
"net/http"
"time"
)
@cardil
cardil / cumbersome.sh
Last active October 21, 2020 17:27
Invalid & convoluted Bash scripting fixed
#!/usr/bin/env bash
set -Eeuo pipefail
function testing.of() {
local what
what="${1:?Pass what as arg[1]}"
echo "Testing of ${what}..."
eval "non-existing-showcase-command ${what}"
@cardil
cardil / fedora-k8s-shell.yml
Last active August 19, 2025 13:07
Fedora 42 shell for K8s
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: shell-cluster-admin
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: shell-cluster-admin
@cardil
cardil / stress-revisions.sh
Last active May 5, 2020 17:02
Test that stress large number of Serverless revisions
#!/bin/bash
set -Eeuo pipefail
readonly START="${START:-1}"
readonly LIMIT="${LIMIT:-1200}"
for NUM in $(seq "${START}" "$LIMIT"); do
oc apply -f - <<EOF
apiVersion: serving.knative.dev/v1
@cardil
cardil / README.md
Last active January 17, 2020 17:51
Eventing #2388 manual reproduction

Eventing knative/eventing#2388 manual reproduction

I've manage to reproduce errors on a GCP Kubernetes cluster identical to the one used in Prow.

Below are test results. There ware 10 lost events, 505 total.

In other files are errors that I've noticed, and fetched with Stackdriver Log Viewer UI.

020-01-17T17:47:26.585+0100	INFO	prober/verify.go:35	Fetched receiver report. Events propagated: 495. State: failed
2020/01/03 14:36:38 Registering 5 clients
2020/01/03 14:36:38 Registering 2 informer factories
2020/01/03 14:36:38 Registering 3 informers
{"level":"info","ts":"2020-01-03T14:36:38.541Z","caller":"logging/config.go:108","msg":"Successfully created the logger.","knative.dev/jsonconfig":"{\n \"level\": \"info\",\n \"development\": false,\n \"outputPaths\": [\"stdout\"],\n \"errorOutputPaths\": [\"stderr\"],\n \"encoding\": \"json\",\n \"encoderConfig\": {\n \"timeKey\": \"ts\",\n \"levelKey\": \"level\",\n \"nameKey\": \"logger\",\n \"callerKey\": \"caller\",\n \"messageKey\": \"msg\",\n \"stacktraceKey\": \"stacktrace\",\n \"lineEnding\": \"\",\n \"levelEncoder\": \"\",\n \"timeEncoder\": \"iso8601\",\n \"durationEncoder\": \"\",\n \"callerEncoder\": \"\"\n }\n}"}
{"level":"info","ts":"2020-01-03T14:36:38.541Z","caller":"logging/config.go:109","msg":"Logging level set to info"}
{"level":"info","ts":"2020-01-03T14:36:38.541Z","caller":"logging/config.go:76","msg":"Fetch
@cardil
cardil / knative-serving-operator.log
Created November 26, 2019 18:09
knative-serving-operator.log
{"level":"info","ts":1574791351.2938538,"logger":"cmd","msg":"Go Version: go1.13.4"}
{"level":"info","ts":1574791351.2938857,"logger":"cmd","msg":"Go OS/Arch: linux/amd64"}
{"level":"info","ts":1574791351.2938917,"logger":"cmd","msg":"Version of operator-sdk: v0.8.0"}
{"level":"info","ts":1574791351.2943332,"logger":"leader","msg":"Trying to become the leader."}
{"level":"info","ts":1574791351.4278533,"logger":"leader","msg":"No pre-existing lock was found."}
{"level":"info","ts":1574791351.4339006,"logger":"leader","msg":"Became the leader."}
{"level":"info","ts":1574791351.5361984,"logger":"cmd","msg":"Registering Components."}
{"level":"info","ts":1574791351.536406,"logger":"manifestival","msg":"Reading file","name":"deploy/resources"}
{"level":"info","ts":1574791351.552737,"logger":"openshift","msg":"Detected","gvk":"route.openshift.io/v1, Kind=route"}
{"level":"info","ts":1574791351.5529993,"logger":"openshift","msg":"Dropping APIService for v1beta1.custom.metrics.k8s.io"}