Skip to content

Instantly share code, notes, and snippets.

View hexfusion's full-sized avatar
🐀
scampering

Sam Batschelet hexfusion

🐀
scampering
View GitHub Profile
@hexfusion
hexfusion / azure_throttling_metrics.sh
Last active November 5, 2020 13:56
azure metrics query and graph with chartjs
#!/bin/bash
#set -x
# usage example
# ./script.sh \
# /subscriptions/8XXXba4b-XXXX-446a-XXXX-a9XXXXXe3d/resourceGroups/SBATSCHE-METRICS-2020-NSW5W-RG/providers/Microsoft.Compute/virtualMachines/sbatsche-metrics-2020-nsw5w-master-0 \
# date +%FT%TZ -d "3 day ago" \
# date +%FT%TZ -d "2 day ago"
if ! command -v az &> /dev/null
#!/bin/bash
choice=$(oc get --namespace openshift-etcd --selector etcd pods -o json | jq -r '.items[] | .spec.nodeName + " " + (.status.containerStatuses[] | select(.name=="etcd") | .containerID[8:])' | fzf)
IFS=' ' read node container_id <<< "$choice"
pid=$(oc debug --quiet nodes/$node -- chroot /host crictl inspect -o go-template --template '{{.info.pid}}' $container_id)
oc debug --quiet nodes/$node -- chroot /host strace -Tfe inject=fdatasync:delay_enter=800000 -e trace=fdatasync -p $pid
#!/usr/bin/env bash
function queue() {
local TARGET="${1}"
shift
local LIVE
LIVE="$(jobs | wc -l)"
while [[ "${LIVE}" -ge 45 ]]; do
sleep 1
LIVE="$(jobs | wc -l)"
test upgrade openshift/cluster-version-operator#411 4.6.0-0.ci gcp
master-logs etcd etcd &> log
---
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
creationTimestamp: null
labels:
machineconfiguration.openshift.io/role: master
name: 10-master-etcd
spec:
config:
@hexfusion
hexfusion / atop-monitor.yml
Last active August 12, 2020 19:46
atop monitor in machineconfig
---
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
creationTimestamp: null
labels:
machineconfiguration.openshift.io/role: master
name: 10-atop-monitor
spec:
config:
mkdir etcd-storage-disk
cd $!
openshift-install create manifests
vi openshift/99_openshift-machineconfig_99-worker-ssh.yaml
openshift-install create ignition-configs
openshift-install create install-config
OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=$release openshift-installer create cluster --log-level debug
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@hexfusion
hexfusion / debug-etcd-operator.sh
Last active October 30, 2020 12:34 — forked from ironcladlou/debug-etcd-operator.sh
debug-etcd-operator.sh
#!/bin/bash
set -euo pipefail
function log {
local msg="$1"
echo -e "$\033[32m$(date +'%Y-%m-%d %H:%M:%S') $1 $\033[0;39m"
}
export KUBECONFIG=$(find $HOME/clusters -name kubeconfig | fzf)