Skip to content

Instantly share code, notes, and snippets.

@juan-lee
juan-lee / patch-irqbalance.yaml
Last active November 16, 2023 14:48
patch irqbalance 1.8.0 with commit 2a66a666d3e202dec5b1a4309447e32d5f292871
# Upgrade to node image 202310.19.2 or later
#!/bin/bash
# optional argument handling
if [[ "$1" == "version" ]]
then
echo "1.0.0"
exit 0
fi
if [ -z "$1" ]; then
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
component: osdisk-optimizer
name: osdisk-optimizer
namespace: kube-system
spec:
selector:
matchLabels:
#!/bin/bash
echo "running in $(pwd)" > /tmp/script_output
#!/usr/bin/env bpftrace
/*
* ext4slower Summarize ext4 operation latency.
* For Linux, uses bpftrace and eBPF.
*
* This traces four common file system calls: read, write, open, and fsync.
* It can be customized to trace more if desired.
*
* USAGE: ext4dist.bt [min_us]
*
export EVENTHUB_RESOURCE_GROUP=my-eventrouter
export EVENTHUB_NAMESPACE=my-eventrouter-ns
export EVENTHUB_NAME=my-eventrouter
export EVENTHUB_REGION=westus2
export EVENTHUB_RULE_NAME=eventrouter-send
az group create -g ${EVENTHUB_RESOURCE_GROUP} -l ${EVENTHUB_REGION}
az eventhubs namespace create -g ${EVENTHUB_RESOURCE_GROUP} -n ${EVENTHUB_NAMESPACE} -l ${EVENTHUB_REGION}
az eventhubs eventhub create -g ${EVENTHUB_RESOURCE_GROUP} --namespace-name ${EVENTHUB_NAMESPACE} -n ${EVENTHUB_NAME}
az eventhubs eventhub authorization-rule create -g ${EVENTHUB_RESOURCE_GROUP} --namespace-name ${EVENTHUB_NAMESPACE} --eventhub-name ${EVENTHUB_NAME} -n ${EVENTHUB_RULE_NAME} --rights Send
# Copyright 2017 Heptio Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@juan-lee
juan-lee / npd.yaml
Last active November 18, 2019 03:03
apiVersion: v1
kind: ServiceAccount
metadata:
name: node-problem-detector
namespace: kube-system
labels:
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
---
apiVersion: rbac.authorization.k8s.io/v1
@juan-lee
juan-lee / docker-monitor.service
Last active September 3, 2018 17:10
AKS Node Health Monitor
[Unit]
Description=Kubernetes health monitoring for container runtime
After=kube-master-configuration.service
[Service]
Restart=always
RestartSec=10
RemainAfterExit=yes
RemainAfterExit=yes
ExecStartPre=/bin/chmod 544 /usr/local/bin/health-monitor.sh
ExecStart=/usr/local/bin/health-monitor.sh container-runtime