Skip to content

Instantly share code, notes, and snippets.

@hunzo
hunzo / cleanup-kubernetes.sh
Created July 5, 2024 01:51
Cleanup Kubernetes(k8s)
#!/bin/bash
sudo kubeadm reset
sudo rm -rf ~/.kube
sudo rm -rf /etc/cni /etc/kubernetes rm -f /etc/apparmor.d/docker /etc/systemd/system/etcd*
sudo rm -rf /var/lib/dockershim /var/lib/etcd /var/lib/kubelet \
/var/lib/etcd2/ /var/run/kubernetes
sudo iptables -F && sudo iptables -X
@hunzo
hunzo / clear-ceph.sh
Last active June 28, 2024 03:43
clear ceph
#!/bin/bash
systemctl stop ceph-mon.target
systemctl stop ceph-mgr.target
systemctl stop ceph-mds.target
systemctl stop ceph-osd.target
rm -rf /etc/systemd/system/ceph*
killall -9 ceph-mon ceph-mgr ceph-mds
rm -rf /var/lib/ceph/mon/ /var/lib/ceph/mgr/ /var/lib/ceph/mds/
pveceph purge
apt purge ceph-mon ceph-osd ceph-mgr ceph-mds -y
@hunzo
hunzo / k3s.md
Last active July 3, 2024 03:08
install K3s with metallb and nginx-ingress

Install K3s with metallb and nginx-ingress

server ip role
k3s-control.dev.local 192.168.1.100 control-plane
k3s-node-01.dev.local 192.168.1.101 node-01

Setup control-plane

  • disable traefik, servicelb
@hunzo
hunzo / readme.md
Last active May 16, 2024 08:27
proxmox mornitor with influxdb and grafana

Proxmox monitor with influxdb and grafana

grafana dashboard id: 15356

  • grafana default user/password: admin/admin
services:
  influxdb:
    image: influxdb:2
    volumes:
      - influxdb-storage:/var/lib/influxdb
 restart: always
@hunzo
hunzo / create-cloud-init-template.sh
Last active May 18, 2024 07:56
proxmox example cloud-init script
#! /bin/bash
VMID=9001
STORAGE=ZFS-SSD
set -x
# rm -f noble-server-cloudimg-amd64.img
# wget -q https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
@hunzo
hunzo / readme.md
Last active May 2, 2024 02:09
error : Device or resource busy #proxmox

proxmox

error : Device or resource busy

  • message
device-mapper: create ioctl on vg--netapp--san-vm--100--disk--0 LVM-CKN6VK2dSf8ZV3zz7JYFQXrKZyXitVSJZPE2dPaoMJsEmW0kCupDZrwlLr2HRAv1 failed: Device or resource busy
  • check device
root@pve-01:~# dmsetup table
netapp-lun: 0 8589934592 multipath 3 queue_if_no_path pg_init_retries 50 1 alua 2 1 round-robin 0 2 1 8:32 1 8:64 1 round-robin 0 2 1 8:16 1 8:48 1
@hunzo
hunzo / readme.md
Created May 1, 2024 05:50
python requests call https
import requests
import urllib3

urllib3.disable_warnings()  # Disable Warnning "InsecureRequestWarning"

URL = "https://httpbin.org/get"

ret = requests.get(URL, verify=False)
@hunzo
hunzo / pve-delete-cluster.md
Last active April 27, 2024 08:52
proxmox delete cluster

force delete pve-cluster

pvecm expected 1
  • stop cluster
systemctl stop pve-cluster
  • force run cluster local mode
@hunzo
hunzo / pve-san-multipath.md
Last active April 29, 2024 05:35
connect san with proxmox

SAN FC Multipath configuration

install multipath-tools

apt-get update
apt-get install multipath-tools lsscsi multipath-tools-boot

list wwids get wwwid

lsscsi -i -s
@hunzo
hunzo / .env
Last active April 25, 2024 04:05
pgadmin
POSTGRES_READY=0
POSTGRES_DB=djangoDB
POSTGRES_PASSWORD=pgPassword
POSTGRES_USER=pgUser
POSTGRES_HOST=localhost
POSTGRES_PORT=5431