Skip to content

Instantly share code, notes, and snippets.

View galexrt's full-sized avatar

Alexander Trost galexrt

View GitHub Profile
fs.aio_max_nr = 1048576
fs.file-max = 2097152
fs.inotify.max_user_instances = 5120
fs.inotify.max_user_watches = 1572864
fs.nr_open = 3145728
fs.suid_dumpable = 0
kernel.core_uses_pid = 1
kernel.dmesg_restrict = 1
kernel.exec-shield = 2
kernel.panic_on_oops = 1
@galexrt
galexrt / ceph-mgr-failover.log
Created June 2, 2018 11:18
The new active mgr gets stuck in `active, starting`.
+ rook-ceph-mgr0-7fd45d88f5-w59tt › rook-ceph-mgr0
rook-ceph-mgr0-7fd45d88f5-w59tt rook-ceph-mgr0 2018-06-02 11:15:00.480868 I | rookcmd: starting Rook v0.7.0-163.g5d1d3b5a with arguments '/usr/local/bin/rook mgr --config-dir=/var/lib/rook'
rook-ceph-mgr0-7fd45d88f5-w59tt rook-ceph-mgr0 2018-06-02 11:15:00.480962 I | rookcmd: flag values: --admin-secret=*****, --ceph-config-override=/etc/rook/config/override.conf, --cluster-name=rook, --config-dir=/var/lib/rook, --fsid=, --help=false, --log-level=INFO, --mgr-keyring=AQDOXhJba4L5LBAADDhc0csZbyOME5RfzvALvg==, --mgr-name=rook-ceph-mgr0, --mon-endpoints=rook-ceph-mon0=10.96.149.29:6790,rook-ceph-mon1=10.108.88.252:6790,rook-ceph-mon2=10.101.36.178:6790, --mon-secret=*****, --private-ipv4=172.17.0.8, --public-ipv4=172.17.0.8
rook-ceph-mgr0-7fd45d88f5-w59tt rook-ceph-mgr0 2018-06-02 11:15:00.480972 I | cephmon: parsing mon endpoints: rook-ceph-mon0=10.96.149.29:6790,rook-ceph-mon1=10.108.88.252:6790,rook-ceph-mon2=10.101.36.178:6790
rook-ceph-mgr0-7fd45d88f5-w59tt
@galexrt
galexrt / crio.ini
Last active May 26, 2019 21:55
My current CRI-O config file. The first file name is actually `crio.conf`, the gist file extension is `ini` to allow for the "correct" syntax highlighting to be applied. The second file is `/etc/containers/policy.json`. See https://edenmal.moe/2018/03/09/CRI-O-Container-Linux-How-to-Install/#Step-4-Configure-CRI-O.
# The CRI-O configuration file specifies all of the available configuration
# options and command-line flags for the crio(8) OCI Kubernetes Container Runtime
# daemon, but in a TOML format that can be more easily modified and versioned.
#
# Please refer to crio.conf(5) for details of all configuration options.
# CRI-O reads its storage defaults from the containers-storage.conf(5) file
# located at /etc/containers/storage.conf. Modify this storage configuration if
# you want to change the system's defaults. If you want to modify storage just
# for CRI-O, you can change the storage configuration options here.
@galexrt
galexrt / ceph-reboot-status-check.sh
Last active March 2, 2018 09:58
Improved version of the ceph reboot status check script from [rook/rook - Pull Request: Added ceph-reboot-script using the Container Linux Update Operator #1492](https://github.com/rook/rook/pull/1492).
#!/bin/bash
# preflightCheck checks for existence of "dependencies"
preflightCheck() {
if [ ! -f "/var/run/secrets/kubernetes.io/serviceaccount/token" ]; then
echo "$(date) | No Kubernetes ServiceAccount token found."
exit 1
fi
}
apiVersion: rook.io/v1alpha1
kind: Cluster
metadata:
name: rook
namespace: rook
spec:
versionTag: master
dataDirHostPath: /var/lib/rook/config
hostNetwork: true
monCount: 3
@galexrt
galexrt / hb_all_books_dl.js
Last active January 17, 2020 12:22 — forked from kfatehi/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
this fork downloads all formats and does so without using jquery (since that didnt work for me)
note that if you are in chrome, chrome will not download the pdfs for you by default, to fix this
type “about:plugins” in the address bar and disable chrome's pdf viewer
*/
var pattern = /(ZIP|MOBI|EPUB.*|PDF|PDF( ?\(H.\))?|CBZ|PRC|Download|Supplement)$/i;
@galexrt
galexrt / k8s_backitup.sh
Created February 3, 2018 14:08
A bash script using jq to backup a Kubernetes cluster. I recommend using a tool like heptio/ark for K8s backups/disaster recovery.
#!/bin/bash
RESSOURCE_IGNORE="^(namespaces|pods|events|nodes|clusters|storageclasses|thirdpartyresources|clusterrolebindings|clusterroles|componentstatuses|persistentvolumes)$"
echo "-> Getting namespaces ..."
kubectl get --export -o=json ns | \
jq '.items[] |
select(.metadata.name!="kube-system") |
select(.metadata.name!="default") |
del(.status,
@galexrt
galexrt / ceph-mon-recovery.md
Last active April 5, 2018 20:20
A WIP doc page on Ceph Mon recovery when running Rook.

Rook <= 0.7.0 mon hostNetwork: true node IP issue

NOTE If you need assistance with steps 3 through 5, let us know on the Rook Slack and we are happy to help you.

WARNING You should not have to go through this section when having hostNetwork: false (or haven't even set it)! WARNING If you have/had multiple Filesystems created, this guide may not work for you because of a bug in Ceph that causes the mons to crash during the "FS Map" assertion.

  1. Scale rook-operator down (e.g. replicas: 0).
  2. Edit all rook-ceph-mon ReplicaSets to have command: ['sleep', '3600'] in the mon container, but copy the other args and command values somewhere safe for each mon.
  3. Exec into the first mon and run: monmap --print /var/lib/rook/rook-ceph-mon-$MON_ID/monmap.
  • Where MON_ID is the ID of the mon you execed into.
@galexrt
galexrt / with-fs-and-normal-pool
Last active December 28, 2017 20:53
Rook Ceph Mgr Metrics Output
# HELP ceph_mds_cache_recovery_completed File recoveries completed
# TYPE ceph_mds_cache_recovery_completed counter
ceph_mds_cache_recovery_completed{ceph_daemon="mds.mhgmp2"} 0.0
ceph_mds_cache_recovery_completed{ceph_daemon="mds.m7dwwf"} 0.0
# HELP ceph_osd_op_out_bytes Client operations total read size
# TYPE ceph_osd_op_out_bytes counter
ceph_osd_op_out_bytes{ceph_daemon="osd.0"} 5477.0
# HELP ceph_pg_incomplete PG incomplete
# TYPE ceph_pg_incomplete gauge
@galexrt
galexrt / rook-cluster.yaml
Last active July 16, 2018 11:45
CoreOS is used for the nodes. Every node has sda10 mounted to /var/lib/rook and sdb empty used as a whole. The nodes have been labelled according to the placements.
apiVersion: rook.io/v1alpha1
kind: Cluster
metadata:
name: rook
namespace: rook
spec:
versionTag: master
dataDirHostPath: /var/lib/rook-config
# toggle to use hostNetwork
hostNetwork: true