Skip to content

Instantly share code, notes, and snippets.

@juan-lee
juan-lee / helm-install.sh
Created August 22, 2018 04:42
AKS Prometheus Helm Chart Values
#!/bin/bash
helm upgrade prometheus stable/prometheus --install --namespace prometheus -f prometheus-values.yaml
@juan-lee
juan-lee / grafana-values.yaml
Created August 22, 2018 04:44
AKS Grafana Helm Chart Values
rbac:
create: false
## Node labels for pod assignment
## ref: https://kubernetes.io/docs/user-guide/node-selection/
#
nodeSelector: {}
## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
@juan-lee
juan-lee / dashboard.json
Created August 22, 2018 04:48
AKS Grafana Dashboard
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@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
@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
# 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,
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
#!/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]
*
#!/bin/bash
echo "running in $(pwd)" > /tmp/script_output