Skip to content

Instantly share code, notes, and snippets.

View mhausenblas's full-sized avatar
🤷‍♂️
weeks of coding can save you hours of planning!

Michael Hausenblas mhausenblas

🤷‍♂️
weeks of coding can save you hours of planning!
View GitHub Profile
- name: core-api-errors-sampling-policy
type: and
and:
and_sub_policy:
- name: error-policy
type: status_code
status_code:
status_codes:
- "ERROR"
- name: probabilistic-policy
@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@mhausenblas
mhausenblas / README.md
Last active July 30, 2022 16:34
Custom OpenTelemetry collector for system-level monitoring

Demo: Building a custom OpenTelemetry collector for system-level monitoring

In this demo we will build a custom OpenTelemetry collector and collect logs and metrics from the operating system.

Prerequisites:

  • You need Go in v1.17 or above locally installed.
  • socat
  • netstat
  • jq (optional, for nicer JSON output rendering)
@chaudum
chaudum / prometheus.vim
Created January 10, 2022 19:55
Prometheus metrics syntax for Vi/Vim/NeoVim
" Vim syntax file
" Language: Prometheus Metrics
" Maintainer: Christian Haudum
" Last Revision: 10 January 2022
"
if exists("b:current_syntax")
finish
endif
@mhausenblas
mhausenblas / eks-fargate-vertical-scaling.md
Created December 20, 2019 11:53
EKS on Fargate vertical scale testing

Using the official resource-consumer as a stress tester.

Setup

Using EKS on Fargate cluster in eu-west-1:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.3", GitCommit:"b3cbbae08ec52a7fc73d334838e18d17e8512749", GitTreeState:"clean", BuildDate:"2019-11-14T04:25:00Z", GoVersion:"go1.12.13", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.8-eks-b8860f", GitCommit:"b8860f6c40640897e52c143f1b9f011a503d6e46", GitTreeState:"clean", BuildDate:"2019-11-25T00:55:38Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
@mhausenblas
mhausenblas / README.md
Last active January 25, 2023 15:14
Fluent Bit log forwarding to CloudWatch

Set Up Fluent Bit as a DaemonSet to Send Logs to CloudWatch

Create a new 1.13 or 1.14 EKS cluster called container-insights.

Enable IRSA:

eksctl utils associate-iam-oidc-provider \
               --name container-insights \
               --approve
@mhausenblas
mhausenblas / README.md
Created August 31, 2018 07:59
Red Hat's OpenShift innovations
  • Kubernetes RBAC --> largely based on OpenShift RBAC
  • Kubernetes Pod Security Policy --> largely based on OpenShift Security Context Constraints
  • Kubernetes Ingress --> preceded by OpenShift Routes
  • Kubernetes Deployments --> preceded by OpenShift Deployment Config
  • Network Policy --> preceded by OpenShift Multi-tenant SDN
@mhausenblas
mhausenblas / README.md
Created April 4, 2018 14:02
Developing apps on Kubernetes

Developing apps on Kubernetes

2018-04-04 at CNCF Paris

How do you develop a Kubernetes app, that is, how do you write and test an app that is supposed to run on Kubernetes? In this talk Michael will discuss the challenges as well as review potential tools (incl. Telepresence, ksync, and kubed-sh) you want to be aware of to successfully write Kubernetes apps.

The demo app used throughout here is kubernauts/dok-example-us.

@tallclair
tallclair / git-repo-demo.yaml
Created March 9, 2018 19:54
More secure GitRepo volumes
# Example of using an InitContainer in place of a GitRepo volume.
# Unilke GitRepo volumes, this approach runs the git command in a container,
# with the associated hardening.
apiVersion: v1
kind: Pod
metadata:
name: git-repo-demo
annotations:
seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
spec:
@ashfame
ashfame / deploy-all-lambdas.sh
Last active February 25, 2018 18:27
Bash script to deploy lambdas to all regions using Up - https://blog.ashfame.com/?p=1288
#!/usr/bin/env bash
declare -a regions=(
us-east-2 #US East (Ohio)
us-east-1 #US East (N. Virginia)
us-west-1 #US West (N. California)
us-west-2 #US West (Oregon)
ap-northeast-1 #Asia Pacific (Tokyo)
ap-northeast-2 #Asia Pacific (Seoul)
ap-south-1 #Asia Pacific (Mumbai)