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
@mhausenblas
mhausenblas / README.md
Last active March 13, 2023 18:33
AMP for EKS on Fargate

Create cluster:

eksctl create cluster -f cluster-config.yaml

Install Prometheus:

helm install prometheus-for-amp prometheus-community/prometheus \
@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 / main.go
Created April 21, 2017 09:42
A simple Go program for interacting with a Kubernetes cluster
package main
import (
"flag"
"fmt"
"github.com/chzyer/readline"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/clientcmd"
@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)
@mhausenblas
mhausenblas / SparkGrep.scala
Created February 8, 2015 16:07
Scala Spark skeleton implementing grep
package spark.example
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
import org.apache.spark.SparkConf
object SparkGrep {
def main(args: Array[String]) {
if (args.length < 3) {
System.err.println("Usage: SparkGrep <host> <input_file> <match_term>")
@mhausenblas
mhausenblas / cli-fu.md
Created July 5, 2018 13:30
Michael's bash snippets
@mhausenblas
mhausenblas / README.md
Created August 27, 2017 08:36
Doing Kubernetes The Hard Way, A Walkthrough
@mhausenblas
mhausenblas / README.md
Last active September 25, 2021 17:00
Scripting EKS on ARM

EKS on Arm

The xarm-install-graviton2.sh script allows you to install and use Amazon EKS on Arm (xARM) with a single command. In essence, it automates the steps described in the docs.

Make sure you have aws, eksctl, kubectl, and jq installed, this will be checked on start-up and the script will fail if these deps are not present. So far tested with bash on macOS.

$ chmod +x xarm-install-graviton2.sh
$ ./xarm-install-graviton2.sh
@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"}
AZ,Availability Zone
ASG,Auto Scaling Group
EBS,Elastic Block Store
ENI,Elastic Network Interface
EIP,Elastic IP
IGW,Internet Gateway
CM,AWS Certificate Manager
ADS,Application Discovery Service
GWY,Amazon API Gateway
GWYv2,Amazon API Gateway V2