Skip to content

Instantly share code, notes, and snippets.

View mateiidavid's full-sized avatar
🦖
Focusing

Matei David mateiidavid

🦖
Focusing
View GitHub Profile
@mateiidavid
mateiidavid / Resources.md
Created January 16, 2020 13:33
UoB Machine Learning mathematics study

Math Resources


For CS and Artificial Intelligence

  • Mathematics for Machine Learning
    • Books for Machine Learning mathematics:
    - https://mml-book.github.io/ — mathematics for machine learning, focuses on linear algebra, analytical geometry as a foundation part, second half of the book includes central machine learning problems such as support vector machines and linear regression. Free to use & download
    - http://cs229.stanford.edu/section/cs229-linalg.pdf  http://cs229.stanford.edu/section/cs229-prob.pdf — lecture notes from the machine learning Stanford course. The first PDF is focused on linear algebra, the second on probability theory. These are meant as a review/reference point, not as an in-depth explanation
    - https://gwthomas.github.io/docs/math4ml.pdf — another book focused on mathematics needed for ML
    
LAST SEEN TYPE REASON OBJECT SUBOBJECT SOURCE MESSAGE FIRST SEEN COUNT NAME
3m37s Normal Pulled pod/linkerd-service-mirror-east-5fbb55d8b8-542ns spec.containers{service-mirror} kubelet, gke-west-1-default-pool-2bb2c312-v8l3 Container image "docker.io/matei207/controller:git-f4f62e79" already present on machine 6h8m 60 linkerd-service-mirror-east-5fbb55d8b8-542ns.1624161ff068415e
8m43s Warning BackOff pod/linkerd-service-mirror-east-5fbb55d8b8-542ns spec.containers{service-mirror} kubelet, gke-west-1-default-pool-2bb2c312-v8l3 Back-off restarting failed container 6h5m 1250 linkerd-service-mirror-east-5fbb55d8b8-542ns.162416522cb7a021
@mateiidavid
mateiidavid / gist:50eb3d52737b976e5ed3968ce57b1041
Created July 22, 2020 19:56
Service Mirror Controller Logs
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
A future release of golang/protobuf will delete this package,
which has long been excluded from the compatibility promise.
time="2020-07-22T19:48:36Z" level=info msg="running version git-cb24531c"
I0722 19:48:36.617038 1 merged_client_builder.go:122] Using in-cluster configuration
I0722 19:48:36.638117 1 merged_client_builder.go:122] Using in-cluster configuration
time="2020-07-22T19:48:36Z" level=info msg="waiting for caches to sync"
time="2020-07-22T19:48:36Z" level=info msg="starting admin server on :9999"
I0722 19:48:36.643299 1 reflector.go:150] Starting reflector *v1.Namespace (10m0s) from pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:105
@mateiidavid
mateiidavid / kind-topology-config.yaml
Created July 29, 2020 17:25
Kind cluster with ServiceTopology&EndpointSlices feature gates + different node topologies
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
featureGates:
EndpointSlice: true
EndpointSliceProxying: true
ServiceTopology: true
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
@mateiidavid
mateiidavid / linkerd-svc-topology-tutorial.md
Last active September 25, 2020 09:23
How to test out Linkerd + Service topology in a kind cluster!

Linkerd service topology tutorial

Hi, hopefully you have watched my monthly community meet-up presentation on how to use service topology in Linkerd. This is a quick guide that shows you how to set-up a kind cluster, install linkerd and then enable service topology for a service.

Prereqs:


At a minimum we need to have kubectl, linkerd-cli and kind installed. Click on the links to see install instructions.

@mateiidavid
mateiidavid / extension_list.yaml
Last active June 24, 2021 13:43
An example list to test extensions for Linkerd
extensions:
supported:
- description: "Viz stack for Linkerd"
doc_link: "https://github.com/linkerd/linkerd2/"
name: linkerd-viz
repo_link: "https://github.com/linkerd/linkerd2/"
- description: Multicluster
name: linkerd-multicluster
repo_link: "https://github.com/linkerd/linkerd2/"
thirdParty:
@mateiidavid
mateiidavid / pre-push.lua
Created January 14, 2022 10:26
Hacky Lua script to confirm any pushes to your main (or protected) git branch
#!/usr/bin/lua
--[[
+-------------------+
+ Lua pre-push hook +
+-------------------+
- Prompts user to confirm remote pushes when working on a
protected branch and pushing to a _protected_ branch.
- Can be installed locally or globally. I usually
@mateiidavid
mateiidavid / l5d-cilium-cni-repro.md
Created September 23, 2022 10:47
l5d-cilium-cni-repro

Linkerd CNI plugin event processing fix

Documenting a possible approach to debugging, fixing, and testing Linkerd's CNI plugin. Issue that we're dealing with is around chaining issues (#9343).

Problem statement: when a CNI plugin that runs in interface/standalone mode runs first (e.g Cilium), it will create a *.conf file. When Linkerd's CNI plugin is installed right after, it will append itself to the existing configuration file, and a new *.conflist file will be created.

The old *.conf file is not cleaned-up. Config file is elected based on alphabetical order; our current installation process will not work, since the *.conflist file will not be considered (*.conf < *.conflist so it gets picked first).

First, cluster creation

@mateiidavid
mateiidavid / dev-stats.sh
Last active December 15, 2022 11:35
Script to fetch linkerd-proxy logs and metrics for a set of Kubernetes pods with a common label value
#!/usr/bin/env bash
print_summary() {
local name="${0##*/}"
printf "Collect proxy-logs and diagnostics\n\nUsage:\n %2s ${name} --namespace name [--selector \"key=value\"] [--o /output/path]\n\n"
printf "Examples:\n"
printf "%2s#Collect logs and diagnostics for all pods in 'test'\n%2s${name} --namespace test\n\n"
printf "%2s#Collect logs and diagnostics for pods with 'app=test' label\n%2s${name} --namespace test --selector \"app=test\"\n\n"
printf "%2s#Output files in a different path\n%2s${name} --namespace 'test' --o /path/to/files\n\n"
printf "NOTE:\n%2s*%1sFiles will be named based on the pod and will include either a '.dg' or a '.log' extension\n%2s*%1sSelector supports only one k=v pair\n\n"

What problem are we trying to solve:

Certain workloads, such as databases, rely on headless services for discovery and for network operations. Headless services behave differently to normal clusterIP services. They do not do anything special, like representing a virtual IP, they just represent a convinience by which multiple pods can be associated.

Linkerd currently supports multicluster communication through headless services. This is also known as statefulset support (since most workloads that use a headless service are deployed as StatefulSets, the resource type provides a number of different guarantees).

The problem we have is that in a lot of cases, it is cumbersome to have a lot of different headless services that need to be passed to a StatefulSet. For example, let's say we have a cluster called source. In this cluster we have a database called my-cool-database. It has a service, database-cool-service. It will be passed as a CLI value: ./my-cool-database --discover database-cool-service.