Skip to content

Instantly share code, notes, and snippets.

@balamurugana
balamurugana / Replace drive workaround for DirectPV < 4.0.9.md
Last active May 24, 2024 04:53
Replace drive workaround for DirectPV < 4.0.9
  1. Run command $ kubectl edit directpvdrives <NEW-DRIVE-ID> and add directpv.min.io.volume/pvc-12345678 in the finalizer
  2. Run command $ kubectl directpv cordon <NEW-DRIVE-ID>
  3. Run command $ kubectl edit directpvdrives <NEW-DRIVE-ID> and remove the directpv.min.io.volume/pvc-12345678 finalizer
  4. Run command $ ./replace.sh <OLD-DRIVE-ID> <NEW-DRIVE-ID>
@balamurugana
balamurugana / DirectCSI Drive And Volume States.md
Created November 29, 2021 04:05
DirectCSI Drive And Volume States

Drive states

DriveStatusUnavailable

Drive CRD object is marked as Unavailable, if drive met one of the following condition at startup or added at runtime or dynamic discovery sync.

  • device size is less than 16 MiB.
  • device is in readonly state.
  • device contains partitions.
  • device is used as swap space in linux.
  • device is used in LVM, linux RAID or LUKS device.
  • device is mounted somewhere else i.e. outside of /var/lib/directcsi.
@balamurugana
balamurugana / Self-signed certificate setup for AssumeRoleWithCertificate.md
Last active September 15, 2023 20:16
Self-signed certificate setup for AssumeRoleWithCertificate

As MinIO needs the CN to have the policy name and original mkcert does not support this, download updated mkcert from https://github.com/kanagarajkm/mkcert/releases/download/v1.4.3-1/mkcert

Server certs

  1. Generate certificate files
mkcert localhost
  1. Copy generated localhost-key.pem and localhost.pem to certs directory of minio server.
cp -avi localhost-key.pem ~/.minio/certs/private.key
@balamurugana
balamurugana / find-drives.py
Last active May 30, 2021 07:05
Find drives and identify uniquely upon every run (execute by `sudo python find-drives.py`)
#!/usr/bin/python
import json
import os
import subprocess
def _read_file(filename):
try:
with open(filename) as file:
return file.read().strip()

DataStore

A lock-free storage which supports to upload, download and delete data using Get, Put and Delete respectively. Every Put uses tmp directory as interim storage and every Delete is staged and actual removal is done once all Get are finished.

DataStore
|-- data/

Setup Information:

  • 8 servers of t1.small.x86
  • minio version
Version: 2018-08-22T12:25:38Z
Release-Tag: DEVELOPMENT.2018-08-22T12-25-38Z
Commit-ID: 8601f29d95f2ad2055613bedcc917e692ffab5fd
  • mc version

Servers

Server1: minio server --address localhost:9001 https://localhost:9001/tmp/minio01/disk0{1..4} https://localhost:9002/tmp/minio02/disk0{1..4} https://localhost:9003/tmp/minio03/disk0{1..4} https://localhost:9004/tmp/minio04/disk0{1..2} https://localhost:9005/tmp/minio05/disk0{1..2}
Server2: minio server --address localhost:9002 https://localhost:9001/tmp/minio01/disk0{1..4} https://localhost:9002/tmp/minio02/disk0{1..4} https://localhost:9003/tmp/minio03/disk0{1..4} https://localhost:9004/tmp/minio04/disk0{1..2} https://localhost:9005/tmp/minio05/disk0{1..2}
Server3: minio server --address localhost:9003 https://localhost:9001/tmp/minio01/disk0{1..4} https://localhost:9002/tmp/minio02/disk0{1..4} https://localhost:9003/tmp/minio03/disk0{1..4} https://localhost:9004/tmp/minio04/disk0{1..2} https://localhost:9005/tmp/minio05/disk0{1..2}
Server4: minio server --address localhost:9004 https://localhost:9001/tmp/minio01/disk0{1..4} https://localhost:9002/tmp/minio02/disk0{1..4} https://localhost:9003

Setup information

minio version

+ minio version
Version: 2018-08-10T10:26:45Z
Release-Tag: DEVELOPMENT.2018-08-10T10-26-45Z
Commit-ID: 8fa104f4287549dc2df5aa50c0fd0316e7186886

Setup information

minio version

+ minio version
Version: 2018-08-10T10:26:45Z
Release-Tag: DEVELOPMENT.2018-08-10T10-26-45Z
Commit-ID: 8fa104f4287549dc2df5aa50c0fd0316e7186886