Skip to content

Instantly share code, notes, and snippets.

Avatar
🦃
fast and loose is still fast.

Brandon bgulla

🦃
fast and loose is still fast.
  • Rancher Federal
  • Virginia
View GitHub Profile
@bgulla
bgulla / speed_results.md
Last active Aug 21, 2021
Tests related to storing proxmox vms on a synology NFS over 10G
View speed_results.md

Speed-testing proxmox vms hosted on a Synology DS1821+ NFS over 10G

fio

rm fio-tempfile.dat; fio --name TEST --eta-newline=5s --filename=fio-tempfile.dat --rw=write --size=500m --io_size=10g --blocksize=1024k --ioengine=libaio --fsync=10000 --iodepth=32 --direct=1 --numjobs=1 --runtime=60 --group_reporting
# Note: if you dont delete an existing fio-template.dat, it will reuse the file and report corrupted speed tests (1150 vs 635)

Results

View hostnamehelper.sh
#!/bin/bash
## helper script to more easily personalize cloned virtual-machines. add to your bashrc.
## on login, it will test the hostname and if localhost is determined to be a part of the hostname,
## this script will offer to fix that for you.
if [[ $(hostname -s) = localhost* ]]; then
read -p "[!!!] it seems you are still using localhost, would you like to set the hostname? (y/n) " choice
if [[ "${choice}" -eq "y" ]]; then
read -p " new hostname: " newhostname
# set new hostname
@bgulla
bgulla / rancher_mcm_classification_crd.yaml
Created Apr 30, 2021
Rancher Classification Banner CRD
View rancher_mcm_classification_crd.yaml
apiVersion: management.cattle.io/v3
customized: false
default: '{}'
kind: Setting
metadata:
name: ui-banners
value: |-
{
"banner": {
"text": "CLOUD-GOV"
@bgulla
bgulla / rke2_k3s_external_container_runtime.md
Last active Jul 14, 2021
Instructions for running RKE2/K3s with an external CRI/container-runtime
View rke2_k3s_external_container_runtime.md

k3s/RKE2 with external CRI/containerd support

While k3s and RKE2 ship with their own statically-compiled containerd binary, sometimes you need to be able to utilize a more standard container socket. Especially if your container-scanner expects a more traditional installation path (i.e. Twistlock/PrismaCloud). This quick guide will show you how to get up and running with an external CRI.

Install containerd

There are better ways to do this, but the most common way of installing containerd is via the docker-ce yum repository.

sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
@bgulla
bgulla / banner_harvester.jpg
Last active Aug 11, 2022
Proxmox Nested Virtualization Tutorial- Harvester/ESXI
@bgulla
bgulla / rke2_kubevip.md
Last active Jul 27, 2022
RKE2 api-server HA with Kube-VIP
View rke2_kubevip.md

On-Prem RKE2 api-server HA with Kube-VIP

               ,        ,  _______________________________
   ,-----------|'------'|  |                             |
  /.           '-'    |-'  |_____________________________|
 |/|             |    |    
   |   .________.'----'    _______________________________
   |  ||        |  ||      |                             |
   \__|'        \__|'      |_____________________________|
View gist:595865a742952a1e8f1ba8d6f92fe497
# _ _ _
# | | _____ _____(_) __| | ___
# | |/ _ \ \ /\ / / __| |/ _` |/ _ \
# | | (_) \ V V /\__ \ | (_| | __/
# |_|\___/ \_/\_/ |___/_|\__,_|\___|
#
# download images
wget https://github.com/rancher/rke2/releases/download/v1.18.13%2Brke2r1/rke2-images.linux-amd64.tar.gz
View rancher-mcm-svc.yaml
apiVersion: v1
kind: Service
metadata:
name: rancher-svc
namespace: kube-system
spec:
type: LoadBalancer
ports:
- port: 443
protocol: TCP
View rancher-mcm-install-airgap.sh
#!/bin/bash
# create the cattle-system namespace
kubectl create ns cattle-system
# Setup the certificate-authority
cp ./certs/ca.crt /tmp/cacerts.pem
kubectl -n cattle-system create secret generic tls-ca \
--from-file=cacerts.pem=/tmp/cacerts.pem