Skip to content

Instantly share code, notes, and snippets.

View nitisht's full-sized avatar
🎯
Focusing

Nitish Tiwari nitisht

🎯
Focusing
View GitHub Profile
@nitisht
nitisht / rosbag-MinIO.py
Last active April 5, 2024 08:25
Use Spark to read / analyse / store Rosbag file formats for MinIO server
from time import time
from pyspark import SparkContext,SparkConf
import pyrosbag
from functools import partial
import pandas as pd
import numpy as np
from PIL import Image
from io import BytesIO
import rosbag
import cv2
@nitisht
nitisht / Cool mc scripts.md
Last active April 30, 2019 01:30
mc json and jq playground

Delete all the objects in a bucket

while read -r key; do
    mc rm myminio/testb/${key}
done< <(mc ls --json myminio/testb | jq --raw-output '"\(.key)"')

Count objects in a bucket

@nitisht
nitisht / healthcheck.md
Last active November 17, 2023 15:32
Minio Healthcheck endpoint

Minio Healthcheck

Liveness probe definition

Used to identify situations where server is running but may not behave optimally, i.e. sluggish response or corrupt backend. Such situations can be generally only be fixed after a restart.

Kubernetes kills the container and restarts it in case of liveness probe responding with a failure code.

Readiness probe definition

Used to identify situations where server is not ready to accept requests yet. Such situations are generally recovered after waiting for some time.

@nitisht
nitisht / federation.md
Last active January 16, 2018 18:27
MSF with Minio and Core DNS

CoreDNS vs kubedns

  • On-the-fly DNSSEC signing of served data in CoreDNS.
  • kube-dns supports only etcd as the backend, CoreDNS on the other hand has several supported backends.
  • kube-dns records do not reflect the state of the cluster. Any query to w-x-y-z.namespace.pod.cluster.local will return an A record with w.x.y.z, even if that IP does not belong to specified namespace or even to the cluster address space. CoreDNS integration offers the option pods verified, which will verify that the IP address w.x.y.z returned is in fact the IP of a pod in the specified namespace.
  • Plugin chaining and pluggable architecture makes CoreDNS better suited to adapt to various backends, as compared to kubedns.

CoreDNS plugins

@nitisht
nitisht / Nginx_Minio_SSL_Term.md
Last active March 6, 2024 22:44
Self-signed certificate setup with Nginx proxying requests to Minio Server

Nginx SSL termination for Minio server load balanced setup

This document explains the steps required to set up Nginx proxy and SSL termination for Minio servers running in the backgronud.

Generate self signed certificate

Create a directory /etc/nginx/ssl/domain.abc, here domain.abc is the name of your website domain. Then use the below commands

sudo openssl genrsa -out private.key 2048
sudo openssl req -new -x509 -days 3650 -key private.key -out public.crt -subj "/C=US/ST=state/L=location/O=organization/CN=domain.abc"
@nitisht
nitisht / StorageClass.md
Last active December 4, 2017 18:46
x-amz-storage-class implementation proposal

Minio Storage Class

Storage Classes provide administrators an option to set number of parity disks used for erasure encoded objects.

Current behaviour

By default Minio server uses half of the available disks to store data and rest for parity. This means if you have N disks, Minio server will erasure-encode data across as N/2 data disks and N/2 parity disks.

The write quorum is (N/2) + 1 and read quorum is N/2.

With Storage class support

Before starting Minio server, administrator can set these environment variables.

@nitisht
nitisht / Mint_Automation.md
Last active November 16, 2017 18:05
Mint Automated runs for each PR

Mint

Mint is a Docker image based platform to run tests against Minio server using various Minio, AWS SDKs and Tools. Read more on Mint here.

Requirements of Mint automation pod

Following are the steps we need to follow

  • Once a PR is opened on minio/minio repository, GitHub sends webhook notifications to our web server.
  • Web server parses the incoming PR information and passes on this to an automation script. We can use https://github.com/adnanh/webhook or https://github.com/ceejbot/jthoober as the webhook receiver.
  • The automation script checks out the PR locally and builds Minio Docker image.
  • Push the Docker image to play.minio.io Docker registry.
@nitisht
nitisht / s3-lake.json
Created August 30, 2017 02:45
Apache Drill S3 plugin
{
"type": "file",
"enabled": true,
"connection": "s3a://lake",
"config": null,
"workspaces": {
"root": {
"location": "/",
"writable": false,
"defaultInputFormat": null
@nitisht
nitisht / conf-site.xml
Created August 30, 2017 02:38
xml configuration for Apache Drill and Minio
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
apiVersion: v1
entries:
minio:
- apiVersion: v1
created: 2017-06-15T17:48:36.895822482Z
description: Distributed object storage server built for cloud applications and
devops.
digest: 75ff1e3d779d8937cff57c28a102da97a520245d50e22c1a2763cbea064a76cd
home: https://minio.io
icon: https://www.minio.io/img/logo_160x160.png