Skip to content

Instantly share code, notes, and snippets.

View rootfs's full-sized avatar
🎯
Focusing

Huamin Chen rootfs

🎯
Focusing
View GitHub Profile

Microshift

Storage provisioner

cat << EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolume
metadata:
  name: hostpath-provisioner

Background

Using podman to start containerized microshift can ensure timely image update to pick up the latest Microshift release. Additionally, using crio service on host allows workload continunity during Microshift upgrade.

image

Start containerized microshift

podman run --privileged --ipc=host --network=host  \

Environment

RHEL 8.4 4.18.0-305.19.1.el8_4.x86_64

Verify setup

lspci -nnv |grep -i nvidia

e.g.

Containerized

On MacBook

Single Containerized microshift cluster on MacBook

asciicast

Two clusters on a MacBook

asciicast

On Windows 10

@rootfs
rootfs / Windows-qemu-KVM.10.xml
Created January 31, 2021 22:04
Windows 10 qemu/kvm optimizations CPU usage #virt-manager
<domain type="kvm">
<!-- https://www.reddit.com/r/VFIO/comments/80p1q7/high_kvmqemu_cpu_utilization_when_windows_10/ -->
<!-- https://github.com/duncanthrax/scream -->
<!-- https://gitlab.com/YuriAlek/vfio -->
<!-- https://github.com/PiMaker/Win10-VFIO -->
<!-- https://gitlab.com/YuriAlek/vfio -->
<!-- https://github.com/sk1080/nvidia-kvm-patcher -->
<!-- https://github.com/T-vK/MobilePassThrough -->
#!/usr/bin/env bash
set -e
CONFIG=${CONFIG:-cluster_config.sh}
if [ ! -r "$CONFIG" ]; then
echo "Could not find cluster configuration file."
echo "Make sure $CONFIG file exists in the shiftstack-ci directory and that it is readable"
exit 1
fi
@rootfs
rootfs / kubernetes_add_service_account_kubeconfig.sh
Created October 2, 2019 23:26 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi

First run

# kubectl -n default logs -c build-step-node-ftl steren-sample-function-v29fs-6s4bj
2018-06-22,14:40:57.207 INFO     Loading Docker credentials for repository 'launcher.gcr.io/google/nodejs:latest'
2018-06-22,14:40:57.207 INFO     Loading Docker credentials for repository 'gcr.io/openshift-gce-devel/kn/sample-fn:latest'
2018-06-22,14:41:27.238 INFO     builder initialization took 30 seconds
2018-06-22,14:41:27.239 INFO     full build took 30 seconds
Traceback (most recent call last):
  File "/app/ftl/node_builder_image.binary.runfiles/__main__/ftl/node/main.py", line 54, in <module>
    main(sys.argv[1:])

add python site

export PYTHONPATH=${PYTHONPATH}:/usr/lib64/python3.6

install cuda and nvdia driver

dnf config-manager --add-repo=http://negativo17.org/repos/fedora-nvidia.repo
# yum-config-manager --add-repo=http://negativo17.org/repos/epel-nvidia.repo
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: slow
provisioner: kubernetes.io/azure-file
parameters:
skuName: Standard_LRS
location: eastus
secretnamespace: azure-file-ns
---